Skip to content

Conversation

Georacer
Copy link
Contributor

@Georacer Georacer commented Nov 15, 2024

This PR as support for the VSPeak Modell flow meter, in the form of a Lua script.

Hardware

The manufacturer has sent me a sensor with developmental software, able to speak a plain binary packet that the script can easily receive and interpret.
It is unknown to me currently if this software is already in general production or only our partner who asked for it has the correct binary. FWIW The manufacturer does advertise compatibility with ArduPilot, thanks to this here script.
image

Implementation

I have used a scripting battery backend sensor to fill in only the battery current and potentially the current consumed.
I make the convention that "current" stands of liters of fuel per hour.

See the attached instructions.

Known issues

I have employed a hack in the parser to get out of a buggy situation.
Upon boot, the sensor reports 254,0,0,0,0,0,254: Start byte, zero data, checksum.
But if the data aligns wrong in the buffer, it gets the following content: 254, 254, 0, 0, 0, 0, 0, which is also a valid packet, but means that there's 15.xx lt/hr flow.

I couldn't find another solution for now but reject two consecutive 254 bytes.

In general I'd like to find a better, more generic way of parsing serial binary data of a fixed frame size.

@tridge
Copy link
Contributor

tridge commented Nov 20, 2024

I would have preferred this as a battery backend as we only have 1 EFI, so this driver can't be combined with a real EFI engine, which I suspect users will want to do

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit list needs cleaning up! Should just be a single commit - same name as this PR title.

Changest tested with Kyle

Updated script

Fixed documentation errors

Added VSPF_MODE

Fixed type casting

Added VSPF_PORT to choose serial port

Updated documentation

Fixed wrong handling of sensor mode

Some changes to hopefully get better data parsing

Fixed bugs
@Georacer Georacer force-pushed the pr/vspeak_fuel_meter branch from 52ffad3 to f166754 Compare September 26, 2025 20:22
@Georacer
Copy link
Contributor Author

Almost a year later, I've done some more testing on this, thanks to our partner.

I've tested myself via remote connection the following aspects:
-VSPF_ENABLE=1

  • VSPF_MODE=1: The remaining % battery gets reset.
  • VSPF_PORT=1: Was set to the 2rd serial.
  • VSPF_CFACT=1: No correction.
  • VSPF_BAT_IDX=3: Act as the 3rd battery.

I could see the reported current rise and fall as the fuel pump would go and stop. The remaining % would also decline.

@peterbarker the commits have been squashed.

@tridge I don't remember this being an EFI backend, but it is a battery backend now...

Actually the partner asked if this could be an EFI backend, while allegedly he was instantiating another EFI backend for a Swiwin turbine.
By looking at the code, am I correct in seeing that:

  • We don't support multiple EFI backends.
  • The Lua binding efi:get_backend(idx) is actually bogus: Only idx=0 will return the current backend.
  • The ecu_index we are populating in the logs and telemetry refers to what the DroneCAN and MAVLink EFI devices self-publish.

@Georacer
Copy link
Contributor Author

The description has also been updated.

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Oct 1, 2025
@peterbarker peterbarker merged commit 6f188f5 into ArduPilot:master Oct 1, 2025
127 of 130 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants