Servers by jDrones

How to use power module on Beaglebone Blue Rover?

bbbmini
hal
(Chris Gough) #1

I am putting together a differential steering rover (Dagu Wild Thumper) with a BeagleBone Blue controller. I would like to know how to wire up the analog inputs from a voltage/current sensor (BATT_VOLT_PIN and BATT_CURR_PIN).

I more or less followed mirkix’s document here https://github.com/mirkix/ardupilotblue and imfatant’s document here https://github.com/imfatant/test, and with this glibc kludge https://github.com/mirkix/BBBMINI/issues/45 I can locally built ardurover 3.5 and scp it to my bbb where systemd keeps it running. I’m happy with my network setup (no telemetry modem at this stage, wifi is sufficient), I didn’t have to do anything to get SBUS from a frysky LR9 rc on E4-pin4 to work (does not work on the DSM connector), and GPS worked out of the box too. I plan to integrate a pair of i2c sonars but they haven’t arrived yet.

The physical GIO pins I know about (broken out of the board) are called BLUE_GP0_PIN_3, BLUE_GP0_PIN_4, BLUE_GP0_PIN_5 and BLUE_GP0_PIN_6. I don’t recognise them in libraries/AP_HAL_Linux/GPIO_BBB.h, and I don’t understand how the HAL works. So I can’t follow from autopilot side of the HAL abstraction to the physical side.

How do I to assign BATT_VOLT_PIN or BAT_CURR_PIN (or BATT2_* if I had one, which may be a nice since I’m running a secondary battery for the electronics)?

Even better would be an explanation of how to see that for myself, i.e. how do I follow from hardware, through AP_HAL_Linux to the autopilot config?

(ppoirier) #2

Hello, the blue is reading voltage and current from the analog interface AN0 and AN1

You can see most of the code here

And the associated cpp file

(Chris Gough) #3

Thanks! I was never going to find that looking at GPIO code and scratching my head, I was looking in the wrong place :slight_smile: