Skip to content

Firmware Steering

Austin J. Morlan edited this page Nov 14, 2017 · 5 revisions

Steering

The steering firmware is responsible for reading values from the torque sensor, sending reports on its state, and receiving steering commands and fault reports from the control CAN. When the steering firmware receives a steering command message, it will then output the commanded high and low spoof signals onto its connection to the EPAS ECU, sending it torque requests. Receiving a fault report will cause the steering module to disable.

Faults

There are three possible fault states:

  • Sensor disconnect
    • The firmware will periodically check the sensors to ensure none of them read a value of zero (an indication that they have become disconnected).
    • If a sensor is detected to be disconnected, control will be disabled and a fault report will be published
  • Command timeout
    • The firmware will monitor the time between receiving commands and ensure there is a steady connection to a higher level application
    • If it is determined that commands are no longer being received, control will be disabled and a fault report will be published
  • Operator override
    • The firmware will monitor for a manual actuation of the steering wheel by a human operator in the event of an emergency override of OSCC control
    • If an operator override is detected, control will be disabled and a fault report will be published

All modules listen for the fault report message and disable themselves if learning of a fault in a different module.

Commands and Reports

  • Receives steering commands from the API
  • Receives fault reports from other modules
  • Sends steering reports with current state information
  • Sends fault reports on fault event

Steering Enable

ID: 0x54

Note: Steering reports should be checked after sending steering enable command to ensure that the module received the command and enabled properly.

Type Size (bytes) Description
uint8_t 2 OSCC Magic Number
Identifies CAN frame as coming from OSCC.
Byte 0 should be 0x05.
Byte 1 should be 0xCC.
uint8_t 6 Reserved

Steering Disable

ID: 0x55

Note: Steering reports should be checked after sending steering disable command to ensure that the module received the command and disabled properly.

Type Size (bytes) Description
uint8_t 2 OSCC Magic Number
Identifies CAN frame as coming from OSCC.
Byte 0 should be 0x05.
Byte 1 should be 0xCC.

Steering Command

ID: 0x64

Note: Limit the rate at which you send commands onto the CAN bus to prevent overloading the bus and the processors on the modules. A rate of around 20Hz should be sufficient.

Type Size (bytes) Description
uint8_t 2 OSCC Magic Number
Identifies CAN frame as coming from OSCC.
Byte 0 should be 0x05.
Byte 1 should be 0xCC.
uint16_t 2 Spoof Value Low
Value to be sent on the low spoof signal to the DAC.
Voltage converted to a 12-bit step value.
uint16_t 2 Spoof Value High
Value to be sent on the high spoof signal to the DAC.
Voltage converted to a 12-bit step value.
uint8_t 1 Reserved

Steering Report

ID: 0x65

Transmit Rate: 20ms

Type Size (bytes) Description
uint8_t 2 OSCC Magic Number
Identifies CAN frame as coming from OSCC.
Byte 0 should be 0x05.
Byte 1 should be 0xCC.
uint8_t 1 Enabled Status
Zero value means disabled (commands are ignored).
Non-zero value means enabled (commands are sent to vehicle).
uint8_t 1 Operator Override
Zero value means there has been no operator override.
Non-zero value means an operator has physically overridden the system.
uint8_t 1 DTCs
Bitfield of DTCs present in the module.
uint8_t 3 Reserved

Fault Report

ID: 0x99

Transmit Rate: once, on fault event

Type Size (bytes) Description
uint8_t 2 OSCC Magic Number
Identifies CAN frame as coming from OSCC.
Byte 0 should be 0x05.
Byte 1 should be 0xCC.
uint32_t 4 Fault Origin ID
Enum value equaling FAULT_ORIGIN_STEERING.
uint8_t 2 Reserved

DTCs

Bit Position DTC Description
0 Invalid Sensor Value
The firmware has detected that one of the sensors has become disconnected.

Build Instructions

Follow the README build instructions, then run:

make steering

To upload to the Arduino:

make steering-upload