Black Lives Matter - Action and Equality.

Getting position from my UAV

Hello guy!
I recently bought a gyros to implement real time position to my airplane. But I am having problems. The gyros, as known, send a analog ouput proportional to the angular velocity, but I need angular position.I remember from my school, position is the area below the curve of velocity, in other words, it is the integral of angular velocity. Could someone give an example code where obtaining the angular position from velocity. Or what else should I do?, what is the best way to obtein these parameters?

Regards,
Sam
samuel

Posts: 6
Joined: Tue Feb 16, 2010 1:11 pm

Re: Getting position from my UAV

I believe that the ArduPilot folks have published their sources. You might search for that.

Posts: 77466
Joined: Sat Feb 07, 2009 10:11 am

Re: Getting position from my UAV

Basically you just need to keep a running total of the angular velocity as sampled at a fixed interval, being certain to not lose the sign, e.g. if you read 2, 3, 2, -2, -1, you should total that up as 4, not as 10. Then you're just a scale factor away from having the total rotation.

The part where it gets tricky is the math to add the rotations on all three axes properly, e.g. a 90 degree roll, followed up a 90 degree pitch up, followed by a -90 degree roll, winds up being the same as a 90 degree yaw.

If you look at existing code, you'll need to be very careful to pay attention to how the angles are combined and how the signs come in from the sensors. Getting a sign wrong will give you wildly bad results.

I'd concentrate on getting one axis working first, and then move to two and three axes.
--Paul

A wholly owned subsidiary of:
Persephone: DL R+W+B C 7 X L W C++ I++ T+ A E H++ S+ V-- F+ Q P B PA+ PL
Aldebaran: DM Rt H 5 Y L- W+ C+ I++ T++ A+++ E H++ S+ V+ F++ Q+ P B++ PA- PL--

pstemari

Posts: 310
Joined: Sun Mar 21, 2010 6:10 pm
Location: Seattle, WA