### ArduPilot Basics for Dummies

Hi Guys,

This is my first post in this forum, but I have been reading on you progress for awhile now.

WOW! looks like you guys achieved so much with minimal HW and processing power.

A couple of month ago I finished a self balancing robot project (written on a PIC18). I proudly donated it to a local children science museum...where it will be treated nicely.As I am into RC planes for the past 20 and some years, I feel this a good time to take my programming skills to the next level with an auto pilot project. I am an analog hardware engineer dealing with power electronics but do have more than adequate programming skills. My drawback is my rusty linear algebra, as I am 12 years out of university...what I don't use daily I tend to forget.

I read Williams and Paul's paper and after some linear algebra refresh I could understand the concept pretty well. Going over the arduino code I came across some things I could not understand.

I hope you can help me get things sorted out.

1- I would like to make sure that I understood the basic flow of data:

- Take gyro data at regular intervals and integrate it to get the three angles

- Take periodic accelerometer data and correct gyro roll & pitch drift with

the complementary filter

- Take periodic magnetometer data to correct gyro yaw drift with complementary filter

- Normalize the matrix.

- use the roll/pitch/yaw rotation matrices to get the three angles as seen by earth coordinate system.

- use a PI feedback to correct the errors

2- can you please elaborate on how the DCM matrix elements are orginized (yes.. the post title was for dummies)

3- Is the gyro data integrated once or twice to get an angle?

I am sure more questions will pop up, but I think this is enough for now.

Sorry for my lousy english.

Any help will be appreciated.

Thanks,

S.B.D

#### Replies

• You lost me at 1!
Lol it would be great if this could be simplified a bit. Or maybe point me to a book or something. I really want to know what exactly i'm building and the mention of gyros,accelerometers and linear algebra has got me interested! Best of luck with your project!
Ali
• You may have titled this "ArduPilot Basics for Dummies" but as a total n00b it is way over my head. I have been dabbling in RC aerial photography but always with manually controlled aircraft. I was thinking of building something like the "Skywalker" airframe with a minimal autonomous capability. Here is what I had in mind. I like to use point-and-shoot Canons running the CHDK software with an intervalometer script. That eliminates any shutter controls. I just put in fresh batteries, a clean memory card, start the camera and then launch the aircraft of the kite if I am doing kite aerial photography. I believe in the KISS principle and this is what I have boiled it down to over the years. Now I envision another level of complexity but something far simpler than most of the systems discussed on this forum.

I would like to launch my plane, climb to altitude with the cameras shooting using the intervalometer script but then be able to trigger the system so that the plane would "loiter" at an altitude while navigating along a few waypoints. I envision setting the waypoints and altitude to describe a holding pattern at the proper distance and orientation from the photo target. When the photo mission has flown for a sufficient time to fill the memory card with photos I would then take control and land the plane. My proposed use of this technology would be as simple as i could make it.

• Developer
Hi SBD,

I can't say that your questions are really clear, but I'll try to answer....

1 - you probably understand the flow, but to make sure just look at the ArduIMU code.

2 - you can organize the DCM elements in a variety of ways in software. In ArduIMU they are stored as a two dimensional array, with the first index being the row of the matrix and the second being the column.

3 - when you talk about the gyro data being integrated make sure that you understand you cannot directly and separately integrate the three gyro signals to get three angles. You must combine the gyro signals, and this is why the DCM matrix is used. Each update of the DCM matrix involved one integration step of the gyro signals. Angles are then computed from the elements of the DCM matrix.

### Activity

RT @chr1sa: We've got another virtual @DIYRobocars race tomorrow at 9:00am PT. Two dozen autonomous cars will compete, four at a time. Ther…
Sep 4
sam liked Jimmy Oliver's profile
Aug 25
RT @ExplorerRobocar: Sometimes, I am really a big kid!! Having fun with my virtual RC car on the @diyrobocars track 😜😉, by using the « AR R…
Aug 24
RT @grepLeigh: @donkey_car @unity3d @TensorFlow ~1050 episodes into training, my agent learned to erratically drive in the left lane. 🤖😆 ht…
Aug 24
RT @EclipseCyclone: Sweet! http://Robotec.ai high performance #ROS 2 @unity3d #CycloneDDS bridge for @AutowareFdn @SVLSimulator now…
Aug 24
RT @a1k0n: My car had a lot of trouble getting around the track at the last @diyrobocars event -- only one actual finished lap during the r…
Aug 24
RT @SmallpixelCar: This is the run time map https://t.co/VzykOkUt2G
Aug 24
RT @SmallpixelCar: Made a lot progress on Warm Spring Raceways track. Almost finished one lap. https://t.co/nUVpufZQyP
Aug 24