Skip to content

Commit

Permalink
M024 AMS, IMD meas and other CAN message definced - Andy (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
dngusaud authored Jun 12, 2024
1 parent 4f51283 commit b2f45f3
Showing 1 changed file with 45 additions and 7 deletions.
52 changes: 45 additions & 7 deletions fs-common-bitproto/can.bitproto
Original file line number Diff line number Diff line change
@@ -1,23 +1,61 @@
proto can

/* =============== AMS ================= */

/* Current ID: 0x101 */
message AMSReport {
/* Below are AIR Relay Feedback States */
bool AIR_POS = 6; /* AIR Positive Relay State. 1 is closed, 0 is open */
bool PRECHARGE = 7; /* Precharge Relay State. 1 is closed, 0 is open */
bool AIR_NEG = 8; /* AIR Negative Relay State. 1 is closed, 0 is open */

/* Below are AMS's GPIO state */
bool AMS_AUX_GPIO1 = 9; /* AMS's AUX GPIO 1 state, reserved for future purpose. */
bool AMS_AUX_GPIO2 = 10; /* AMS's AUX GPIO 1 state, reserved for future purpose. */
bool AMS_AUX_GPIO3 = 11; /* AMS's AUX GPIO 1 state, reserved for future purpose. */
bool AMS_AUX_GPIO4 = 12; /* AMS's AUX GPIO 1 state, reserved for future purpose. */
bool AMS_AUX_GPIO5 = 13; /* AMS's AUX GPIO 1 state, reserved for future purpose. */
bool AMS_AUX_GPIO6 = 14; /* AMS's AUX GPIO 1 state, reserved for future purpose. */
bool AMS_AUX_GPIO7 = 15; /* AMS's AUX GPIO 1 state, reserved for future purpose. */

/* Below is about AMS firmware version*/
int8 AMS_firmware_version = 17; /* Current AMS Firmware's version or equivalent info */

}

/* Current ID: 0x103 */
message AMSError {
message ACCReport {
/* Below are SHDN report from ACC*/
bool IMD = 1; /* Imd fault */
bool valid_cell_count = 2; /* If the number of cells found by BMS is equal to expected number of cells */
bool is_bms_alive = 3; /* If the bms is reporting / alive */
bool is_orion_stale = 3; /* If the orion gone stale */
bool is_over_temperature = 4; /* If the temperature of the cells is above the threshold */
bool is_warn_temperature = 5; /* If the temperature of the cells is over the warning the threshold */
bool is_over_voltage = 6; /* If the voltage of the cells is above the threshold */
bool is_under_voltage = 7; /* If the voltage of the cells is below the threshold */
bool is_ams_fault = 8; /* If the AMS caused an AMS SHDN, it is 1, when okay its 0*/
bool is_precharge_over_temp = 9; /* It reports AIR_CONTROL_ALI_STM_TMP_FAULT_LATCH's state set bit to be 1 if Fault otherwise 0, AIR_Control has SHDN circuit so do not need to tirgger AMS SHDN*/
bool is_bms_alive = 10; /* If the BMS is still alive */

/* Below are the IMD_STM_MEAS's frequency data, also refer to Bender IMD datasheet in section "Output Measurement" */
bool IMD_Normal = 11; /* IMD in normal state, will read 10Hz square wave */
bool IMD_UVLO = 12; /* IMD Under Voltage Lock Out, will read 20Hz square wave */
bool IMD_error = 13; /* 1 if IMD device reports error, this is device error not insulation fault, will read 40Hz square wave */
bool IMD_earth_connection_fault = 14; /* 1 if IMD detected earth conneciton fault, wil lread 50Hz square wave */
uint8 IMD_insulation_meas = 17; /* A 0 ~ 100 percentage value that represent the insulation quality measured from IMD. It is measured from IMD_STM_MEAS square_wave's duty cycle in normal_state, the 10Hz square wave */
}

/* Current ID: 0x101 */
message RelayState {
bool AIR_POS = 6; /* AIR Positive Relay State. 1 is closed, 0 is open */
bool PRECHARGE = 7; /* Precharge Relay State. 1 is closed, 0 is open */
bool AIR_NEG = 8; /* AIR Negative Relay State. 1 is closed, 0 is open */
/* Current ID: 0x105 */
message AMSError {
bool precharge_completed = 8; /* Only send this message with value of 1 at bit 7 once when precharge completed, so rising edge only. */
}

/* Current ID: 0x106 */
message AccNotReady{
bool acc_not_ready = 8; /* Send this message when the ACC is not ready to enter TS Active mode. */
}


/* =============== Go-Kart ================= */

// TODO below are the specific bit lengths needed on the CAN frame for each
Expand Down

0 comments on commit b2f45f3

Please sign in to comment.