Injector Sensor Hub Firmware Design Specification

Overview

Injector Sensor Hub firmware periodically reads analog sensors and reports analog data to CAN, analog sensors include pressure transducers and hall effect sensors.

Reference Documents

TODO add documentation for OX Hall and Fuel Hall sensors?

Initialization

  1. Setup to use external oscillator with 1xPLL

  2. Setup PPS(Peripheral Pin Select) for CAN

  3. Initialize ADC, setup to use FVR(Fixed Voltage Reference)

  4. Initialize CAN module with canlib

Runtime

Heart Beat

Red LED shall toggle every 500ms.

Health Check

Health check shall be performed every 500 ms. All health check erros are signaled through GENERAL_BOARD_STATUS CAN Message.

Errors signaled by health check

Name

Condition

5V_OVER_CURRENT

I 5V_out > 100 mA

12V_OVER_CURRENT

I 12V_out > 150 mA

Sensor Reading

Firmware shall read from the following sensors:

  • Oxidizer Pressure Transducer

  • Fuel Pressure Transducer

  • CC Pressure Transducer

  • Fuel Hall Sensor

  • Oxidizer Hall Sensor

ADC voltage reading from PTs shall be converted to pressure using formula described in Convert pressure transducer ADC pin voltage input to pressure section. Pressure output is to be send to CAN using SENSOR_ANALOG CAN message.

TODO add blurb about how Hall Sensor reading is handled.

TODO add 4-20mA pressure transducer current check.

Refer to CAN Message Sent by Firmware section below for period of transmission and sensor IDs or refer to analog_sensor_id enum definitions.

CAN Communication

CAN Message Sent by Firmware

CAN Message Sent by Firmware

Message Type

Description

Period

GENERAL_BOARD_STATUS

Report status_ok healthcheck

500 ms

SENSOR_ANALOG.PRESSURE_OX

Report Oxidizer Pressure Transducer pressure

50 ms

SENSOR_ANALOG.PRESSURE_FUEL

Report Fuel Pressure Transducer pressure

50 ms

SENSOR_ANALOG.PRESSURE_CC

Report CC Pressure Transducer pressure

50 ms

TODO fill

Report Fuel Hall Sensor reading

250 ms

TODO fill

Report Oxidizer Hall Sensor reading

250 ms

CAN Message Handled by Firmware

CAN Message Handled by Firmware

Message Type

Description

RESET_CMD

Reset board if targeted(check with check_board_need_reset function in canlib)

GENERAL_BOARD_STATUS board specific error field usage

GENERAL_BOARD_STATUS board_error_bitfield Bit definition

Bitfield Name

Description

Offset

PT_OUT_OF_RANGE

4-20 mA Pressure transducer signals less that 4mA or more than 20mA

0

Mathematics Model

TODO add ADC calculations including Vref and resolution for the sensors TODO anything else that sensors are doing that I’m not aware of

Describe common used math equations in the firmware, if the equation is more than one line, then a link to a Matlab model should be provided.

Convert pressure transducer ADC pin voltage input to pressure

TODO Insert formula here