Using other ultrasonic sensors with the APM.

384 views
Skip to first unread message

Umar Khan

unread,
Mar 12, 2015, 12:35:40 PM3/12/15
to drones-...@googlegroups.com
So I am curious to know how one would use another ultrasonic sensor (one that isnt directly compatible) with the APM. For example this one. I have managed to get it working with a standard arduino uno. How would I implement this in the APM codebase? Would finding and changing the code for the current ultrasonic sensors work? In theory it seems like it should as long as the output is the same, and the same functions are called after running through the customized sonar code. Any help would be appreciated. I have tried looking around to find someone who has done something like this, but have been unable to so far.

Thanks,

Uknj

Luis Vale Gonçalves

unread,
Mar 12, 2015, 2:50:49 PM3/12/15
to drones-...@googlegroups.com
Using these very cheap sensors would be beneficial for other purposes as short range collision avoidance.

Julien Dubois

unread,
Mar 12, 2015, 3:45:10 PM3/12/15
to drones-...@googlegroups.com
You have for your price, those cheap sensors will be too much disturbed on a copter.
And the driver to acquire the measure will not be optimal for this flight controller as you'll have to wait for the end of the PWM signal that means interrupt the current code for a measure reading. Or just sample at the higher rate you can (400Hz, which will give you bad distance resolution - around 40cm here).
In both cases, the results are very bad for a max range of 4m, that means 2-3m max...
You would need to sample much faster than max rate loop. or maybe a tird component like teensy to acquire and convert the measure into I2C for example... so it shoulb be pricelly worth if several sonar would be connected to the teensy then.

Maxbotix are good, lidar lite much better again.

Gary McCray

unread,
Mar 12, 2015, 6:54:59 PM3/12/15
to drones-...@googlegroups.com
Hi Umar,
For multicopter use at least, we have found ultrasonic sensors,(even the Maxbotic ones DIYDrones does support) to be way less than satisfactory due to acoustic, RF and EMF noise all interfering greatly with readings.
Mostly we are converting to Laser rangefinder based system like Lidar light or possibly to optical flow / visual odometry for future use.
The value of trying to incorporate even less capable Sonar sensors is nil for multicopters.
It might be useful for rovers where noise is less important and where shorter ranges can be tolerated (and we do support 2 Maxbotic sensors for obstacle avoidance).
But even there, going to cheaper less capable sensors does not seem to be in anyone's best interests as the Maxbotics ones are barely sufficient to be usable.
Best,
Gary

Randy Mackay

unread,
Mar 12, 2015, 10:37:55 PM3/12/15
to drones-...@googlegroups.com

Uknj,

 

     I agree with Gary that sonar doesn’t actually work very well on a multicopter.  Still, if you really want to try out other range finders there are two options:

·         In AC3.2.1 there’s a general purpose analog interface which is used for the analog sonar and also the sf02.  If the sonar has analog out it should be possible to find appropriate configuration settings in AC to make it work.

             http://copter.ardupilot.com/wiki/common-optional-hardware/common-rangefinder-landingpage/common-rangefinder-sf02/

·         In AC3.3, Tridge has written a similar general purpose PWM interface.  I haven’t tried it yet nor documented it but I think that may work for this small sonar you’re looking at.  The first release candidate for AC3.3 should go out in about a week.

 

-Randy

--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages