All Posts (14061)

Sort by
3D Robotics

Arduino debugging tips

3689308521?profile=original

If you're trying to upload code with Arduino and you get an error message that looks something like this:
"Problem uploading code.....

avrdude: stk500_getsync(): not in sync: resp=0x78
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x78"

(or any other error report when uploading code, aside from the obvious ones like compile errors or choosing the wrong serial port)

Here are the most common causes and things to check.

  1. Did you check the "Set RTS on close" box in the Windows Com port, as instructed in the manual?
  2. Are you selecting the right board? For ArduPilotMega, if your board uses an ATMega1280 processor (the big chip on the APM board will say "ATmega1280") select "Arduino Mega (Atmega1280)". If you've got an ATMega2560 chip, select "Arduino Mega 2560". For the original ArduPilot and ArduIMU, choose "Arduino Duemilanove".
  3. Is the cable plugged into a USB hub? That can sometimes cause trouble. Try plugging it straight into your PC.
  4. Are you using the latest FTDI drivers? Install them if not. If you're still having trouble, try reinstalling them.
  5. Check your solder joints! It's a good idea to reheat and reflow all of the ones you did, just to be sure.
  6. Other errors that have caused this problem in the past include a power source (such as your ESC) that is putting out a voltage outside the acceptable range of 4-7v, faulty USB or FTDI cables, and corrupted FTDI drivers. When in doubt, try a different power source, a different cable or a different PC.

Additional things to check if you're using the original ArduPilot board (not ArduPilotMega):

  1. [For original ArduPilot board only] Is your FTDI cable plugged in the right way? The black wire or side marked "black" should be on ArduPilot's BLK pin.
  2. [For original ArduPilot board only] Are you using the DIYDrones or Adafruit FTDI cable? We've had trouble with other ones...
  3. [For original ArduPilot board only] Is the ArduPilot board powered on, ideally through your RC system or ESC? (You can NOT power it from the FTDI cable; this is a safety measure to avoid power conflicts.)

If those all look fine and you're still getting the error message (especially if you can successfully load code to other Arduino boards), you may have a corrupted FTDI driver or a bad FTDI cable. Try reinstalling on another PC and see if that does the trick. If it doesn't, you may need a replacement FTDI cable.

In some rare cases, a power glitch may have resulted in a corrupted ArduPilot bootloader on the ATMega chip. This tutorial will show you how to reload the bootloader. (Warning--for experts only and requires an AVR programmer. This should not be necessary for most people.)

Other problems can include "Serial port not found" (just check that you've selected the right serial port in the Tools menu. It's the one assigned when you first plugged in the FTDI cable--probably 5 or higher), and the Arduino IDE freezing (try unplugging the FTDI cable. If that doesn't work, just reboot your computer).
Read more…
3D Robotics

Original DIY Drones UAV projects

These are projects from 2007 and early 2008 that were a lot of fun to do and are still worth checking out for UAV ideas. There is also a PDF/poster that shows how they compare to military and commercial drones.

GeoCrawler 1 (Based on a LEGO Mindstorms autopilot)

Img_4145

GeoCrawler 2 (Based on a cellphone autopilot.)


Viking1

GeoCrawler 3 (Based on a custom BASIC Stamp embedded processor autopilot)


3689308135?profile=original

GeoCrawler 4 (Predator airframe and AttoPilot autopilot)
Read more…

Reading PWM from a receiver

Hey all.I know this subject has been covered in many ways, but I am hoping that someone can assist me. I hope someone can have the patience to answer a few of my VERY NEWB questions.What I am trying to do is to send PWM to an arduino on an air vehicle which will then send the appropriate servo controls. Simple enough some may say, but I am in a bind since I just cannot get my head wrapped around this and frankly, I think my research has gotten me confused.My BASIC NEED is to be able to see the pulsewidth values in Milliseconds or in PWM values on Serial Monitor and see the values change as the sticks and knobs are moved.I know some may say, why not just use RC to control the servos without the Arduino? The answer to that is that I want to eventually turn control over to the Arduino like in ArduPilot, and use the Arduino as an IMU sort of. The ArduPilot code has been interesting to analyze but I have not gotten closer to my VERY BASIC need. Being able to look at the ArduPilot Pro code would likely be a very good insight......but that is not available to my knowledge.I have tried ServoDecode, ServoTimer2 and SerialServer libraries and I can capture the PPM for the channels alright on Pin 8, but it does not show me the changes to the pulsewidth when the sticks are moved. I thought I might have what I needed by downloading Chris' RCTest code but since I don't want to move anything like motors for thrust or vectoring and tried to uncomment the Servo stuff it doesn't do anything. When I compile it and run, it does nothing. It just sits there and the servos just jitter and sometimes go to extreme lock..I just need to see the pulsewidths and move SERVOS accordingly.. Jordi in his thread to Hack a receiver was a good piece of code, but the next file he released to read the PPM just displays a scattered array of numbers that don't relate to anything. In that code, and in finding the PPM string I get a value that goes like 214567. Is this a MicroSecond value and how could one convert this to a Milli-Second value? Multiply by 1000?Thanks to all in advance for any help or direction you may send my way.Happy Holidays to all.Jim
Read more…

Interesting 900MHz radio

Take a look at http://www.avalanwireless.com/product_list.htm. Click on OEM Radio Modules and check out the AW900mSPI.The AW900m is a 900MHz digital radio with lots of range and throughput - 1.54Mbps radio channel with 900-1100kbps delivered. SPI/UART version will retail for $129 per card. These look really good - I should have a couple of modules shortly and will report on performance. The UART version is actually designated AW900mUART.
Read more…
3D Robotics

How to program the Attiny on ArduPilot

To load the failsafe firmware on ArduPilot's Attiny chip, you need to do the following. 1) You'll need an ICSP AVR programmer. We recommend AVRSIP2. Connect the cable to the correct ICSP port on your board, as shown above. The red stripe on the cable should be on the same side of the connector as the square solder pad on the back of the board. (On our boards that means that the red strip is on the side closest to the processor) 2) Now you'll need to change (turn off) one of the default "fuse" settings in the Attiny45, which divides the internal clock by 8 so it only runs at 1 Mhz. (Explanation of all that and more about fuses are in the excellent Sparkfun tutorial here). Run the AVR Studio program that came with the AVRSIP2 programmer. Ensure that the board is powered on by connecting it to an ESC or other power source! The red LED on the board should be on. 3) To change the fuse with AVR Studio, connect the programmer and go to Tools/Program AVR/Connect. Choose AVRISP mkII. You may get an error (choose cancel). On the "Main" tab of the dialog, click the "Settings" button and pick 125khz and click "Write". Then make sure "Device" is Attiny45 and "Read signature". At the bottom it should say that all's okay. If so, switch to "Fuses" tab and uncheck CKDIV8. Press "Progam", then "Verify" to make sure it's woking. [Note for those who are curious: the AVR programmer can only work at 1/4 of the clock speed of the chip. The Attiny ships with a 8Mhz internal clock, but when that DIV8 fuse is set it's only running at 1Mhz, so the programmer must be running at less than 250khz. Once you clear that fuse and the chip is running at full speed, the programmer can run at 2Mhz, which is 1/4 of 8Mhz]. Your processor is working fine and ready to program. 4) Now you'll need to burn the firmware. Still in the AVR Studio dialog box you used above, go to the Program tab. Where it says "Flash", input our firmware hex file. If you've already downloaded it in some folder, you can select that here. If not, switch to your browser and download this file. Click "Program". All should go well and you'll see the OKs below. If you want to make sure it's working, you can click "Verify". Now you can go back to the "Main" tab and change the Settings to 2Mhz. That's it! The failsafe should be working now. Connect the CTRL lead to channel 5 or 6 of your RC receiver and power on the ArduPilot board. When you toggle that channel a red LED should go on and off on the ArduPilot board, indicating that control of the output channels is being switched from the RC receiver to the autopilot or vice versa. For extra fun, toggle it back and forth fast five times. That should reset the autopilot (for in-air recovery).
Read more…
3D Robotics

New ArduPilot MUX code

We fixed some bugs in the ArduPilot's failsafe code, which runs on the board's second processor, an Attiny45. It now works great, and has a secret "reboot the autopilot" feature. Just toggle the autopilot enable switch on your transmitter five times fast, and it will reset the Atmega168. Great for times when you don't want to land just because a random bug froze the autopilot. Otherwise it just does what it's supposed to do: transfer control from RC to autopilot and back again on command--every time, without fail. The new code (source and everything) is here. If all you want is the hex file to load on the Attiny in AVR Studio, it's here.
Read more…
3D Robotics

Day two at DIY Drones HQ--success!

Jordi came over today and finished up the work on ArduPilot and the second simulator. He caught a lot of bugs that had been bedeviling us, especially unintended crosstalk between the main autopilot processor (the atmega168) and the failsafe processor (the attiny45) that made it impossible to load code when one or the other was on. All fixed now: it was a code error, not a problem with the hardware. The new MUX code is here. The ArduPilot code is still in alpha but we should be able to release it in a few days. But the important news is that the boards have checked out fine. You know what that means? GREEN LIGHT TO PRODUCTION! The picture above is the final version. The countdown to commerical release starts now. Stay tuned....
Read more…
I have been working on/off on an autopilot to use in RC airplanes. The goal is to fully automatically take pictures of an object like a house, construction site, etc.I made the hardware in last year's Christmas holiday. During the year I spend a few hours writing the embedded software for it (in C, works much faster then assembly).The hardware is super low cost: The PIC dsPIC30f4012 is very cheap and still has enough memory and speed (30 MIPS) to be self sufficient autopilot.

The goal for this Christmas holiday is to do in flight testing of the hardware and stabilization routines.
Read more…
Hi - My interest till now has been building scale RC aircraft. Lately I see that it is possible to be able to view the world from the rc aircraft, I can build a drone but it is dumb. I need to start looking at what equipment is required to be able to pilot the aircraft out of sight.Can any body help with where I would go to start to collect this information on the web? Not being an electronics person is a bit of a hindrance but I can learn. Any help appreciated.Thanks
Read more…
3D Robotics

When autopilots kill

From a long and very good article in Vanity Fair about a Brazillian mid-air collision last year, when two aircraft coming from opposite directions were given the same altitude and heading. The autopilots were so accurate that the two planes hit each other dead on in the open skies over the vast Amazonian rain forest: Excerpt: "Navigational precision poses dangers not immediately apparent. In the Legacy, it was based on three systems. The first was an ultra-accurate altimeter, capable of measuring the atmosphere with such finesse that at Flight Level 370 it could distinguish the Legacy's altitude within perhaps five feet. The second was almost as accurate. It was the airplane's satellite-based G.P.S. receiver, a positioning system that kept track of the airplane's geographic location within a distance of half of its wingspan, and that, linked to a navigational database, defined the assigned airway with equal precision. The third was an autopilot that flew better than its human masters, and, however mindlessly, worked with the altimeter and G.P.S. to keep the airplane spot-on. Such capability is relatively new. Until recently, head-on airplanes mistakenly assigned the same altitude and route by Air Traffic Control would almost certainly have passed some distance apart, due to the navigation slop inherent in their systems. But this is no longer true. The problem for the Legacy was that the Boeing coming at them on the same assigned flight path had equipment that was every bit as precise."
Read more…
3D Robotics

Cool new all-in-one prototyping software

Fritzing is designed to help non-engineers take breadboard Arduino prototypes and quickly create schematics and PCB files. It's just in an alpha version now, but the potential of this software is tremendous. It's amazing to see how quickly the Arduino community is growing and innovating, thanks to its open source foundations. Check it out and stay tuned for the beta, which should be out in a few months.
Read more…

Tracking your UAV in a 3D environment

NB: Edited earlier post with new link to script download site. Also, if you check the arcscripts site there is a flip book animator for the application that will iterate through georectified images in the order you set based on a timer, or manually (this allows you to move backward and forward), or you can click the image in the list to have it display. Allows you to set the transparency of the image so you can see the base layers beneath. Will post the live GPS feed task for ArcGIS explorer to ArcScripts in the coming weeks. Has support for Thales digital radios proprietary sentence. Hope some of you like it and can use it for your applications.Hey Guys,I'm a developer at ESRI and work on a product called ArcGIS Explorer. Its a free 3D mapping application you can download from the ESRI website. Now I don’t mean to plug ESRI here, but this application is free, and you have a clean entry point to add custom coding to it.At our developer summit back in April I presented and wrote a sample app that positions a 3D glyph (model) of the millenium falcon above Area 51. I added some code to predict where you will be in a straight line based on your current lat / long, alt, speed and bearing. Running the task you are able to change its speed, bearing, pitch and roll. I didn't add code to overcome gimle lock however.So, if you can provide the lat/long/alt and bearing, you will have an instant tracking solution for your UAV. The code for the sample is located here:http://arcscripts.esri.com/details.asp?dbid=15900and you can download ArcGIS Explorer from here.http://www.esri.com/software/arcgis/explorer/index.htmlI made the code as generic as I could, its written in C#, and all of the drawing is in OpenGL. Take a look at the code and you should easily spot where to plug in the coordinates.

I've also written a live GPS task that we will release probably later this year (not source code however).Few snap shots from Visual Studio

This parses NMEA and shows you your position bearing etc. I’ve added the ability to track your movement which creates pushpins on the surface. The added pushpin content is what we call a result. A result when double clicked will show you a popup. A popup can contain anything from text, to a web ref, or a locale file on disk. Here you’ll see I am referencing a picture of a car.

So, imagine not only your position being shown, but if you are taking stills, or capturing stills from a video stream, you could create a pushpin on the ground below your position, write the image to disk, then write the location and file name into the Popup’s description. Then as you see above you would have something that conveys a lot of information.Also, I’ve written a Geotagging task that will be available later this year. Sorry but I have no control over the release times, except for sample code. Geotagging will enable you to send the image to anyone with mapping software that can open geotagged images, and it will place them exactly where the coordinates tagged to the image specify.It would be interesting to hear from any of you interested in this, ideas, issues, let me know. Not knocking Google, I think its great (virtual earth rocks too), but a lot of this type of functionality you only get with the pro version I think.Edan Cain
Read more…