# Mo' programming, mo' problems- Thank GOD for the IMU

The problem

I think all engineers should play an active part in the programming of any robots they do. I suddenly realize the value of actually and actively sitting down and seeing what your robot can and can't do with the equipment you planned to put on it. A good example might a problem i had with waypoint navigation and the fact that "you have a bearing to head to and an inaccurate compass that updates about once a second" This is not good if your waypoints are close together. If they were far away, you could make it. This racked my brain for a few good hours. After trying different coding, and seeing what was acceptable, the best, cheapest answer for me right now became pretty clear. I've decided to put that IMU on the plane.

The solution

That IMU is going to be put into some pretty wide usage. I'm sure that having a compass would be easier, but an IMU...if i have a compass heading, i figure that I can calculate the angle and wait for the compass to refresh to tell me i'm on the right track. Sure there might be a greater degree of error, but the fact that i can do this with my altitude as well makes it a forgivable loss i guess. I say that now...

Since this is a 5 axis IMU, i will lose Pitch. At first, i thought about losing Roll, as I didn't see myself doing much rolling when i have the rudder, and even if i did to make for a sharp turn, i have the copilot to right me. Then i realized that was pretty foolish. I have an altimeter and i can plot a rate of climb/descent using that, and therefor my pitch. This means that i will have a *FUN* time programming in the math to accurately get my bearing precise. I think if i put my X and Y axes to use, and know my Roll, Pitch and Yaw rates, i should get a vector from the two components. and that will help with the coarse tuning. when i get close enough, i will level off and fine tune the turn with pure rudder (Yaw). Does this sound feasible?

Don't worry about the difficulty of the math, i just need to know that it will work lol.

As far as programming goes, i will have a second snapshot up soon with a bunch of fixes for what i messed up on in the first snapshot, and a more complete Autonomous Flight Activity, sans how it gets the waypoints and the IMU service, which i now have to make lol. grreeattt...

Views: 18

Comment

Join DIY Drones

1

2

3

4

5

6

7

8

9

10

## Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

24 members

51 members

184 members

51 members

8 members