Home        Store        Docs        Blog

Ardusub + Rpi + ext sensors. What is best HW connection

ardusub

(John Bailey) #1

I’m trying to design an AUV using a Pixhawk, Rpi, and external sensors. I’m a hardware guy and not so much a programmer. I want to make sure my hardware design is solid and make sure that programming the Rpi and Pixhawk is as straightforward as possible. First I’d like to clarify how to connect the Rpi to the Pixhawk. One method is to use Pixhawk telem #2 to the Rpi GPIO’s 14 & 15, the other method is to connect USB between Pixhawk and Rpi. Which method is better? Are they both supported in the Rpi image download? Next I need to connect some external sensors to the Rpi. I think I can use the Rpi USB port and 232/485 converters to connect my sensors. My basic understanding of the programming involved is to program the Rpi to take in the sensor data, parse the data and format Mavlink messages to send the data to the Pixhawk. Is this correct? I will be using an echo sounder for altitude and I see there is already a mavlink parameter for “rangefinder”, I don’t know if there is altitude hold code in the Pixhawk or not. I may also use other sensors in the future. As long as there is a hardware and software solution to getting data into the Pixhawk I can go forward with the hardware design. I will also need a method on deck to control the the AUV for deck testing. I guess using the ethernet port on the Rpi is the easiest solution. Is that correct?

Sorry for all the NOOB questions. I just want to get it right. I will be hiring a programmer to make all the software bits work.

Best, John


(Anthony White) #2

Hi John-

I’d recommend the USB connection for pi to pix as the most reliable, and requiring the least configuration.

You’re correct on connecting external sensors- USB with a serial adapter is easiest. However, you shouldn’t need the pix to be aware of the data, except maybe in the case of a range finder for depth hold. Writing python scripts on the pi to log the data or send it over ip is fairly easy. As for altimeter, I believe future versions of ardusub will support fusing this depth (pressure) sensor data for altitude hold.

Developing an auv is tricky! For deck connections, the Ethernet Port seems the easiest high bandwidth link to the system. Using a fathom-x and a slim tether would let you maintain this connection for initial testing, likely making development easier (and safer!)

-Tony


(John Bailey) #3

Hi Tony,

Thanks for the reply. I’ll go with the USB connection between Pixhawk and Rpi. I will be using the altimeter data to do altitude hold during transits. Like I said, I’ll be hiring a programmer.

Best, John


(Jacob) #4

I would not call one over the other better, they are both good. The Rpi image will expect the pixhawk on usb.

Yes that’s how it should be done. See the example at the bottom of this page. The pixhawk will switch to the altimeter for depth hold if it is giving valid readings. This is with the current stable release.

Yes.


(John Bailey) #5

Hi Jacob,

Thanks for your concise replies to my questions. I think I have what I need to complete by electrical diagram. I may have more questions about Ardusub programmable behaviors. ie. Can I cause an event upon reaching a programmed depth? Can I use an event to send a serial command to say, my power distribution/switchboard? I plan on a long decent ~6 hours. Yes, 6 hours to reach 11,000 meters. To save power, I will need to be in semi sleep mode and wake up upon reaching a certain depth or altitude then switch on motor controllers and lights etc.

Best, John


(Jacob) #6

I missed a link in my last post, updated.

It would be amazing to see ArduSub at 11km!!!

Yes, these behaviors can certainly be achieved with the pixhawk + companion computer system. It will be easiest to implement this in the companion computer similarly to the examples linked above. ArduSub doesn’t do these exact things on it’s own, but you can tell it what to do and get the information from the depth sensor from it. However, if power savings are a big concern, you may want to keep the companion computer off, and you can modify the ArduSub firmware that runs on the autopilot to perform these behaviors. That route will be a little bit more technical, but will be easy enough with our help :).


(Jacob) #7

Do you have hardware in mind for depth measurement at those depths?