I'm at the FIRST Robotics Championship in Atlanta and we've just unveiled the first REAL Lego UAV. It's actuallly been working for a few months, but we couldn't talk about it since it's based on the new hardware that was just announced yesterday as the new FIRST Tech Challenge competition kit. Our UAV uses Mindstorms and the new hardware to make a full IMU-based autopilot, which both stabilizes and navigates the plane autonomously. It uses:

--Mindstorms NXT controller
--Two prototype integrating gyros from HiTechnic. These are not the rate gyros already available. Rate gyros output degrees/sec, which requires a pretty gnarly math process to measure and integrate the results over time to get absolute degrees. The prototype iGyros from HiTechnic do that in hardware, and output absolute degrees, which is very easy for the NXT to deal with with.
--A 3-axis accelerometer to calibrate the gyros using a modified Kalman filter. Basically gyros are right in the short term (seconds) but wrong in the long term (minutes; they drift over time). Meanwhile accelerometers are wrong in short term (they're noisy) but right in the long term (they don't drift). So we averge the accelerometer readings over time to correct drift in the gyros.
--A prototype servo multiplexer from HiTechnic. This is similar to the servo driver accessory that they're selling as part of the FTC competition kit, but is designed for RC use. It takes I2C output from the NXT and converts it into PWM for the servos. It also has a channel 6 input from the RC receiver that switches it from RC to NXT control (this is our hardware failsafe switch).
--A GPS sensor/datalogger (iBlue 747) that communicates with the NXT via bluetooth.

I'll post the RobotC code this weekend, but I wanted to give you a quick look at this. It's really cool, flies, and can now expand into anything else in the robotics world, from cameras to communications. More soon!

Views: 5327

Comment by Jack Crossfire on April 18, 2008 at 11:38am
Hard to believe 2 "integrating" gyros from HiTechnic could produce very useful results unless they were plugged into a common node which did the real integrating.

3D Robotics
Comment by Chris Anderson on April 19, 2008 at 6:59am
They're actually gyros originally designed for shake-reduction on cameras. Drift is on the order of 10 degrees/min, which isn't bad at all. We're also using a high-wing trainer, which is naturally pretty stable, so it's nowhere near as hard as your helis

When the plane is supposed to be flying straight and level, we sample the accelerometers constantly and do a least squares regression every second or so to establish "true down" and then adjust the gyro bias accordingly.. When the bias gets too high (more than 90 degrees), we reset the gyros to zero and start over.

As a final check, if the accelerometers say we're flying level and the gyros say we're flying level, but the GPS says we're turning, we can add a calibration factor to the bias to compensate for those errors.

So basically we're using:
--gryos stabilization at 100hz (near real time)
--accelerometer corrections at 1hz (every second or so)
--GPS corrections at ~0.01hz (every minute or so)

So far all I've tested in the air is the first two, which still need some tweaking of constants but look workable. Have not flown autonomously in a straight line long enough to test the third.

Comment by wayne garris on April 20, 2008 at 9:06pm
wow chris looks cool !!! what type of control loop are you useing ? a PID loop is what most pro APs use.

3D Robotics
Comment by Chris Anderson on April 21, 2008 at 7:20am
I don't think my control loop qualifies for anything as formal as PID designation, but that's roughly the direction we're headed. Right now the gyros fly the plane with a direct proportional input, and the rest just calibrates the gyros when the plane is supposed to be flying level.

Comment by wayne garris on April 21, 2008 at 8:27am
its not realy that hard here is an example program for a basicx controller. . its writen in a true subset of vb

PID 1.1.zip
Comment by Alberto Figueroa on July 27, 2008 at 6:01pm
Dear Chris Anderson:
I am really interested in the project of the full IMU based autopilot with the hardware based in the Mindstorms control and the new hardware.
I would thank you send me the RobotC code. We work with Labview and the toolkit for Mindstorm
I want to use the same hardware like the Mindstorms UAV:
Mindstorms NXT controller
Two prototype integrating gyros from HiTechnic.
A 3-axis accelerometer.
A prototype servo multiplexer from HiTechnic.
A GPS sensor/datalogger (iBlue 747).
I want to expand into anything else in the robotics world, from cameras to communications.

3D Robotics
Comment by Chris Anderson on July 27, 2008 at 6:42pm
I'm afraid the gyros and MUX are still not available from HiTechnic (I've got the only prototypes)

My code won't work with standard gyros.
Comment by Paul Marsh on October 29, 2008 at 5:15pm
Hi Chris,

I contacted HiTechnic regarding the iGyro integrating gyros to see when they might be available commercially and learned that they are evaluating that right now. They might not go commercial, but if they do it could be early to mid 2009. If these do not become available, does that mean that the Mindsprings NXT is not really a viable platform to both stabilize and navigate a plane autonomously? Even though affordable plug-and-play autopilots seem to be right around the corner, I love the idea of a "toy" being used for this purpose. It's also a bit more "DIY," but something I can handle, I think.


3D Robotics
Comment by Chris Anderson on October 29, 2008 at 5:32pm

It is possible to build a Mindstorms IMU with standard gryos and accelerometers, but the software is a lot harder (too hard for me!). You need a real Kalman filter, rather than the simple PID loops that I use. But if you're up for that, it's technically very possible.
Comment by Paul Marsh on October 29, 2008 at 6:35pm
"Kalman filter?" I'm afraid it's already above my head! I'll save my pennies for an ArduPilot Pro or AttoPilot. Thanks for responding.



You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2014   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service