PDA

View Full Version : Discussion New Open Source Autopilot


dmgoedde
Dec 17, 2008, 08:47 AM
Take a look here at Jason Edelberg's entry into the Propeller Chip 2008 design contest: http://www.parallax.com/tabid/704/Default.aspx

By nature of this design contest, this is open-source. It might be a good place to start for those wanting something to get them off the ground so to speak. For example, learn what Jason did, then tweak and experiment.

This is a MEMS IMU based system, with what appears to be a rudimentary Kalman filter, although Jason claims it is not, and instead a fuzzy logic method of blending the IMU sensor data. Jason's methos uses integer math instead of floating point. He calls it psuedo floating point, and uses integers in (for example) 1000x multiplied form to emulate decimal values to 0.001.

I don't purport to speak for Jason. The only reason I post this is because it is already in the public domain, and will likely be of interest to people here. I've reproduced the attachments here (source code and description).

Funny that the name of his system is "OughtTo Pilot". Makes me wonder if the name is inspired by "AttoPilot" name.

I reviewed the code for about 10 minutes, and can tell you it is nothing like Atto's code (sorry to those hoping to see my code)... some observations:
1) only a few Rx inputs are read, and they are read via tap off from the Rx like Paparazzi does (not measured on a per-channel basis)
2) Jason claims it only hits waypoints about 20% of the time.
3) It seems (from description) to only accept 1 waypoint. I didn't really dig into the code.

In my opinion this is a great starting place for interested folks. You can play around with how many Rx inputs are read and number of servos controlled, tweak the Kalman-ish filter and perhaps add a yaw gyro and fuse in GPS data, play around with correcting for centripetal forces or otherwise augment the kinematic model, experiment with navigation math.

Dean

eddymoore
Dec 17, 2008, 10:07 AM
Funny that the name of his system is "OughtTo Pilot". Makes me wonder if the name is inspired by "AttoPilot" name.


You might perhaps spot that 'OughtTo' bears a slightly closer resemblance to 'Auto' - as in 'Auto pilot'. Let's not loose the plot here.

Looks like a fun project - the propellor chips are interesting. Slightly remind me of the XMOS stuff, though the XMOS stuff is a much more capable chip. Would be fun to experiment with one of them for an autopilot. You can do alot with 1600MIPS.

Integer math is to be congratulated. Not enough people spend the time to make algorithms fixed point, but the speed savings can be astonishing. A fixed point Kalman filter is no small undertaking - a lot of thinking and exception testing needed.

dmgoedde
Dec 17, 2008, 02:58 PM
You might perhaps spot that 'OughtTo' bears a slightly closer resemblance to 'Auto' - as in 'Auto pilot'. Let's not loose the plot here.

Looks like a fun project - the propellor chips are interesting. Slightly remind me of the XMOS stuff, though the XMOS stuff is a much more capable chip. Would be fun to experiment with one of them for an autopilot. You can do alot with 1600MIPS.

Integer math is to be congratulated. Not enough people spend the time to make algorithms fixed point, but the speed savings can be astonishing. A fixed point Kalman filter is no small undertaking - a lot of thinking and exception testing needed.I re-read his .pdf last night. What's going on is not a Kalman filter, but (I'm going out on a limb here) the alpha/beta method (Wiki it for more info), and somehow using traditional P and I type method to apply weighting to Accel versus Gyro, and I methods to trim integrated error from gyro method, I suppose to tune the gyro bias.

One area for improvement is he looks at total forces on accel and if they are close to 1g then Accel is trusted more. If the total g force is >> 1 then accel is de-trusted. What he is leaving out is that extra G is not necesairly noise in the accel (perhaps from engine vigration) but certainly has centripetal force components. Using only a 5DOF MEMS sensor suite there is no tracking of yaw in the body centered reference frame, so no way to subtract one of the important axis of centripetal force. With Jason's sensor suite centripetal force could be estimated in the Z accel axis given pitch rate and forward speed, and this might improve his performance.

With the Prop chip he could have used floating point, but I think chose integer psuedo floating point for speed. One nice thing about prop chip is for 32 bit longs, it automatically handles the sign in operations. I remember starting out on 8 bit micros and having to track the sign bit for operations, and have to say NO THANKS.

Anyway, I know some people on here at times ask for open source autopilots. Something like this is not refined like Paparazzi, but is still far above a base starting position to tinker with. Using DIP prop chip and some stuff from Sparkfun (5 DOF IMU sensor) anyone can put this system otgether for under $300.