im working on integrating a fuel flow sensor to PX4 on a multirotor. since the vehile is flown by a PX4 anyway, i would simply like to use the PX4 to read the data coming from my external sensor board, and send it via Mavlink telemetry to the ground.
my sensor is a hall type (pulse counter) but im using an external interface board which can either send Analog (to ADC) or UART TTL and even i2c.
Lets assume the fuel values are 0 - 50.0 Literes in a resolution of 0.1 L so 500 different values.
i can easily convert 0-50.0L in my controller via D2A on my board to analog value (0-3.3V) and send that to PX4 ADC connector input.
what shall i activate in Arducopter to read an external ADC and report it via telemetry with a certain factor (3.3V = 50.0 Liters) ?
or is there a better way to send configureable parameters to PX4? UART? I2C?
thanks for your help.
Arducopter supports pulse type fuel flow sensors (https://ardupilot.org/copter/docs/common-fuel-sensors.html), but only in the 4.0 release candidates, not the current stable.
For ardupilot support, best to use discuss.ardupilot.org
thats good news indeed. but i need to work on stable releases, therefore i wanted to use my external adapter board.
that adpter board can actually output PWM if need be as well.
what would be the easiest way to integrate with Ardupilot as an external sensor for telemetry purposes only?
PS - i do still have a battery and battery sensor connected in parallel, so i wouldnt like to hurt that capability.
Easiest (ie hackiest) is feed pwm into the sbus-out port, and set that port to pwm RSSI. It will read the pwm and log/forward/display as rssi. Copter 4.0 stable should be out in a few weeks. Using the driver in firmware gives you access to the relevant failsafes, which you miss out on by just monitoring and logging.
ok this is something i thought of as well, is the RSSI limited to certain values? 0-100%? 1100-2100us?
in my case i think for now i can settle for 0 - 15L in jumps of 0.1L, perhaps send PWM values of 0 to 1500us?
whats the range in us that RSSI expects to get?
i have now set:
BRD_SBUS_OUT = 0 (disabled)
RSSI_TYPE = 4 (PWM input pin)
BRD_PWM_COUNT = 6 (to releases 7-8)
conencted a servo tester (i.e PWM generator 1100us to 2100us) to pin 8 (SBUS out) and both rssi and Rxrssi show constant 0, any idea what am i doing wrong?
This needs to move to discuss.ardupilot.org