Arducopter's Sonar-based Altitude hold works great

3689390365?profile=original

I have installed the recommended sonar sensor (XL-Maxsonar EZ4) on my custom-framed Arducopter. Using the ArudPirateNG code, I've been flying with the Altitude hold and it works great. I love it! It allows me to put the quad at the altitude I want, say five feet off the ground, flip the Altitude hold switch on my Tx, and then fly around at will at that altitude. This allows me to practice my yawing, pitching, and rolling without having to worry about crashing into the ground. (Still have to watch out for trees and buildings!). It's very cool. Thank you to the team!

 

I'm really looking forward to automatic take off and landing in the future, and also obstacle avoidance (using yet to be installed side-firing sensors obviously). I have included some pictures of how I mounted the sonar sensor underneath my quad. I have also included some pictures of the tiny EyeCam camera (made by DraganFly Innovations) that I installed on my arducopter. It transmits video in real-time back to a 9" portable screen and a small video receiver that I rigged up with a battery.


3689390421?profile=original

 

 


3689390390?profile=original

 

 

 

 

 

 

 

 

 

 

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • I have a query regarding Alt hold in general... I have the max Lv-ez04 sonar on my quad with apm 2.5.. and I am moving on to the alt hold mode next..and I want to know how will the copter know when to trust the alt data from the sonar or the baro.....does it use both the sensors at the same time(so that they compliment each other) or does it just use just one at a time ...for example I switch to alt hold at 9 meters (which is just beyond what the sonar can detect) will the baro kick in or will the apm use the sonar data which is now outputing its max range value??? how does the apm know when to switch between the sonar and baro...if it uses the baro data what kind of precision can I expect..with a well tuned copter ??....I would like the experts to elaborate on this... 

  • Thanks for the comment.  I did some searching on the forum here, here is a link to that talks about the reading the distanstance.  http://diydrones.com/forum/topics/sonar-sensor-for-my-apm?commentId....  I hope this helps you.  Please let me know if you have any questions.  

    Best regards,

    Scott Wielenberg
    Technical Support & Sales
    of MaxBotix Inc.
    Phone: (218) 454-0766
    Fax: (218) 454-0768
    Email: scott@maxbotix.com

  • hello every one..

    1.i have got the same problem as andrew. as soon as i switch the quad to alt hold mode it climbs up very fast.i have tested the sensor in the cli mode. i got pretty decent distance values. ihave also tested the sensor using arduino and got the same distance values. i have used a lv ez4 and apm with 2560. i have been trying to solve the problem but i am not able to understand where the problem is comming from. i used ardupilotplanner.

    2. i want to try the ardupirates code.but i donot know whether ardupirates code supports 2560.

    thank you

  • Developer

    This is a great piece of information!   Nice testing as I guess would be expected from a professional organisation.

    I hope people can find it hidden away on this old post (of course I found it so maybe they will) and I guess you might add this to your product PDF some day in any case.

    Thanks again!

  • to the sensor under test). A large flat target was placed 1.5 meters from the sensor. This target at 1.5 meters allowed the sensor to report 1.5 meters as a valid target. The noise source output was increased until the noise just began to change the sensor output; the noise level was then decreased until no incorrect readings occurred, and this was recorded as the threshold.

     

    3692289220?profile=original

     

    Note: *Decibels (dB) are reported on a log scale. A passing train at 30 meters is ~90dB, and a passing train at 1 meter is ~105dB.
    *Our sensors are sensitive to noise above the human range of hearing so this is provided for reference only.

     

    Please let me know if you have any questions by email me at scott@maxbotix.com.

     

    Scott Wielenberg
    Technical Support & Sales
    of MaxBotix Inc.

    Phone: (218) 454-0766
    Fax: (218) 454-0768
    Email: scott@maxbotix.com


     

  • Hello everyone,

    MaxBotix Inc., saw your post so we decided to do some testing to help everyone see the difference in our ultrasonic sensors noise immunity.  

     

    First I want to address some of the above information.  The text quoted below.  

    I have the Maxbotix LZ EZ-4, the one with the widest beam.

    Only afterwards i noticed a smaller beam was advised.

    Any ideas how the wide beam would negatively affect altitude hold in our application?

    Would it be usable ? Can the beam be tuned ?

    I'm sorry, should be LZ EZ-0 of course

     

    The narrow beam sensors are the more immune to noise.  The narrow beam sensor is the LV-EZ4 and the widest beam sensor is the LV-EZ0.  The wide beam sensors have a higher sensitivity and as such are more likely to detect noise when noise is present in the operation frequency of the sensor.  The LV-EZ4 sensor is a narrow beam sensor and as such is less sensitive to noise.

     

    In some applications, users have been able to make any of our sensors work while others, only the narrow beam pattern like the LV-EZ4 would work.  

     

    The reason we recommend the XL series of sensors is because of the noise immunity. Demonstrated in the test below, you will see they are significantly more  immune to noise than the LV series of sensors.  

     

    MaxSonar Acoustic Noise Tolerance Test

    MaxBotix Inc., felt it would be good to do a test of the sensor's ability to reject acoustic noise sources, because of the interest to use the MaxSonar product line for use in the presence of acoustic noise.

     

    Below are the LV-MaxSonar-EZ sensor thresholds, where the noise began to affect the sensor, (ie. the noise caused one incorrect reading, out of 100 range readings). The LV-MaxSonar sensors provide decent noise tolerance. (Range to 9cm dowel provided for reference.)

    3692289150?profile=original

     

    Below, the extra acoustic noise tolerance of the XL series is readily apparent. Users needing the noise suppression along with the extra sensitivity are encouraged to use the XL-MaxSonar sensor line.

     3692289314?profile=original

    Here are the XL-MaxSonar-EZ/AE sensor thresholds, where noise the began to affect the sensor, (ie. the noise caused one incorrect reading, out of 100 range readings). (Range to 9cm dowel provided for reference.)

     

    The test was setup to evaluate the real world use of the sensors, to allow comparison between MaxBotix Inc., sensors. A noise source was used that produced a pulsating acoustic source of 30KHz to 50KHz with a sweep at a 60Hz rate. This caused large spikes of noise within the sensor frequency band. The acoustic noise source was placed about 50cm to the side of the sensor under test, with an output up to 120dB. This acoustic noise source was setup to direct the energy towards a large flat target, (which would then be reflected back t

  • I have had good luck testing with the EZ-4. I have hade it maintain arelatively stable altitudes +- about 6" over grass, pavement, and surprisingly a pool cover that is a woven mateial you can see light thru. It is fun to go over rolling terrain as it will follow it. It seems much more stable than the baro hold. I occasionally have had it decide my height is about 6", just land and go up again to reset height.
  • Developer

    @Andrew,

         the only last thing that I can suggest is that either you have your throttle slightly too high when you engage the altitude control or your quad needs more throttle changes than the altitude control PID is set-up to handle.  If you look in Navigation.pde you'll see these two lines around line 185:

    #define ALTITUDE_CONTROL_SONAR_OUTPUT_MIN 60
    #define ALTITUDE_CONTROL_SONAR_OUTPUT_MAX 80

    This controls the maximum amount that the PIDs will modify the throttle up or down from the point the throttle was at when you engaged the autopilot.  You could increase both numbers (maybe double them) to see if it helps.

     

    I actually don't think this will work because you've already said your barometer altitude hold works and it has similar (actually slightly smaller) ranges.

  • Thank you. I appreciate it. There are some more pictures of the frame in this earlier post: http://www.diydrones.com/profiles/blogs/an-all-aluminum-arducopter

    Since those earlier pics were taken I've changed the motors and props, added the magnetometer, mini camera, sonar, and landing gear. Unfortunately, I don't have any video yet. I'll need to get an assistant for that. :)

     

  • Robert, Great efforts in setting up such a wonderful quad frame, did you record some video ?
This reply was deleted.