All Posts (14054)
You'll soon be able to buy ArduPilot already made, but for those of you who would rather build their own, here are the necessary parts:
You can buy the boards here.
Eagle (PCB and schematic) files are here.
A pdf of the schematic is here.
Once you've made the board, instructions on setting the fuses and loading the bootloader are here.
A few notes on building the board: Aside from all the surface-mount components below, the only through-hole components you need to solder on are a 5-pin breakaway connector for the FTDI port (first five pins next to the GPS connector), the two 2x3 ICSP connectors, two 3-pin connectors for channel 1 & 2 output, one 3-pin connector for the power select and three pigtails (female-to-female servo connectors cut in half) for CTRL and channel 1 & 2 in. The other two channels (3&4) are not currently used. IMPORTANT: the power selector pins must have a jumper cap placed on two of the pins. Use the two closest to the servo-out ports if you're going to power the board from the RC receiver via the RC-in cables (that's what I've done in the picture above), or use the other two if you want to power the board with a separate regulated 5v power source. If you don't put the jumper cap on these pins, the board will have no power!
Components: ICs:
- 1x ATMEGA168: ATMEGA168-20AU-ND
- 1x ATTINY85: ATTINY85V-10SU-ND
- 1x Multiplexer (74LS157D): 296-14884-1-ND
- 8x 0.1uF: 399-3026-1-ND
- 1x 10uF: 511-1430-1-ND
- 2x Diode: BAS16WXTPMSCT-ND
- 2x Red LED: 350-2029-1-ND
- 1x Green LED: 350-2036-1-ND
- 1x Yellow LED: 160-1184-1-ND
- 1x Blue LED: 160-1646-1-ND
- 5x 1K: P1.00KLCT-ND
- 3x 10K: P10KJCT-ND
- 1x 16MHz resonator: 490-1198-1-ND
- 1x Reset switch (Sparkfun): COM-08720
- 1x Strip of breakaway connectors
- 1x EM406 GPS connector (Sparkfun): GPS-00579
- 1x EM406 GPS module (Sparkfun): GPS-00465
- 2x Female-to-female cables (cut each in half to make 3 pigtails to go to RC receiver): cables
- AVR ISP programmer and AVR Studio software
- FTDI cable
- FMA Co-Pilot
- Arduino IDE
- Latest ArduPilot (for the Atmega168) and MUX/Failsafe (for the Attiny) code. Check the ArduPilot home page for the latest versions.
Here are the instructions to build your own BlimpDuino platform. All the parts, with links and prices, are at the bottom:
Step 1: If you're buying a pre-made BlimpDuino board (not available yet), you're done! If you're doing it yourself, order the parts and assemble a BlimpDuino board. You'll need to also download the Eagle files from that post to see which components go where. Don't forget to check the polarity of the two big capacitors and the LEDs when soldering. Use the female machine pin connectors for the two motor outputs, and the male machine pin connectors for the 7-pin ultrasonic sensor connector. Once you've got the board assembled, set the fuses and load the firmware as per these instructions. Then you can load the BlimpDuino code with the Arduino IDE (remember to select "Arduino Pro" as the board. The latest code can always be found on the BlimpDuino home page.
Step 2: Cut out the gondola platform from the 1/16th plywood. Here are the dimensions:
Step 3: Assemble the Lego vectoring motor shaft with the parts listed below. The following view, with the assembled shaft on top and the exploded view below, should show you what goes where: Step 4: CA glue on to the plywood the two Lego blocks that hold the motor shaft so the little gear spins freely at the front end of the slot in the wood. Snip the studs off the two little Lego blocks without the center hole. CA glue them to the other side of plywood according to the following photo. Make sure the two Lego blocks are a little bit more than the width of the LiPo apart, as shown: Step 5: Enlarge the hole in the big Lego gear with a 5/32 drill. CA glue it to the shaft of the servo (try not to get glue in the servo!). Snip the mounting flanges off the servo. Plug the servo into a RC receiver and turn it and the transmitter channel one to center the servo. With the RC system still on, place the servo in the position shown below and ensure that the gears are meshed so the motor mounts at each end are more-or-less horizontal and pointing away from the board (depending on the servo, it may be impossible to get them perfectly horizontal. Don't worry; the software will correct for this). You can also check that a RC receiver and the battery can fit where shown: Step 6: Cut four 20cm lengths of very thin wire and strip and solder the ends to the motor terminals on one side, and male machine pins on the other (it doesn't matter which terminals go to which pins, since we'll just reverse them at the plug if the motors are going in the wrong direction). Make sure you put short lengths of heat-shrink tubing on the wires before you solder them on the connector. Once you're done, shrink the tubing over the connector solder joints. CA glue the motors on to the Lego motor mounts. Press the props onto each motor. Step 7: Double-stick tape the BlimpDuino board to the two Lego blocks, with the switch closest to the motor shaft. Wrap the motor wires around the shaft until you've taken up most of the slack, and then plug them into the two connectors on either side of the motor driver chip. Plug the servo into the connector closest to the reset switch, black wire furthest out. Here's a diagram showing the connections: Step 8: Depending on what batteries you're using for BlimpDuino and the ground beacon, make connector wires that match the two-pin power connectors on both the board and the beacon. Make sure you've the polarity right! Power on beacon and BlimpDuino. After BlimpDuino goes through its start-up self-check process (green LEDs flash in a circle, then servos go max down, center and max up), you should see stuff start to happen. BlimpDuino should light up the green LED in the direction of the beacon, and the servos should move up and down depending on what the ultrasonic sensor is seeing. The motors should turn in the opposition direction as the lit LEDs. The props should be blowing air back (away from the board). If they're blowing the wrong direction, just reverse the connector into the BlimpDuino board. Step 9: If everything works, you're ready to go! Inflate the envelope and tape the BlimpDuino gondola on the bottom and trim it all so it's neutrally buoyant, or as close as possible. Put the beacon on a chair in the middle of the room and power it on. Holding the blimp at the desired height, power it on and wait until the servos go up and down (that's a sign that ultrasonic sensor has recorded the distance to the floor). Let it go. The blimp should maintain height and circle the beacon. Looks simple, but that's the beginning of full autonomy! Step 10 (optional): If you want to fly in RC mode, connect a RC receiver to the other two connectors next to where the servo goes, and plug the servo into the receiver's channel 2 (elevator) position. Our code should autosense that a receiver has been connected and place you in RC mode, where the aileron controls the differential thrust of the motors, the elevator controls the vectoring servo and the throttle controls the speed of forward motion. Here's how to connect everything in RC mode: Here's everything you need (prices shown are approximate price of all the components if you buy from the retailers linked. In the case of multiple units, the price reflects the total price of all the units required):- BlimpDuino board and components ($94.56)
- Servo ($8.00)
- Thin plywood (1/16th inch) (use any thin plywood or plastic you have around the house)
- 2x N20 motors (for much more power in RC mode, you can use these motors, but note that they will require changes in the code to lower the power to the motors in autonomous mode to remain controllable. They will also decrease battery life. ($8.00)
- 2x props ($4.50)
- LiPo battery ($12.99) (you'll also need a balancing charger and power supply if you don't already have an appropriate charger)
- Ground beacon ($14.95)
- 9v battery connector ($0.51)
- Envelope ($12.99)
- Helium (also available at your local Target in smaller but still sufficient size for about $29.00)
Lego parts: (All but the last can be found by going to Lego's "Pick a Brick" store and entering in the name in search box)
- 4x "Cross Axle 8M" ($0.64)
- 2x "Angle Element, 180 Degrees" ($0.32)
- 1x "Cross Axle, Extension, 2M" ($0.06)
- 1x "Double Conical Wheel Z12 1M" ($0.22)
- 4x "Technic Lever 3M" ($0.52)
- 4x "Technic Brick 1X2, Ø4.9" ($0.16)
- 1x large gear (only available from this third-party store right now; I'm working to get it in the Lego store) ($0.29)
Total: $158.32 (without helium)
- 2 x 0.1uf capacitor, 490-2536-1-ND or, PCC1828CT-ND (recommended)
- 2 x 1.0uf polarized capacitor, 493-2364-1-ND (optional)
- 1 x Power regulator SMD, LM317EMPCT-ND
- 1 x Blue Led, 160-1643-1-ND
- 1 x 240 ohms low tolerance resistor <= 1%, RG20P240BCT-ND
- 1 x 390 ohms low tolerance resistor <= 1%, P390DACT-ND
- 1 x 10 kohms normal resistor, P10KDACT-ND
- 1x EM406 connector, Sparkfun
Eagle files (schematic and PCB) are here.
We all love the Multiplex EasyStar, but for autopilots that separate stabilization and navigation, its lack of ailerons is a limitation. (Stabalization--FMA Co-Pilot in our case--uses ailerons and elevator; navigation uses rudder and throttle). The next plane up in the Multiplex family is the EasyGlider, recently upgraded for brushless power with the EasyGlider Pro. It's bigger (71" wingspan vs the EasyStar's 54"), has ailerons and can lift more weight. But it's also a lot more expensive ($256 with power package, as opposed to just $66 for the EasyStar), and the front-mounted motor takes up a lot of interior room. How suitable is it for a UAV? I got one and tested it out last weekend. Here's my report:
As with all Multiplex kits, the build quality is excellent and the Elastopor foam goes together nicely with CA glue. If you get the optional power kit, all you need is four servos (2x HS55 and 2x HS81), a Deans connector, and a LiPo battery, along with your RC kit. You can put it together in one evening. I of course added a FMA Co-Pilot, and mounted the sensor above the wing. The plane is slightly nose-heavy in this configuration, but nothing a bolt or two in the tail can't cure. But when you put in all the equipment, you'll spot the first big disadvantage of the EasyGlider Pro: it's got less room inside than the smaller EasyStar! That's not just because the motor and the ESC are in the cockpit. It's also because the servo and pushrods are, too. In the EasyStar, they're all on the outside, leaving the cockpit entirely open for radio and camera equipment, but in the EasyGlider you have to share a narrower (albeit longer) space with everything else. You can see the two side-by-side in this picture:
The EasyStar is closest to us (it's the beat-up one!) and the EasyGlider is behind it. Even though I've added a camera-trigger servo on the EasyStar it still has more unused space than the EasyGlider. The only way to add more space to the EasyGlider would be to create a second "floor" layer above the servos and put autopilot equipment on that, under the foam canopy. Otherwise, anything you stuff in there risks tangling up with the servos, pushrods and other wires. Obviously, the other problem with the EasyGlider is that it's hard to put a forward-looking camera in it, since the prop is in the way, something which isn't a problem for the EasyStar with its pusher prop. There are people who have modded the Easy Glider to put the prop in a pusher configuration with a pylon, but that's too much work for me ;-) As for flight, the EasyGlider flies really well and the ailerons give more precise control than the EasyStar's rudder. But it's also a bit harder to fly for beginners, and if you crash nose-in, you're going to damage the prop and maybe the motor, which isn't a problem with the indestructable EasyStar. I found that the FMA Co-pilot had a hard time maintaining level flight at high gain settings, but that may be due to calibration problems. I'll have to test a bit more to see what the problem is. Bottom line: I prefer the EasyStar, but since I need the ailerons I'm going to continue working with the EasyGlider and create an autopilot layer for the cockpit as mentioned above. What I love about these foam powered gliders is that you can fly them anywhere and they can land on any surface without damage. So as an autopilot test platform, they're great for quick trials and experiments. But I wouldn't recommend the EasyGlider as the optimal UAV platform for serious use. For that, you'll want the usual high-wing trainer, even if that means having to take off and land from a proper runway.Jordi's really outdone himself this time! He created a amazing full-featured simulator for ArduPilot that does the following:
- Uses the servo output from the autopilot or RC controller (depending on which one is selected by the MUX) to "fly" a plane in the X-Plane flight simulator, via a custom interface he's designed around this ARM board.
- Also flies the plane in manual RC mode with RC controller output going through the MUX and then into the ARM board.
- Displays the plane's attitude and other flight telemetry with a custom Ground Station built in LabView.
- Uses LabView to simulate the FMA Co-Pilot, stabilizing the plane in flight using PID loops.
- Display the plane's position in a moving map using Google Maps, which also shows waypoints.
The code is Jordi's new NMEA parser for the Locosys GPS. It's checksum verified, rocksolid, continuous, no delays, loop rate is about 32000hz. It uses pointers, so it's efficient.
You have to configure the Locosys for the first time you use it. It's very easy, you just need an FTDI cable. Be sure to connect the GPS to a 3.3 volt source. (We'll do this setup for you in the commercial version)
Instructions (please use the picture above as reference):
1-Run Realterminal and open the port @4800bps, you should see all the NMEA stuff, is not check the connections..
2-Now make sure you have checked the options marked with the green arrow... +CR +LF
3-Copy and paste this code: $PMTK251,38400*27 to the box indicated with the red arrow.
4-Then click the "Send ASCII" button indicated with the blue arrow..
5-Then the NMEA should disappear, and starting showing strange values. Go back to the "Port tab" (yellow arrow),
close the port, and choose the Baud "38400", and open the port again. You should the NMEA data again... =)
6- Then go back to the "Send" tab, and copy&paste this code: $PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28 then click Send, this should turn Off all sentences except GGA and RMC
7-Copy&paste now this code: $PMTK220,200*2C This should increase the updates to 5hz... (WOW!!!)..
8- Now you are able to connect the GPS module to Arduino, (only connect the RX pin to the TX of the GPS)
9-Then upload the code above, and open the port monitor, you should see Lat, Lon, Course, Speed, Altitude, Fix Position... like this:
46024504 8050998 312 0 519 1 (and yes you now know the exact position of my Swiss Chalet =P)...
If you want other setup codes for this GPS, you can find them in this datasheet.
Code explanation
If you'd like to understand the NMEA parser code a bit better, here are some of the library functions that it calls (all from the standard C++ library):
- First of all pointers, which are very easy. They just give you the memory address where a variable is allocated in the ram: info
- Then the strncmp(), better know as String Comparator. We use it to compare the header of the NMEA string "$GPGGA": info
- Then strtl(), which means String to Long Variable. It converts a string number into a long variable: info
- Then the strtok(). This is the string tokens, which looks for tokens in a string, for example commas ",", the ones used to separate values in the NMEA sentence: info
- The atoi() will convert strings to integers: info
- If you want to know all the available functions, see the library called "strings.h", "stdlib.h": info and info