ECU Internal Routing
Overview
Some functions may be configured / linked within the ECU using internal data / channel routing.
For example, the EGT (Exhaust Gas Temperature) sensor may be connected to any input channel, be it a physical analog input or from a CAN message.
Other features are more fixed, such as AIT (Air Intake Temperature) which only allows selection from a list of analog inputs.
Routing Options
Route-able features will typically have a ‘Source’ option that allows the user to select the input channel. The raw value of the input channel is displayed by a corresponding ‘raw’ channel.
For example, the Oil Feed 1 feature has an Oil Feed 1 Source option that selects the input channel for varying the duty cycle. The MSB of the raw input value is displayed by the
Oil Feed 1 raw channel.
Source options often have a ‘Bigend’ option that specifies the upper/lower byte of the input channel, if it is 16bit. This is usually set to OFF. In some cases (e.g. Little Endian data coming via CAN bus) the bytes of the raw input channel may require swapping.
If the Bigend option is OFF then the MSB of the raw input value is displayed by the raw channel.
Routing via a User Table or User Map
ECUs will often provide some general purpose ‘User’ tables or maps that can be used for non-linear scaling from abitrary input data.
For example, the User 1 Duty table can be used to convert a raw input value to a ’tunable’ output value.
These tables and maps can be utilized by using intermediate routing steps.
flowchart LR CRX["CAN1 RX1 W1"]-->U1S["User1 Source"] U1S-->U1RAW(["User1 raw"]) U1RAW-->U1DT["User1 Duty Table"] U1DT-->U1D(["User1 Duty"]) U1D-->OF1S["Oil Feed 1 Source"]
Routing from CAN
Specific CAN messages may be received using the CAN Rx setup (from menu action
) or via CAN RX related options in the calibration.When the CAN port and CAN RX IDs are configured, the ECU will decompose the CAN message into 4x 16bit channels, e.g. for Message 1 on CAN port 1, the channels are:
CAN1 RX1 W1
CAN1 RX1 W2
CAN1 RX1 W3
CAN1 RX1 W4
CAN Routing Example (EGT)
If, for example, an external temperature sensor module is used that sends a CAN message to the ECU containing a reading for EGT, then this message could be assigned to a CAN RX message ‘box’ e.g. CAN1 RX1. If the EGT temperature was given in the first 2 bytes then CAN1 RX1 W1 would hold the EGT temperature value, in unscaled form.
To link up CAN1 RX1 W1 to the EGT feature, the
EGT Source would be set to
CAN1 RX1 W1.
If the received EGT signal is in Little Endian (Intel) format, then the EGT Source Bigend would be set to ON to swap the bytes.
The resulting raw value is displayed by the EGT raw channel and converted to voltage 0…5V for the full-scale input value. This is generally fine for A2D sources but in the case of data received by CAN, this is unlikely to be the correct interpretation. The
EGT Sensor table should arrange to convert from these pseudo-volts to valid temperature.
For this example, the temperature module reports temperatures as signed 16bit numbers with 0.1°C resolution per bit. This poses a problem since EGT raw is unsigned and there is no way to make the source be interpreted as a signed number directly.
The EGT Sensor table would need to convert the signed number to an unsigned one by having a discontinuity. Note that hexadecimal values can be directly entered into the table cells (including the axis for many tables, like
EGT Sensor).
This table shows the conversion from the EGT raw channel to a temperature in °C. Notice the discontinuity at 0x8000, which is the point where the signed number changes from full-scale positive to full-scale negative:
EGT raw (hex) | EGT raw (V) | Temperature °C |
---|---|---|
0x0000 | 0.0 | 0 |
0x7FFF | 2.49996 | 3276.7 |
0x8000 | 2.50004 | -3276.8 |
0xFFFF | 5.00 | -0.1 |
However, the EGT Sensor only supports positive output values, from 0 to 1275°C, depending on the value of the
Temp Scalar option. See User Scalars for more details on the purpose / effect of scaling factors like
Temp Scalar.
If there are 8 cells in the EGT Sensor table, the following values could be used, assuming that the
Temp Scalar option = 1 (or 0, in which case the scalar is ignored) and that GWv4 is configured to display temperatures in units of degrees:
EGT raw (hex) | EGT raw (V) | Temperature °C |
---|---|---|
0x0000 | 0.0 | 0 |
0x31CE | 0.97276 | 1275.0 (max) |
0x7FFF | 2.49996 | 1275.0 |
0x8000 | 2.50004 | 0 (min) |
0xFFFF | 5.00 | 0 |
0xFFFF | 5.00 | 0 |
0xFFFF | 5.00 | 0 |
0xFFFF | 5.00 | 0 |
Note
The axis breakpoints table values should be sorted in increasing order for the ECU to be able to interpolate correctly. In this example, not all the table sites are used; so the remainder of the table is filled with the same values as the last useful row to maintain ordering.
CAN Routing for Simulink® based ECUs
For ECUs that use a Simulink® model, CAN signals may be decoded from a DBC file. The messages are defined ahead of time as part of the firmware build process, the channels in the DBC file become available for use in the Simulink model as Simulink signals.