Taking Lego Mindstorms from toy to serious UAV platform

[UPDATE: after legal advice from LEGO, LatteBox has now changed its case design to remove the LEGO Technics holes, which you can see in these pictures. The new case is shown at the bottom of this post.]
What got me into this whole UAV thing a couple years ago was the crazy idea that I could combine my love of LEGO Mindstorms robotics with my interest in RC planes. And thus was born the first Lego UAV. But to be honest it's a bit a kludge, given the constraints of the huge Mindstorms motors, and the gearing apparatus I needed to get it to drive just one control surface, the rudder. (Everything else is controlled by the off-the-shelf FMA Co-Pilot).

That's a shame, because the Mindstorms NXT CPU module is a very capable ARM7 processor with Bluetooth, I2C ports, a display screen and a great set of programming tools, ranging from RobotC to LabView. And the available sensors include everything you'd need for a proper UAV, from 3-axis accelerometers to gyros, compasses, even pressure sensors. The only barrier to it being a real-world robotics platform is the motors, which basically only make sense in a Lego context. If only there were a way for NXT to drive regular RC servos....

Now there is. This week I received the new Lattebox NXT servo controller, which was first discussed here on DIYDrones a few weeks ago. It's a brand new product from a Taiwanese company, so it's still a little rough around the edges in terms of documentation (and I've got some doubts about whether the use of the Lego connecting holes is actually legal!), but the hardware build quality is excellent and it looks really powerful.

Here's what comes in the box:


That's an I2C multiplexer, which connects to the NXT CPU (and allows other I2C sensors to be connected) and a servo mulitplexer, with ports for up to ten servos. (You can add more of these boxes to a total of 160 servos--all independently driven by one NXT!). The I2C multiplexer costs $140 and the servo driver is $60. Both are quite small, around the size of a standard RC servo or RC receiver. The C code to run them is available here.

I haven't had a chance to put it through its paces yet, but I'm pretty jazzed about what I've seen. But at this point I need to disclose that there is a competitor to this product that I've been beta testing for the past few months (but can't yet talk about). Indeed, I've built a whole new UAV around this other NXT-to-servo hardware, which I'll be showing at the FIRST Robotics Championships in Atlanta on April 16-18. The ability to use the Mindstorms controller, sensors and IDEs for proper aerial robotics is nothing short of mindblowing, and I can't wait to unveil my bird then.

In the meantime, here are some more shots of the LatteBox device.

I2C mulitplexer

The servo driver board, out of its case.

Back side of the servo driver board

Both together...

[UPDATE: This is the new case, with the LEGO Technics holes removed. The case shown in the previous images are no longer available. If you order the product, you will get the case here, not the ones shown in the images above it!]

Views: 711

Comment by Wai Weng Kong on April 4, 2008 at 8:51pm
Hi, I watched your youtube video here: http://www.youtube.com/watch?v=ueEcQP1SOrY
and knowing that you are using 2 i-gyros and 3-axis accelerometer to build the IMU for the stabilization control instead of using the FMA Co-pilot.

May I know how do you kalman filter the gyros and accelerometers for pitch and roll? I have successfully implement the kalman filter for single axis based on the code here: http://www.rotomotion.com/downloads/tilt.c and http://www.rotomotion.com/downloads/tilt.h
However, I found that it's very difficult to expand it to 2 axis because I totally got no idea on how to deal with the gyro's cross axis interference.

Another concern is how can we deal with the lateral acceleration during the coordinated turn? I did google around for this topic but most of them come out with as long as the UAV is not turning for a long time, the estimated angle should be near to the actual bank angle. But this is not what I want because I would like my UAV to circle around the last waypoint until I switch back to manual control.

It will be good if you can give me some advice on this, Thanks.

3D Robotics
Comment by Chris Anderson on April 4, 2008 at 9:17pm
I've got some prototype gyros that do rate integration in hardware (they're great--but not on the market yet), so I can mostly stabilize by them alone. They drift over time, of course, so I sample the accelerometers every 100ms and average their readings over time to establish the gyro bias (I just use the arctangent trick to combine the accelerometer's x&z and y&z to match the x and y gyros). It's not perfect but it seems to work well enough with gentle turning and an inherently stable airframe.

(I can't share code yet (NDA'd) but will be able to in late April.)

Combine that with GPS correction and you've got an IMU with no Kalman at all! I don't know it it would work forever and in all conditions, but it seems to work okay for a few minutes, which is all that I've tested.

Obviously once I get a little more time, I'll code a proper Kalman and that will work even better. But for now, my kludge seems to be good enough to be a proof of concept.
Comment by Yu on April 5, 2008 at 7:55am
Hi! Chris,

Really thank you. Hope Everyone love LSC/NXTe kit :D
I will keep post the document and API, Source Code on http://nxte.googlecode.com/
And please try sync_group control mode. It's very good for UAV.

Regards,
Yu
Comment by rad man on April 12, 2008 at 10:47am
we did a robotics competition for our science fair and i used the lego mindstorms platform and i fell in love with how the programming works so now im saving up my money to buy one of these for my airplane
Comment by Yu on April 12, 2008 at 7:30pm

For the programming Language Lattebox current provide NXC and NBC code. I still have not much to debug RobotC code. :(
Due LEGO TECHNIC holes physical dimensions was be patented. So we update our case to this one.
Comment by Yu on April 12, 2008 at 7:59pm
We will use these parts connect to the new NXTe case.

Comment by rad man on April 12, 2008 at 8:00pm
what so you mean ill have to use a different programming interface?
Comment by Yu on April 13, 2008 at 6:29am
We use Bricx Command Center :)
Comment by uucww on September 30, 2008 at 11:05pm
good!!

Comment

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