Hi all, I have a new drone in the family...

This tiny drone is able to do completely automatic flights, it can perform altitude hold (based on sonar sensor) and obstacle avoiding based on IR distance sensors (you could see the "black stange eyes" on the photo). It´s your personal droid...

Look at the video (the "tennis game" part it´s funny. Thanks to Ramon for the idea!!)

There are some new features in this thrid part... This is the list:

For outdoor configuration:

- GPS library support (actually UBLOX or NMEA)

- Position hold based on GPS

For indoor configuration:

- 4x IR distance sensors to detect obstacles (1.5m range)

- Obstacle avoiding (using distance sensors)


- Altitude hold based on Sonar (LV-EZ0)

- Automatic flight pattern (experimental).

--- Automatic takeoff

--- Position hold [outdoor] or obstacle avoiding [indoor] during a predefined time

--- Automatic descend

--- Automatic landing

- Added XBee for telemetry (and debug)

And some improvements in the code:

- New "radio test mode" to test radio equipment

- Revised control routines


For the GPS position hold I had to implement the navigation algorithms for the quadcopter because it´s really different that the one used for planes...For this navigation it´s necesary to have the magnetometer to cancel the yaw drift in hover conditions. One thing I have observed is that you can only fly this tiny drone on very calm days because it´s too light for the wind... so it´s better suitted as an indoor drone. Then I started to think how to make a cheap way to navigate on indoor enviroments... I have one sharp IR disntace sensor so I start making some tests mounting the sensor in a servo to make a 180º scan. The idea was to mount 2 (or 4) of this sensors in the moving head.
On the tests I found that in this little machine the moving head caused some inestability, so I decided to mount 4 sensors in a fixed way. OK, this the cheap DIY version of an EXPENSIVE laser range finder, but it works...
there are many thing to improve and test, but it´s a promising start...


Sonar module is an LV-EZ0. Because we don´t have any analog input available I use the PWM interface in a Port Change pin (PCINT20) to use an interrupt to read the sensor. (It´s recommended some solder skills to make this modification).

For the IR range finder (Sharp GP2Y0A02) I needed to use a separate Arduino Pro mini (again we don´t have any analog input free). This module connects to the ArduIMU via Serial port so we need to choose between GPS of range finder (outdoor-indoor decision).

On this III part, the hardware (ArduIMU) really show it´s limits... it´s not a problem of CPU power, it´s a problem of the limited I/O as I said before, so it´s time to move to the big brother, the new ArduPilot Mega Hardware... this new platform will be fantastic for this projects...

Behind the scenes

During the test of position hold I have some crashes (nothing important, only some broken propellers...) and there was a moment in that the quad performs not so good, so I start searching the reason. Again I suspect that it could be a vibrations problem so I decided to make a modified code to test the vibration on each motor.

As you can see I have problems on left motor, so I change this prop, also add a new layer of doubled sided foam tape to the ArduIMU and problem gone.

The code is here: Quad1_mini_test_motor_vibrations.zip (If you want to use it read the instrucctions)

Respect to the IR distance sensor, the first version was a moving head with a servo but this had some problems with vibrations that affect stability and also has a poor scanning rate, here is a photo of this prototype. Finally I decided to use 4 fixed sensors.


Some parts of this codes are still experimental but you can get it here:

Outdoor code (GPS): Quad_mini_1_27.zip . GPS libraries : GPS_libraries.zip

Indoor code (IR sensors): Quad_mini_1_29_rangefinder.zip External Arduino pro mini code: IR_distance1.zip

Old posts of this project: http://www.diydrones.com/profiles/blogs/arduimu-quadcopter-part-ii


Views: 115723

Comment by Jani Hirvinen on May 12, 2010 at 5:09pm
Some how i was expecting this to happen around this time and especially from you. have you measured your cpu usage. How is your energy saving modes? I planned to have same sensors and switch them of after certain altitude how is yours?

Comment by Earl on May 12, 2010 at 5:26pm
I think the APMega with serial from IMU might be good also. That's what I'm messing with.

Comment by Randy on May 12, 2010 at 5:39pm
You should have no problems winning round 7 of the DIY Drones Trust Time Trial (autonomous takeoff and landing). I didn't read anywhere that it was restricted to planes although that was likely assumed.

Comment by Jani Hirvinen on May 12, 2010 at 8:32pm
@Earl, yep APMega would be great for this due it has 4 serials. I'm also looking if we can run everything on 644 based chips, it has 2 serials and can run with 20mhz clock. Already produced pcb's for it.
Comment by Jeff on May 12, 2010 at 8:37pm
We have two mcu;s running? the V2 harware and another Arduinopro? whats this one doing? telemetry? or is it running the sensors/gps?
Comment by Loris on May 13, 2010 at 2:17am
Hi Jose,

You made an awesome job on this! I didn't think that ArduIMU would have enough memory space to perform everything you made!

Does the position holding (in outdoor) work well?

Comment by Rana on May 13, 2010 at 7:24am
Hi Jose !
I really enjoyed your video ! It is one of the greatest videos of a Quadrocopter.
When I look at your work, you seems to be a big Guru !
My best comliments to you for your greAt work !

Thanks & Best Regards


Comment by Jose Julio on May 13, 2010 at 8:31am
Thanks Rana, Thanks to all,

Jack, this sensors works nice for this application but also has some problems, for example it fails on windows and mirrors (there are light sensors). I think I need a minimun of 4 because this quad could move on all directions...

Dave, I agree with you, it could be possible...

Jani, I have not measured cpu usage but I know that my main loop executes at 70Hz wihout problems and probably more (100hz).

Loris, I´m only made 2 or 3 test of the GPS position hold. I could see that the algorithm works but I need to adjust better the control gains. I will make this tests with a bigger prototype. As I said, you need a very calm day to test things outside with this one.

Jeff, the Arduino Pro mini is connected to the four IR sensors to read the analog signals and send to the main board (via serial port) but all the processing stuff it´s inside the ArduIMU.


Comment by Jani Hirvinen on May 13, 2010 at 9:05am
Jose, if i go tomorrow to office, I could try to get accurate measurements from AI+ and also look the speed of I2C bus. Ok that bus should not be a problem due there is only one device now. But good to know if later on using i2c ESCs.

Actually implementing i2c escs should be rather easy it also gives full scale adjustment.

you still spinning all props to same direction or did you implement counter rotation already?


Comment by Sandro Benigno on May 13, 2010 at 9:48am
Jose, excuse my newbie question but... why didn't you connected the Sonar into the Pro-mini sending altitude info together with IR sensors info? At 70hz on the main-loop, seems to be possible to read it and use on the PDI calcs. By this way we wouldn't needs to do the ninja's solder. I'm wrong about it?


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

Join DIY Drones

© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service