FOME-Tech / fome-fw

Free Open Motorsports ECU
https://www.fome.tech
Other
44 stars 22 forks source link

Add CAN outputs as a selection for ECU Functions #232

Open kjngineering opened 1 year ago

kjngineering commented 1 year ago

For users that use PDM's its common than instead of hard wiring an output from the ECU to the PDM to control the switching, the state is usually read over CAN. This reduces wiring and complexity.

Classic examples might be Master Relay, Fuel Pump Control or Fan.

Technically, it might be possible to achieve this with the verbose can already transmitted, or, via LUA - both of these methods are potentially complex to the end user and/or difficult to configure. In the case of Verbose, the structure can be difficult to mask or scale appropriately in the more simple PDM applications.

Proposal is for a standardised single can frame transmission that can be configured in TS that, for example consists of of 8 "outputs" each 1 byte long. This could be included in the verbose transmission, or separately.

When selecting an output (e.g. fuel pump, master relay etc) its possible to select the CAN channel as the destination e.g.

"Can Output 1" > b[0] of the CAN frame ... "Can Output 8" > b[7] of the CAN frame

when the output is off, the value is '0'. when the output is on the value is '1'.

This could be further expanded to be allowed in PWM outputs where the duty cycle is transmitted in 0.5%/bit units, for example, if you are using a PWM to speed control a fan etc.