How connect 4 sonar sensors to pixhawk?

670 views
Skip to first unread message

유한상

unread,
Jul 26, 2015, 11:27:11 AM7/26/15
to drones-discuss
We are about to add obstacle avoidance function of the drone to pixhawk  for our team project.
Pixhawk is composed of a adc 3.3v, 6.6v, i2c analog input connector.
We wonder how to connect four of sonar sensors to pixhawk and give the values of sensors to pixhawk, distinguishing each of values.
What if I connect Arduino to pixhawk and do four of  sonar sensors to Arduino?

Randy Mackay

unread,
Jul 27, 2015, 12:39:30 AM7/27/15
to drones-...@googlegroups.com

     One thing you’ll need to do is increase the maximum number of range finders to 4.

           https://github.com/diydrones/ardupilot/blob/master/libraries/AP_RangeFinder/RangeFinder.h#L26

 

     Also increase the list of parameters to support storing params for all four.  Hopefully you can figure this out by seeing how the parameters are added for the 2nd range finder here:

             https://github.com/diydrones/ardupilot/blob/master/libraries/AP_RangeFinder/RangeFinder.cpp#L110

 

     Next the challenge of actually connecting 4 sonar to the pixhawk.  If it were me I would probably try using the pwm inputs to the Pixhawk.  I’ve never tried this myself but it seems some of the AUX pins can be changed to be pwm-in by setting the BRD_PWM_COUNT to a lower number (like 2).

             http://copter.ardupilot.com/wiki/common-optional-hardware/common-rangefinder-landingpage/common-rangefinder-lidarlite/#connecting_to_pixhawk_via_pwm

             http://copter.ardupilot.com/wiki/common-autopilots/common-pixhawk-overview/

 

     Connecting the sonar to an Arduino first is ok but then you still need to get that info to the Pixhawk somehow which would likely mean writing a new AP_RangeFinder class.  That’s very possible but not sure how much you want to do that.

 

-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