Developer

ArduIMU quadcopter part III

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)

Common:

- 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

Development

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...


Details

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.

Codes

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


Jose.




E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Developer
    We are currently working to integrate AeroQuads great Configurator program to our ArduCopter. First releases are already available but I would wait a bit more. On ArduCopter we have been planning to use multiple sonars due big limitations on Joses IR solution.

    ArduCopter is official workname for DIYDrones joint project to combine this Jose's code and also Mikes AeroQuad code. Jose/Mikro and rest of us are working hard to get first official release out as soon as possible :)

    --jp
  • no other way with this source code to put the values. I read another source code to put the values with serial LCD in the field. refer to this site : http://radio-commande.com/experimental_projects/triwiicopter/

    just recompile and upload.
  • Yun, i know the procedure to tune PID .
    I like know how to modify this values on the arduimu quadrocopter.

    Need to modify and recompile and the test ? or have any other way to put the values on the copter ?

    regards and sorry for my poor english.
  • Hello Jose.

    Can you tell me why did you chose IR sensors for lateral distance measurement? Why not another Sonar like for height measurement? Sonar have a wider measurement beam, and I think that they can detect obstacle more often. A sonar can detect an obstacle even if it is not perfectly aligned, I think.

    It's a great project that you have there. It's one of the rare indoor autonomous uav project.
    I just began an indoor UAV project, so I am interested by all the information or advice that you can give me.
    http://www.diydrones.com/forum/topics/bob4-indoor-autonomous

    For the noise problems of the gyro and accelerometers, I mounted my PCB with rubber-bands. I had to test several rubber-bands models, and now it works fine. I think it's a good solution.

    Leon.
  • you made quad like jose.
    just using default value, it's ok.
    and how to tune pid was posted already.

    Jose commented
    "This is the way I adjusted PID:
    First I use D and I terms = 0. I start increasing P until the quad is unstable (I do this in my hand). Then leave P at about half this value. Then I start increasing D so the quad respond quickly to the movements... If you increase too much D term, the noise in the gyros makes the quad unstable. Again try to find a value that works but it´s stable (again with the quad in my hand). Finaly I use a little amount of I term to "self trimming".
    With this setup I start the first flights and start an iterative process to fine tuning the PID values"

    Yun
  • hello .... i start mount my arduIMU quad today.
    does anyone explain how i adjust the PID on arduimu ?

    regards.
  • Hi,

    I already have 3 layer of thick double side tape! I don't have 2 blades, I'd rather use counter rotating 3 blades.

    My kp and kd are very low (0.5 and 0.3) compared to yours. I would like to increase the kd for the stability but I can't. Maybe the blades are unbalanced. I will do my best to reduce vibrations because with such noise on gyros it is very hard to stabilize it.

    Thanks,
    Loris
  • May be change 3blades to 2 blades. I had also vibration with 3 blades.

    Yun.
  • Developer
    Loris, I mounted the ArduIMU with a double layer of a thick (and preferable soft) doble side tape.
    This helps to redude some vibrations...
    If you have too much vibrations you need also to reduce the Kd (and also a bit of Kp) terms of roll and pitch attitude control...

    Jose.
  • Hi,

    I made only part 2


    I am still doing ground test and I have a vibration problem. If I hold it in my hand and I put enough throttle for hovering :

    ADC.jpg


    and with a ramp on the throttle :

    ADC.jpg


    How do you solve this problem?

    Thank you.
    Loris
This reply was deleted.