ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.48k stars 17.13k forks source link

Common: Advanced Engine Management [REQUEST] #11175

Open auturgy opened 5 years ago

auturgy commented 5 years ago

Feature request

Is your feature request related to a problem? Please describe. Basic ICE functionality is available within ArduPilot (http://ardupilot.org/plane/docs/common-ice.html) however the type of data currently available from ArduPilot and Mavlink is insufficient to appropriately manage advanced engines, and hybrid powerplants. Providing a framework to collect and send the relevant data will be a significant step towards more complete engine management within ArduPilot.

Describe the solution you'd like Advanced engine monitoring functionality (RPM, fuel level, cylinder temp, ect) and associated telemetry/mavlink messages

Some related requests: https://github.com/ArduPilot/ardupilot/issues/9567 https://github.com/ArduPilot/ardupilot/issues/1799 https://github.com/ArduPilot/ardupilot/issues/4200 https://github.com/ArduPilot/ardupilot/issues/3893 https://discuss.ardupilot.org/t/fuel-level-sensor-integration-approximately-330/38551/11 https://discuss.ardupilot.org/t/ic-engine-status/41438 https://discuss.ardupilot.org/t/needing-help-integrating-engine-management-telemetry-into-ardupilot-mavlink-and-the-gcs/41376 https://discuss.ardupilot.org/t/fuel-level-sensor-integration/749/3 https://discuss.ardupilot.org/t/fuel-level-sensor-integration-in-pixhawk/34175 https://github.com/ArduPilot/ardupilot/issues/521

Platform [ ] All [ ] AntennaTracker [ X ] Copter [ X ] Plane [ X ] Rover [ ] Submarine

Additional context Add any other context or screenshots about the feature request here.

RMIShane commented 5 years ago

Our engine / battery management system currently outputs a serial stream that looks like this...

RT:0 RPM:0 V:48.03 A:0.75 B:77 PWM:1000 CH:0 ESC:1100 CT:0 ER:0 CM:1 RT:0 RPM:0 V:48.03 A:0.75 B:77 PWM:1000 CH:0 ESC:1100 CT:0 ER:0 CM:1 RT:0 RPM:0 V:48.03 A:0.75 B:77 PWM:1000 CH:0 ESC:1100 CT:0 ER:0 CM:1

With the help of a friend I wrote this basic driver to receive and parse the serial using a sscanf function. https://github.com/RMIShane/ardupilot/commit/6bc7f367224cfac7afaaa93f909672d6763f2f7c

I then modified GCS_Mavlink.cpp, as well as some other things, to overwrite some existing fields with our values. (skipping logging and disabling some useful low battery fail safe functions)

I tried to deliver our voltage readings directly into the AP_BattMonitor_Analog.cpp but was unsuccessful.

The "driver" (ECU_Lite.cpp) also sends out a stream of Mavlink messaging while our hybrid system is charging. (mostly for the sake of debugging but this is really useful because it is easy to customize)

Writing a driver or modifying an existing one for your own application would be a reasonably easy task if there was a place for the parsed serial data to go, be logged, then forwarded through Mavlink to the GCS for monitoring.

It may also be okay to simply settle on an "IC Telemetry Protocol" that would receive data in a standard format although this option would be less flexible.

Seams like adding the back end logging and Mavlink messaging portion is the first step.

-Shane