Hi all,
Im currently trying to configure the Pixhawk 2.1 to read the current from 2 power pins. It appears to be the BATT2_CURR_PIN changes the current sensing ADC pin for both the power brick input and BATT_CURR_PIN doesn’t change anything.
The current configuration is set up using plane 3.8(Beta).
I have attached the current parameters sets, one detailing what we belive to be the correct config, one detailing what was done to make a single input read (working_batt_config.param (14.0 KB)) and one detailing what is belive to be the correct Pixhawk2 configuration ( correct_config.param (14.0 KB)
).
It was noticed that when you set the BATT2_CURR_PIN to the Pixhawk 2 pin, you get a completely random input to current (I think it is whatever is floating on that pin).
If it gets set to the Pixhawk 1 configuration it gets set correctly, however both of the inputs are identical.
When we swapped the pins over , power cant read at all, even in the correct pin configuration.
Any ideas?
Let’s leave BATT2 out of equation now, otherwise it gets harder to debug - but it is expected that you need to reboot when you change the type of a battery monitor.
Can you try BATT_CURR_PIN set to 14 with the second power input?
With BATT_CURR_PIN set to 3 and BATT2_CURR_PIN set to 14 BATTERY.current_battery and BATTERY2.current_battery both read an identical current value from power2 input.
With BATT_CURR_PIN set to 14 and BATT2_CURR_PIN set to 3 BATTERY.current_battery and BATTERY2.current_battery both read an identical current value current value from power1 input.
Voltages are both read correctly.
Seems that BATT2_CURR_PIN overrides the BATT_CUR_PIN or that BATT2_CURR_PIN reading is transmitted to on both the BATTERY2 and BATTERY mavlink messages.
Ive downloaded the logs and had a look and it appears to show the values as expected.
Interestingly whilst testing this we used a different version of mission planner and this was reporting the values back correctly, so I think it may be a problem with that rather than the code.
It doenst appear to work on version 1.3.48 but appears correct on 1.3.46.
(P.S sorry about the incomplete post, internet is being a bit dodgey today so I dont think it saved properly…)
Here you go, copy of both Tlogs and pixhawk logs
Batt 2 is a backup battery battery and so should draw no current, but there is obviously some noise on the ADC.
Batt 1 is the motor and so should have large current draw.