From a37a6fb21b4a46033b8a3996904348db83d9393d Mon Sep 17 00:00:00 2001 From: perdo1305 Date: Fri, 28 Jun 2024 15:48:35 +0100 Subject: [PATCH 01/23] perdu commits --- CAN_asdb.h | 11 ++++++++++- CAN_pwtdb.h | 7 ++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CAN_asdb.h b/CAN_asdb.h index c9a0cca..33ea584 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -53,7 +53,16 @@ #define MAP_ENCODE_AS_MISSION(pnt, x)(pnt[0]=(pnt[0]&0x1F) | (x&0xE0) ) #define MAP_ENCODE_AS_EBS(pnt, x)(pnt[0]=(pnt[0]&0xE7) | (x&0x18) ) #define MAP_ENCODE_AS_STATE(pnt, x)(pnt[0]=(pnt[0]&0xF8)| (x&0x07) ) - + + #ifdef __LART_AXANATO_VCU_GATEWAY__ + #define CAN_TOJAL_TEST 0x500 + /**======================================================================**/ + #define MAP_DECODE_TOJAL_RPM(x) (x[0] << 8 | x[1]) + + #define CAN_TOJAL_SEND_RPM 0x510 + /**======================================================================**/ + #define MAP_ENCODE_TOJAL_RPM(pnt, x) (pnt[0] = (x >> 8), pnt[1] = x) + #endif //#endif #endif // CAN_ASDB_H diff --git a/CAN_pwtdb.h b/CAN_pwtdb.h index 39254bd..11689fc 100644 --- a/CAN_pwtdb.h +++ b/CAN_pwtdb.h @@ -66,7 +66,7 @@ #define MAP_DECODE_RPM_min_limit(x) (x[5] & 0x01) #define MAP_DECODE_RPM_max_limit(x) (x[5] & 0x02) #define MAP_DECODE_Power_limit(x) (x[5] & 0x04) -//wtf is in [6]??? +//wtf is in [6]??? R: is reserved in the controller bitch #define MAP_DECODE_CAN_map_version(x) (x[7]) /**======================================================================**/ @@ -82,12 +82,13 @@ /**======================================================================**/ #define CAN_HV500_SetERPM_ID 0x394 /**======================================================================**/ -#define MAP_ENCODE_CMD_ERPM(pnt, x) (pnt[2] = (x >> 16) & 0xFF, pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) +/*alterar todos para este formato*/ +#define MAP_ENCODE_CMD_ERPM(pnt, x) (pnt[0] = (x >> 24) & 0xFF, pnt[1] = (x >> 16) & 0xFF,pnt[2] = (x >> 8) & 0xFF,pnt[3] = (x) & 0xFF) /**======================================================================**/ #define CAN_HV500_SetPosition_ID 0x3b4 /**======================================================================**/ -//TODO: This might result in noise due to * 10 operation BEFORE the cutting shift +//TODO: This might result in noise due to * 10 operation BEFORE the cutting shift R:NO #define MAP_ENCODE_CMD_Position(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) /**======================================================================**/ From 0fb74440f165efe4f322c73571187b9dece6e6df Mon Sep 17 00:00:00 2001 From: perdo1305 Date: Fri, 28 Jun 2024 15:58:54 +0100 Subject: [PATCH 02/23] yes --- CAN_asdb.h | 1 + CAN_pwtdb.h | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CAN_asdb.h b/CAN_asdb.h index 33ea584..8fb912e 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -54,6 +54,7 @@ #define MAP_ENCODE_AS_EBS(pnt, x)(pnt[0]=(pnt[0]&0xE7) | (x&0x18) ) #define MAP_ENCODE_AS_STATE(pnt, x)(pnt[0]=(pnt[0]&0xF8)| (x&0x07) ) + #define __LART_AXANATO_VCU_GATEWAY__ /*TODO REMOVER ESTA MERDA*/ #ifdef __LART_AXANATO_VCU_GATEWAY__ #define CAN_TOJAL_TEST 0x500 /**======================================================================**/ diff --git a/CAN_pwtdb.h b/CAN_pwtdb.h index 11689fc..e63d8b4 100644 --- a/CAN_pwtdb.h +++ b/CAN_pwtdb.h @@ -14,6 +14,8 @@ * @brief T24 uses a little endian architecture when it comes to CAN messages **/ +/*HV500 is big endiano*/ + /**======================================================================**/ #define CAN_HV500_ERPM_DUTY_VOLTAGE_ID 0x14 /**======================================================================**/ @@ -66,61 +68,59 @@ #define MAP_DECODE_RPM_min_limit(x) (x[5] & 0x01) #define MAP_DECODE_RPM_max_limit(x) (x[5] & 0x02) #define MAP_DECODE_Power_limit(x) (x[5] & 0x04) -//wtf is in [6]??? R: is reserved in the controller bitch #define MAP_DECODE_CAN_map_version(x) (x[7]) /**======================================================================**/ #define CAN_HV500_SetAcCurrent_ID 0x354 /**======================================================================**/ -#define MAP_ENCODE_CMD_AcCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x * 10 & 0xFF) +#define MAP_ENCODE_CMD_AcCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = x * 10 & 0xFF) /**======================================================================**/ #define CAN_HV500_SetBrakeCurrent_ID 0x374 /**======================================================================**/ -#define MAP_ENCODE_CMD_BrakeCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x * 10 & 0xFF) +#define MAP_ENCODE_CMD_BrakeCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = x * 10 & 0xFF) /**======================================================================**/ #define CAN_HV500_SetERPM_ID 0x394 /**======================================================================**/ -/*alterar todos para este formato*/ #define MAP_ENCODE_CMD_ERPM(pnt, x) (pnt[0] = (x >> 24) & 0xFF, pnt[1] = (x >> 16) & 0xFF,pnt[2] = (x >> 8) & 0xFF,pnt[3] = (x) & 0xFF) /**======================================================================**/ #define CAN_HV500_SetPosition_ID 0x3b4 /**======================================================================**/ //TODO: This might result in noise due to * 10 operation BEFORE the cutting shift R:NO -#define MAP_ENCODE_CMD_Position(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_Position(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetRelCurrent_ID 0x3d4 /**======================================================================**/ -#define MAP_ENCODE_CMD_RelCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_RelCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetRelBrakeCurrent_ID 0x3F4 /**======================================================================**/ -#define MAP_ENCODE_CMD_RelBrakeCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_RelBrakeCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetMaxAcCurrent_ID 0x414 /**======================================================================**/ -#define MAP_ENCODE_CMD_MaxAcCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_MaxAcCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetMaxAcBrakeCurrent_ID 0x434 /**======================================================================**/ -#define MAP_ENCODE_CMD_MaxAcBrakeCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_MaxAcBrakeCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetMaxDcCurrent_ID 0x454 /**======================================================================**/ -#define MAP_ENCODE_CMD_MaxDcCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_MaxDcCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetMaxDcBrakeCurrent_ID 0x474 /**======================================================================**/ -#define MAP_ENCODE_CMD_MaxDcBrakeCurrent(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_MaxDcBrakeCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetDriveEnable_ID 0x494 From c0f32839e29eb659ee256cd59e1e90700d654150 Mon Sep 17 00:00:00 2001 From: bruno vicente Date: Fri, 28 Jun 2024 17:00:39 +0100 Subject: [PATCH 03/23] WIP on master ALC and MS added --- CAN_asdb.h | 8 ++++++++ CAN_datadb.h | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CAN_asdb.h b/CAN_asdb.h index 8fb912e..b95256a 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -4,6 +4,7 @@ * @details This file contains the mapping used to encode and decode CAN messages * @author João Vieira * @author Pedro Ferreira +* @author Bruno Vicente * @version 0.0.1 **/ #ifndef CAN_ASDB_H @@ -65,5 +66,12 @@ #define MAP_ENCODE_TOJAL_RPM(pnt, x) (pnt[0] = (x >> 8), pnt[1] = x) #endif + + + /**======================================================================**/ + #define ALC_MS 0x050 + /**======================================================================**/ + #define MAP_DECODE_AS_EMERGENCY_STATE(x) (x[0]) + #define MAP_DECODE_MS_STATE(x) (x[1]) //#endif #endif // CAN_ASDB_H diff --git a/CAN_datadb.h b/CAN_datadb.h index d270e95..6326830 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -23,7 +23,7 @@ #define MAP_DECODE_BRAKE_PRESSURE (x)(x[1]) #define MAP_DECODE_THROTTLE_POSITION (x)(x[0]) -#define MAP_DECODE_APPS (x) MAP_DECODE_THROTTLE_POSITION(x) +#define MAP_DECODE_APPS (x) MAP_DECODE_THROTTLE_POSITION(x) #define MAP_ENCODE_CONSUMED_POWER(pnt, x) (pnt[7] = (x >> 16) & 0xFF, pnt[6] = (x >> 8) & 0xFF, pnt[5] = x & 0xFF) #define MAP_ENCODE_TARGET_POWER(pnt, x) (pnt[4] = (x >> 16) & 0xFF, pnt[3] = (x >> 8) & 0xFF, pnt[2] = x & 0xFF) @@ -165,6 +165,8 @@ #define CAN_DYNAMICS_FRONT_ID_2 0xA1 // definir id /**======================================================================**/ + + // #endif #endif // CAN_DB_H \ No newline at end of file From 158e7b88bfb65af3abb320cd25e38cb9838e2038 Mon Sep 17 00:00:00 2001 From: Imeguras Date: Fri, 9 Aug 2024 17:33:58 +0100 Subject: [PATCH 04/23] Added Pneumatic pressure --- CAN_asdb.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/CAN_asdb.h b/CAN_asdb.h index b95256a..7f7b85e 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -1,5 +1,5 @@ /** -* @file CAN_asdb.h +1* @file CAN_asdb.h * @brief CAN database for autonomous driving header file * @details This file contains the mapping used to encode and decode CAN messages * @author João Vieira @@ -55,8 +55,19 @@ #define MAP_ENCODE_AS_EBS(pnt, x)(pnt[0]=(pnt[0]&0xE7) | (x&0x18) ) #define MAP_ENCODE_AS_STATE(pnt, x)(pnt[0]=(pnt[0]&0xF8)| (x&0x07) ) - #define __LART_AXANATO_VCU_GATEWAY__ /*TODO REMOVER ESTA MERDA*/ - #ifdef __LART_AXANATO_VCU_GATEWAY__ + #define CAN_AS_ACU_HEARTBEAT 0x703 + /**======================================================================**/ + #define MAP_DECODE_AS_ACU_HEARTBEAT(x) (x[0]) + #define MAP_ENCODE_AS_ACU_HEARTBEAT(pnt, x) (pnt[0] = x) + + #define CAN_AS_ACU_PNEU 0x183 + /**======================================================================**/ + #define MAP_DECODE_AS_ACU_PNEUMATIC_BRAKING_EBS_FRONT(x) (x[1] << 8 | x[0]) + #define MAP_DECODE_AS_ACU_PNEUMATIC_BRAKING_BRAKE_FRONT(x) (x[3] << 8 | x[2]) + #define MAP_DECODE_AS_ACU_PNEUMATIC_BRAKING_EBS_REAR(x) (x[5] << 8 | x[4]) + #define MAP_DECODE_AS_ACU_PNEUMATIC_BRAKING_BRAKE_REAR(x) (x[7] << 8 | x[6]) + + #ifdef __LART_AXANATO_VCU_GATEWAY__ #define CAN_TOJAL_TEST 0x500 /**======================================================================**/ #define MAP_DECODE_TOJAL_RPM(x) (x[0] << 8 | x[1]) From 51e5c560abcec9f5c1e308cb0b4472783869c00e Mon Sep 17 00:00:00 2001 From: Imeguras Date: Fri, 9 Aug 2024 17:57:27 +0100 Subject: [PATCH 05/23] Fixed CanOPEN_DB --- CANOPEN_db.h | 80 +++++++++++++++++++++++++++++++++++++++++++++++ CANOPEN_maxondb.h | 71 ----------------------------------------- CAN_asdb.h | 1 + 3 files changed, 81 insertions(+), 71 deletions(-) create mode 100644 CANOPEN_db.h delete mode 100644 CANOPEN_maxondb.h diff --git a/CANOPEN_db.h b/CANOPEN_db.h new file mode 100644 index 0000000..9ffe192 --- /dev/null +++ b/CANOPEN_db.h @@ -0,0 +1,80 @@ +/* + * CANOPEN_maxondb.h + * + * Created on: 26/06/2024 + * Author: micron + */ + +#ifndef CANOPEN_MAXONDB_H +#define CANOPEN_MAXONDB_H + +/**================== Node IDS ==========================**/ +#define NODE_ID_ACU 0x03 +#define NODE_ID_STEERING 0x05 +#define NODE_ID_BRAKE 0x06 //RESERVED DONT USE +#define NODE_ID_RES 0x11 // DO NOT CHANGE!! ENFORCED BY RULES!!! +/**======================================================================**/ + + +#define NMT_ADDRESS_COBID() (0x000) + +#define BOOTUP_ADDRESS_COBID(node_id) (node_id + 0x700) +//Maxon SDOs +#define SDO_REQUEST_ADDRESS_COBID(node_id) (node_id+0x600) +#define SDO_RESPONSE_ADDRESS_COBID(node_id) (node_id+0x580) + +/**======================================================================**/ + +/**================== Receive from World ==========================**/ +#define PDO_RXONE(node_id) (node_id+0x200) +/**======================================================================**/ +#define MAP_DECODE_PDO_RXONE_CONTROL_WORD(x) (x[1] << 8 | x[0]) +/**======================================================================**/ +#define PDO_RXTWO(node_id) (node_id+0x300) +/**======================================================================**/ +#define MAP_DECODE_PDO_RXTWO_MAXON_CONTROL_WORD(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_PDO_RXTWO_MAXON_MODES_OF_OPERATION(x) (x[2]) +/**======================================================================**/ +#define PDO_RXTHREE(node_id) (node_id+0x400) +/**======================================================================**/ +#define MAP_DECODE_PDO_RXTHREE_MAXON_CONTROL_WORD(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_PDO_RXTHREE_MAXON_TARGET_POSITION(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) +/**======================================================================**/ +#define PDO_RXFOUR(node_id) (node_id+0x500) +/**======================================================================**/ +#define MAP_DECODE_PDO_RXFOUR_MAXON_CONTROL_WORD(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_PDO_RXFOUR_MAXON_TARGET_SPEED(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) + +/**=================== Maxon Transmit to World ==========================**/ +#define PDO_TXONE(node_id) (node_id+0x180) +/**======================================================================**/ +#define MAP_DECODE_PDO_TXONE_MAXON_STATUSWORD(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_PDO_TXONE_MAXON_MODES_OF_OPERATION(x) (x[2]) +#define MAP_DECODE_PDO_TXONE_MAXON_ERROR_CODE(x) (x[4] << 8 | x[3]) + +/**======================================================================**/ +#define PDO_TXTWO(node_id) (node_id+0x280) +/**======================================================================**/ +#define MAP_DECODE_PDO_TXTWO_MAXON_TARGET_POSITION(x) (x[3] << 24 | x[2] << 16 | x[1] << 8 | x[0]) +#define MAP_DECODE_PDO_TXTWO_MAXON_TARGET_SPEED(x) (x[7] << 24 | x[6] << 16 | x[5] << 8 | x[4]) + +/**======================================================================**/ +#define PDO_TXTHREE(node_id) (node_id+0x380) +/**======================================================================**/ +#define MAP_DECODE_PDO_TXTHREE_MAXON_STATUSWORD(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_PDO_TXTHREE_MAXON_ACTUAL_POSITION(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) +#define MAP_DECODE_PDO_TXTHREE_MAXON_ACTUAL_MOMENT(x)(x[7] <<8 | x[6]) +/**======================================================================**/ +#define PDO_TXFOUR(node_id) (node_id+0x480) +/**======================================================================**/ +#define MAP_DECODE_PDO_TXFOUR_MAXON_STATUSWORD(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_PDO_TXFOUR_MAXON_ACTUAL_SPEED(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) +#define MAP_DECODE_PDO_TXFOUR_MAXON_ACTUAL_PWM_DUTY(x) (x[7] << 8 | x[6]) + + + + + + + +#endif /* CANOPEN_MAXONDB_H */ diff --git a/CANOPEN_maxondb.h b/CANOPEN_maxondb.h deleted file mode 100644 index fc4aea0..0000000 --- a/CANOPEN_maxondb.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * CANOPEN_maxondb.h - * - * Created on: 26/06/2024 - * Author: micron - */ - -#ifndef CANOPEN_MAXONDB_H -#define CANOPEN_MAXONDB_H - -#define NMT_ADDRESS_COBID() (0x000) - -#define BOOTUP_ADDRESS_COBID() (0x700+REMOTE_NODE_ID) -//Maxon SDOs -#define SDO_REQUEST_ADDRESS_COBID() (0x600+REMOTE_NODE_ID) -#define SDO_RESPONSE_ADDRESS_COBID() (0x580+REMOTE_NODE_ID) -/**======================================================================**/ - -/**================== Maxon Receive from World ==========================**/ -#define PDO_RXONE_MAXON() (0x200+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_RXONE_CONTROL_WORD(x) (x[1] << 8 | x[0]) -/**======================================================================**/ -#define PDO_RXTWO_MAXON() (0x300+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_RXONE_CONTROL_WORD(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_PDO_RXONE_MODES_OF_OPERATION(x) (x[2]) -/**======================================================================**/ -#define PDO_RXTHREE_MAXON() (0x400+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_RXTHREE_CONTROL_WORD(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_PDO_RXTHREE_TARGET_POSITION(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) -/**======================================================================**/ -#define PDO_RXFOUR_MAXON() (0x500+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_RXFOUR_CONTROL_WORD(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_PDO_RXFOUR_TARGET_SPEED(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) - -/**=================== Maxon Transmit to World ==========================**/ -#define PDO_TXONE_MAXON() (0x180+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_TXONE_STATUSWORD(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_PDO_TXONE_MODES_OF_OPERATION(x) (x[2]) -#define MAP_DECODE_PDO_TXONE_ERROR_CODE(x) (x[4] << 8 | x[3]) - -/**======================================================================**/ -#define PDO_TXTWO_MAXON() (0x280+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_TXTWO_TARGET_POSITION(x) (x[3] << 24 | x[2] << 16 | x[1] << 8 | x[0]) -#define MAP_DECODE_PDO_TXTWO_TARGET_SPEED(x) (x[7] << 24 | x[6] << 16 | x[5] << 8 | x[4]) - -/**======================================================================**/ -#define PDO_TXTHREE_MAXON() (0x380+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_TXTHREE_STATUSWORD(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_PDO_TXTHREE_ACTUAL_POSITION(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) -#define MAP_DECODE_PDO_TXTHREE_ACTUAL_MOMENT(x)(x[7] <<8 | x[6]) -/**======================================================================**/ -#define PDO_TXFOUR_MAXON() (0x480+REMOTE_NODE_ID) -/**======================================================================**/ -#define MAP_DECODE_PDO_TXFOUR_STATUSWORD(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_PDO_TXFOUR_ACTUAL_SPEED(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) -#define MAP_DECODE_PDO_TXFOUR_ACTUAL_PWM_DUTY(x) (x[7] << 8 | x[6]) - - - - - - - -#endif /* CANOPEN_MAXONDB_H */ diff --git a/CAN_asdb.h b/CAN_asdb.h index 7f7b85e..156e772 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -67,6 +67,7 @@ #define MAP_DECODE_AS_ACU_PNEUMATIC_BRAKING_EBS_REAR(x) (x[5] << 8 | x[4]) #define MAP_DECODE_AS_ACU_PNEUMATIC_BRAKING_BRAKE_REAR(x) (x[7] << 8 | x[6]) + #ifdef __LART_AXANATO_VCU_GATEWAY__ #define CAN_TOJAL_TEST 0x500 /**======================================================================**/ From 47bb6300650e4a2e74d4dd9334a7c530bd4ed825 Mon Sep 17 00:00:00 2001 From: Imeguras Date: Sat, 10 Aug 2024 18:44:51 +0100 Subject: [PATCH 06/23] More stuff --- CANOPEN_db.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CANOPEN_db.h b/CANOPEN_db.h index 9ffe192..eb6cb5f 100644 --- a/CANOPEN_db.h +++ b/CANOPEN_db.h @@ -23,6 +23,7 @@ #define SDO_REQUEST_ADDRESS_COBID(node_id) (node_id+0x600) #define SDO_RESPONSE_ADDRESS_COBID(node_id) (node_id+0x580) + /**======================================================================**/ /**================== Receive from World ==========================**/ @@ -45,13 +46,16 @@ #define MAP_DECODE_PDO_RXFOUR_MAXON_CONTROL_WORD(x) (x[1] << 8 | x[0]) #define MAP_DECODE_PDO_RXFOUR_MAXON_TARGET_SPEED(x) (x[5] << 24 | x[4] << 16 | x[3] << 8 | x[2]) -/**=================== Maxon Transmit to World ==========================**/ +/**=================== Transmit to World ==========================**/ #define PDO_TXONE(node_id) (node_id+0x180) /**======================================================================**/ #define MAP_DECODE_PDO_TXONE_MAXON_STATUSWORD(x) (x[1] << 8 | x[0]) #define MAP_DECODE_PDO_TXONE_MAXON_MODES_OF_OPERATION(x) (x[2]) #define MAP_DECODE_PDO_TXONE_MAXON_ERROR_CODE(x) (x[4] << 8 | x[3]) +#define MAP_DECODE_PDO_TXONE_RES_STATUS(x) (x[0]) + + /**======================================================================**/ #define PDO_TXTWO(node_id) (node_id+0x280) /**======================================================================**/ From 02157b5bb7c814e312a575620fecc8e2b0d956a3 Mon Sep 17 00:00:00 2001 From: Imeguras Date: Mon, 19 Aug 2024 11:38:31 +0100 Subject: [PATCH 07/23] Added Inter Control Unit Protocol DB --- CAN_icupdb.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CAN_icupdb.h diff --git a/CAN_icupdb.h b/CAN_icupdb.h new file mode 100644 index 0000000..14d6ef5 --- /dev/null +++ b/CAN_icupdb.h @@ -0,0 +1,26 @@ +/** + * @file CAN_icupdb.h + * @brief CAN database header file for the inter control unit line + * @details This file contains the mapping used to encode and decode CAN messages + * @note This is being developed as of right now + * @author João Vieira + * @version 0.0.1 + **/ +#ifndef CAN_ICUPDB_H +#define CAN_ICUPDB_H + +// #ifdef __LART_T24__ +/** + * @brief T24 uses a little endian architecture when it comes to CAN messages + **/ + + + +#define GENERIC_MSG_CONVERSION_ENCODE_DATABUS(x) (x | 0x04000000) +#define GENERIC_MSG_CONVERSION_DECODE_DATABUS(x) (x & 0x1BFFFFFF) +#define GENERIC_MSG_CONVERSION_ENCODE_POWERTRAIN(x) (x | 0x08000000) +#define GENERIC_MSG_CONVERSION_DECODE_POWERTRAIN(x) (x & 0x17FFFFFF) +#define GENERIC_MSG_CONVERSION_ENCODE_AUTONOMOUSBUS(x) (x | 0x0C000000) +#define GENERIC_MSG_CONVERSION_DECODE_AUTONOMOUSBUS(x) (x & 0x13FFFFFF) + +#endif // CAN_DB_H From c4e636f9aec8f909fa621ac73c09689aaad00144 Mon Sep 17 00:00:00 2001 From: Bruno Vicente <82599521+bruno3634-gif@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:00:24 +0100 Subject: [PATCH 08/23] Update CAN_datadb.h --- CAN_datadb.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CAN_datadb.h b/CAN_datadb.h index d270e95..62a0575 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -165,6 +165,12 @@ #define CAN_DYNAMICS_FRONT_ID_2 0xA1 // definir id /**======================================================================**/ + +/**======================================================================**/ +#define CAN_BRAKE_LIGHT 0x253 // definir id +/**======================================================================**/ + + // #endif -#endif // CAN_DB_H \ No newline at end of file +#endif // CAN_DB_H From ee3b03ffa24fbc8814a5783c6eca3a2bd8cda47c Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Wed, 21 Aug 2024 02:31:31 +0100 Subject: [PATCH 09/23] cenas bruno, fixed inverter adicionei soc,lvv, e corrigi o bitwise do inversor --- CAN_datadb.h | 4 ++++ CAN_pwtdb.h | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CAN_datadb.h b/CAN_datadb.h index 6326830..25ae8e4 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -38,9 +38,11 @@ #define MAP_DECODE_MOTOR_TEMPERATURE(x) ((x[3] << 8 | x[2]) + 40) #define MAP_DECODE_INVERTER_TEMPERATURE(x) ((x[1] << 8 | x[0]) + 40) +#define MAP_DECODE_SOC(x) (x[7]) #define MAP_ENCODE_MOTOR_TEMPERATURE(pnt, x) (pnt[3] = (x - 40) >> 8, pnt[2] = (x - 40) & 0xFF) #define MAP_ENCODE_INVERTER_TEMPERATURE(pnt, x) (pnt[1] = (x - 40) >> 8, pnt[0] = (x - 40) & 0xFF) +#define MAP_ENCODE_SOC(pnt, x) (pnt[7] = x) /**======================================================================**/ #define CAN_VCU_ID_3 0x022 @@ -49,11 +51,13 @@ #define MAP_DECODE_LMT2(x) (x[3]) #define MAP_DECODE_LMT1(x) (x[2]) #define MAP_DECODE_INVERTER_ERROR(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_LV_VOLTAGE(x) (x[7] << 8 | x[6]) #define MAP_ENCODE_VCU_STATE(pnt, x) (pnt[4] = x) #define MAP_ENCODE_LMT2(pnt, x) (pnt[3] = x) #define MAP_ENCODE_LMT1(pnt, x) (pnt[2] = x) #define MAP_ENCODE_INVERTER_ERROR(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) +#define MAP_ENCODE_LV_VOLTAGE(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) /**======================================================================**/ #define CAN_VCU_ID_4 0x023 diff --git a/CAN_pwtdb.h b/CAN_pwtdb.h index e63d8b4..973980c 100644 --- a/CAN_pwtdb.h +++ b/CAN_pwtdb.h @@ -20,28 +20,28 @@ #define CAN_HV500_ERPM_DUTY_VOLTAGE_ID 0x14 /**======================================================================**/ -#define MAP_DECODE_Actual_ERPM(x) (x[3] << 24 | x[2] << 16 | x[1] << 8 | x[0]) -#define MAP_DECODE_Actual_Duty(x) (x[5] << 8 | x[4]) -#define MAP_DECODE_Actual_InputVoltage(x) (x[7] << 8 | x[6]) +#define MAP_DECODE_Actual_ERPM(x) (x[0] << 24 | x[1] << 16 | x[2] << 8 | x[3]) +#define MAP_DECODE_Actual_Duty(x) (x[4] << 8 | x[5]) +#define MAP_DECODE_Actual_InputVoltage(x) (x[6] << 8 | x[7]) /**======================================================================**/ #define CAN_HV500_AC_DC_current_ID 0x34 /**======================================================================**/ -#define MAP_DECODE_Actual_ACCurrent(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_Actual_DCCurrent(x) (x[3] << 8 | x[2]) +#define MAP_DECODE_Actual_ACCurrent(x) (x[0] << 8 | x[1]) +#define MAP_DECODE_Actual_DCCurrent(x) (x[2] << 8 | x[3]) /**======================================================================**/ #define CAN_HV500_Temperatures_ID 0x54 /**======================================================================**/ -#define MAP_DECODE_Actual_TempController(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_Actual_TempMotor(x) (x[3] << 8 | x[2]) +#define MAP_DECODE_Actual_TempController(x) (x[0] << 8 | x[1]) +#define MAP_DECODE_Actual_TempMotor(x) (x[2] << 8 | x[3]) #define MAP_DECODE_Actual_FaultCode(x) (x[4]) /**======================================================================**/ #define CAN_HV500_FOC_ID 0x74 /**======================================================================**/ -#define MAP_DECODE_Actual_FOC_id(x) (x[3] << 24 | x[2] << 16 | x[1] << 8 | x[0]) -#define MAP_DECODE_Actual_FOC_iq(x) (x[7] << 24 | x[6] << 16 | x[5] << 8 | x[4]) +#define MAP_DECODE_Actual_FOC_id(x) (x[0] << 24 | x[1] << 16 | x[2] << 8 | x[3]) +#define MAP_DECODE_Actual_FOC_iq(x) (x[4] << 24 | x[5] << 16 | x[6] << 8 | x[7]) /**======================================================================**/ #define CAN_HV500_MISC_ID 0x94 @@ -95,7 +95,7 @@ #define CAN_HV500_SetRelCurrent_ID 0x3d4 /**======================================================================**/ -#define MAP_ENCODE_CMD_RelCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x * 10) & 0xFF)) +#define MAP_ENCODE_CMD_RelCurrent(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = ((x) & 0xFF)) /**======================================================================**/ #define CAN_HV500_SetRelBrakeCurrent_ID 0x3F4 From ec4b4da1a43d763ace34245cd9edd0ae3b506b2c Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Wed, 21 Aug 2024 02:59:04 +0100 Subject: [PATCH 10/23] added datalogger --- CAN_datadb.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CAN_datadb.h b/CAN_datadb.h index 43e09e6..242ebcc 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -169,6 +169,15 @@ #define CAN_DYNAMICS_FRONT_ID_2 0xA1 // definir id /**======================================================================**/ +/**======================================================================**/ +#define CAN_DATA_LOGGER_ID 0x180 + +#define MAP_DECODE_DATA_LOGGER_STATE(x) (x[0]) +#define MAP_DECODE_DATA_LOGGER_RECORD_STATE(x) (x[1]) + +#define MAP_ENCODE_DATA_LOGGER_STATE(pnt, x) (pnt[0] = x) +#define MAP_ENCODE_DATA_LOGGER_RECORD_STATE(pnt, x) (pnt[1] = x) + /**======================================================================**/ #define CAN_BRAKE_LIGHT 0x253 // definir id From 68cb28a45d34c6deff40a36a3b6cbf56fd9d5464 Mon Sep 17 00:00:00 2001 From: bruno vicente Date: Thu, 22 Aug 2024 12:32:45 +0100 Subject: [PATCH 11/23] Steering wheel id added --- CAN_datadb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CAN_datadb.h b/CAN_datadb.h index 242ebcc..cefd51e 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -184,6 +184,14 @@ /**======================================================================**/ +/**======================================================================**/ +#define CAN_STEERING_WHEEL 0x254 // definir id +/**======================================================================**/ + +#define MAP_DECODE_VCU_POWER_LIMIT(x) (x[0]) + +#define MAP_ENCODE_VCU_POWER_LIMIT(pnt, x) (pnt[0] = x) + // #endif #endif // CAN_DB_H From 3b4f38e5f6729a5dc2fd0747256efb1baca32e69 Mon Sep 17 00:00:00 2001 From: bruno vicente Date: Fri, 23 Aug 2024 18:53:46 +0100 Subject: [PATCH 12/23] perdu push --- CAN_datadb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAN_datadb.h b/CAN_datadb.h index cefd51e..2582ab9 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -51,13 +51,13 @@ #define MAP_DECODE_LMT2(x) (x[3]) #define MAP_DECODE_LMT1(x) (x[2]) #define MAP_DECODE_INVERTER_ERROR(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_LV_VOLTAGE(x) (x[7] << 8 | x[6]) +#define MAP_ENCODE_LV_SOC(x) (x[7] << 8 | x[6]) #define MAP_ENCODE_VCU_STATE(pnt, x) (pnt[4] = x) #define MAP_ENCODE_LMT2(pnt, x) (pnt[3] = x) #define MAP_ENCODE_LMT1(pnt, x) (pnt[2] = x) #define MAP_ENCODE_INVERTER_ERROR(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) -#define MAP_ENCODE_LV_VOLTAGE(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) +#define MAP_ENCODE_LV_SOC(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) /**======================================================================**/ #define CAN_VCU_ID_4 0x023 From 60c9b64e99e5650ca0f90b7a20236bfe490b6896 Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Fri, 23 Aug 2024 19:03:43 +0100 Subject: [PATCH 13/23] added lv soc and lv voltage --- CAN_datadb.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/CAN_datadb.h b/CAN_datadb.h index 2582ab9..80ee723 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -38,11 +38,11 @@ #define MAP_DECODE_MOTOR_TEMPERATURE(x) ((x[3] << 8 | x[2]) + 40) #define MAP_DECODE_INVERTER_TEMPERATURE(x) ((x[1] << 8 | x[0]) + 40) -#define MAP_DECODE_SOC(x) (x[7]) +#define MAP_DECODE_HV_SOC(x) (x[7]) #define MAP_ENCODE_MOTOR_TEMPERATURE(pnt, x) (pnt[3] = (x - 40) >> 8, pnt[2] = (x - 40) & 0xFF) #define MAP_ENCODE_INVERTER_TEMPERATURE(pnt, x) (pnt[1] = (x - 40) >> 8, pnt[0] = (x - 40) & 0xFF) -#define MAP_ENCODE_SOC(pnt, x) (pnt[7] = x) +#define MAP_ENCODE_HV_SOC(pnt, x) (pnt[7] = x) /**======================================================================**/ #define CAN_VCU_ID_3 0x022 @@ -51,13 +51,11 @@ #define MAP_DECODE_LMT2(x) (x[3]) #define MAP_DECODE_LMT1(x) (x[2]) #define MAP_DECODE_INVERTER_ERROR(x) (x[1] << 8 | x[0]) -#define MAP_ENCODE_LV_SOC(x) (x[7] << 8 | x[6]) #define MAP_ENCODE_VCU_STATE(pnt, x) (pnt[4] = x) #define MAP_ENCODE_LMT2(pnt, x) (pnt[3] = x) #define MAP_ENCODE_LMT1(pnt, x) (pnt[2] = x) #define MAP_ENCODE_INVERTER_ERROR(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) -#define MAP_ENCODE_LV_SOC(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) /**======================================================================**/ #define CAN_VCU_ID_4 0x023 @@ -69,6 +67,22 @@ #define MAP_ENCODE_RPM(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[2] = x & 0xFF) #define MAP_ENCODE_INVERTER_VOLTAGE(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) +/**======================================================================**/ +#define CAN_VCU_ID_5 0x024 + +#define MAP_DECODE_TCU_STATE(x) (x[0]) +#define MAP_DECODE_ACU_STATE(x) (x[1]) +#define MAP_DECODE_ALC_STATE(x) (x[2]) +#define MAP_DECODE_LV_SOC(x) (x[3] << 8 | x[4]) +#define MAP_DECODE_LV_VOLTAGE(x) (x[5] << 8 | x[6]) + +#define MAP_ENCODE_TCU_STATE(pnt, x) (pnt[0] = x) +#define MAP_ENCODE_ACU_STATE(pnt, x) (pnt[1] = x) +#define MAP_ENCODE_ALC_STATE(pnt, x) (pnt[2] = x) +#define MAP_ENCODE_LV_SOC(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) +#define MAP_ENCODE_LV_VOLTAGE(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) + + /**======================================================================**/ #define CAN_PDM_ID_1 0x40 /**======================================================================**/ From 6eb1542be5941ec08b84745ff1ce30c0ca112dff Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Fri, 23 Aug 2024 19:21:24 +0100 Subject: [PATCH 14/23] add factor to lv soc --- CAN_datadb.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CAN_datadb.h b/CAN_datadb.h index 80ee723..06804d9 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -73,16 +73,15 @@ #define MAP_DECODE_TCU_STATE(x) (x[0]) #define MAP_DECODE_ACU_STATE(x) (x[1]) #define MAP_DECODE_ALC_STATE(x) (x[2]) -#define MAP_DECODE_LV_SOC(x) (x[3] << 8 | x[4]) +#define MAP_DECODE_LV_SOC(x) ((x[3] << 8 | x[4]) /10) #define MAP_DECODE_LV_VOLTAGE(x) (x[5] << 8 | x[6]) #define MAP_ENCODE_TCU_STATE(pnt, x) (pnt[0] = x) #define MAP_ENCODE_ACU_STATE(pnt, x) (pnt[1] = x) #define MAP_ENCODE_ALC_STATE(pnt, x) (pnt[2] = x) -#define MAP_ENCODE_LV_SOC(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) +#define MAP_ENCODE_LV_SOC(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) // 0-1000 #define MAP_ENCODE_LV_VOLTAGE(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) - /**======================================================================**/ #define CAN_PDM_ID_1 0x40 /**======================================================================**/ From 9ecc17455c6a37bdb71d7547236d3ae31cb0179a Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Fri, 23 Aug 2024 19:31:19 +0100 Subject: [PATCH 15/23] delete pdm --- CAN_asdb.h | 1 + CAN_datadb.h | 50 -------------------------------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/CAN_asdb.h b/CAN_asdb.h index 156e772..1d9de8a 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -9,6 +9,7 @@ **/ #ifndef CAN_ASDB_H #define CAN_ASDB_H +#define __LART_AXANATO_VCU_GATEWAY__ //#ifdef __LART_T24__ /** * @brief T24 uses a little endian architecture when it comes to CAN messages diff --git a/CAN_datadb.h b/CAN_datadb.h index 06804d9..39f39b4 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -82,56 +82,6 @@ #define MAP_ENCODE_LV_SOC(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) // 0-1000 #define MAP_ENCODE_LV_VOLTAGE(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) -/**======================================================================**/ -#define CAN_PDM_ID_1 0x40 -/**======================================================================**/ - -#define MAP_DECODE_TOTAL_POWER(x) (x[7] << 8 | x[6]) -#define MAP_DECODE_LV_VOLTAGE(x) (x[4] << 8 | x[3]) -#define MAP_DECODE_INPUTS1(x) (x[2]) -#define MAP_DECODE_OUTPUTS1(x) (x[1]) - -#define MAP_ENCODE_DYNAMICS_FRONT_POWER(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) -#define MAP_ENCODE_DYNAMICS_REAR_POWER(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) -#define MAP_ENCODE_EXTRA_POWER(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[2] = x & 0xFF) -#define MAP_ENCODE_PDM_HEARTBEAT(pnt, x) (pnt[1] = x) - -/**======================================================================**/ -#define CAN_PDM_ID_2 0x41 -/**======================================================================**/ - -#define MAP_DECODE_TCU_POWER(x) ((x[7] << 8 | x[6]) / 10) -#define MAP_DECODE_VCU_POWER(x) ((x[5] << 8 | x[4]) / 10) -#define MAP_DECODE_ACU_POWER(x) ((x[3] << 8 | x[2]) / 10) -#define MAP_DECODE_DATALOGGER_POWER(x) ((x[1] << 8 | x[0]) / 10) - -#define MAP_ENCODE_TCU_POWER(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) -#define MAP_ENCODE_VCU_POWER(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) -#define MAP_ENCODE_ACU_POWER(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[2] = x & 0xFF) -#define MAP_ENCODE_DATALOGGER_POWER(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) - -/**======================================================================**/ -#define CAN_PDM_ID_3 0x42 -/**======================================================================**/ - -#define MAP_DECODE_DYNAMICS_FRONT_POWER(x) (x[7] << 8 | x[6]) -#define MAP_DECODE_DYNAMICS_REAR_POWER(x) (x[5] << 8 | x[4]) -#define MAP_DECODE_EXTRA_POWER(x) (x[3] << 8 | x[2]) - -#define MAP_ENCODE_TOTAL_POWER(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) -#define MAP_ENCODE_LV_VOLTAGE(pnt, x) (pnt[4] = (x >> 8) & 0xFF, pnt[3] = x & 0xFF) -#define MAP_ENCODE_INPUTS1(pnt, x) (pnt[2] = x) - -/**======================================================================**/ -#define CAN_PDM_ID_4 0x43 -/**======================================================================**/ - -#define MAP_DECODE_PDM_HEARTBEAT(x) (x[1]) -#define MAP_DECODE_SDC_STATE(x) (x[0]) - -#define MAP_ENCODE_PDM_HEARTBEAT(pnt, x) (pnt[1] = x) -#define MAP_ENCODE_SDC_STATE(pnt, x) (pnt[0] = x) - /**======================================================================**/ #define CAN_IMU_ID_1 0x60 /**======================================================================**/ From 0cba6d83643c44fa771296324c32eb96fbd167cd Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Fri, 23 Aug 2024 19:37:30 +0100 Subject: [PATCH 16/23] added r2d & ign --- CAN_datadb.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CAN_datadb.h b/CAN_datadb.h index 39f39b4..4f66af7 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -52,6 +52,7 @@ #define MAP_DECODE_LMT1(x) (x[2]) #define MAP_DECODE_INVERTER_ERROR(x) (x[1] << 8 | x[0]) + #define MAP_ENCODE_VCU_STATE(pnt, x) (pnt[4] = x) #define MAP_ENCODE_LMT2(pnt, x) (pnt[3] = x) #define MAP_ENCODE_LMT1(pnt, x) (pnt[2] = x) @@ -63,9 +64,13 @@ #define MAP_DECODE_RPM(x) (x[3] << 8 | x[2]) #define MAP_DECODE_INVERTER_VOLTAGE(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_IGNITION_STATE(x) (x[4]) +#define MAP_DECODE_Ready2Drive_STATE(x) (x[5]) #define MAP_ENCODE_RPM(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[2] = x & 0xFF) #define MAP_ENCODE_INVERTER_VOLTAGE(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) +#define MAP_ENCODE_IGNITION_STATE(pnt, x) (pnt[4] = x) +#define MAP_ENCODE_Ready2Drive_STATE(pnt, x) (pnt[5] = x) /**======================================================================**/ #define CAN_VCU_ID_5 0x024 From 07018cbab6fd64de68dba91cd368dbe8f900c1cb Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Sat, 24 Aug 2024 13:32:54 +0100 Subject: [PATCH 17/23] power plan --- CAN_datadb.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CAN_datadb.h b/CAN_datadb.h index 4f66af7..60bbd41 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -51,12 +51,16 @@ #define MAP_DECODE_LMT2(x) (x[3]) #define MAP_DECODE_LMT1(x) (x[2]) #define MAP_DECODE_INVERTER_ERROR(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_APPS_ERROS(x) (x[5]) +#define MAP_DECODE_POWER_PLAN(x) (x[6]) #define MAP_ENCODE_VCU_STATE(pnt, x) (pnt[4] = x) #define MAP_ENCODE_LMT2(pnt, x) (pnt[3] = x) #define MAP_ENCODE_LMT1(pnt, x) (pnt[2] = x) #define MAP_ENCODE_INVERTER_ERROR(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) +#define MAP_ENCODE_APPS_ERROS(pnt, x) (pnt[5] = x) +#define MAP_ENCODE_POWER_PLAN(pnt, x) (pnt[6] = x) /**======================================================================**/ #define CAN_VCU_ID_4 0x023 From d1052c30620ca06bf510a7cf1d2a5516414ea0da Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Sun, 25 Aug 2024 18:03:40 +0100 Subject: [PATCH 18/23] fix typo --- CAN_datadb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAN_datadb.h b/CAN_datadb.h index 60bbd41..6fcb27a 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -51,7 +51,7 @@ #define MAP_DECODE_LMT2(x) (x[3]) #define MAP_DECODE_LMT1(x) (x[2]) #define MAP_DECODE_INVERTER_ERROR(x) (x[1] << 8 | x[0]) -#define MAP_DECODE_APPS_ERROS(x) (x[5]) +#define MAP_DECODE_APPS_ERROR(x) (x[5]) #define MAP_DECODE_POWER_PLAN(x) (x[6]) @@ -59,7 +59,7 @@ #define MAP_ENCODE_LMT2(pnt, x) (pnt[3] = x) #define MAP_ENCODE_LMT1(pnt, x) (pnt[2] = x) #define MAP_ENCODE_INVERTER_ERROR(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) -#define MAP_ENCODE_APPS_ERROS(pnt, x) (pnt[5] = x) +#define MAP_ENCODE_APPS_ERROR(pnt, x) (pnt[5] = x) #define MAP_ENCODE_POWER_PLAN(pnt, x) (pnt[6] = x) /**======================================================================**/ From bdb6fc4c012fb3ae7b4637c165940730388d3118 Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Sun, 25 Aug 2024 19:10:15 +0100 Subject: [PATCH 19/23] added TCU, and fix some inconsistences --- CAN_datadb.h | 12 ++++++------ CAN_pwtdb.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/CAN_datadb.h b/CAN_datadb.h index 6fcb27a..ed04a23 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -79,15 +79,15 @@ /**======================================================================**/ #define CAN_VCU_ID_5 0x024 -#define MAP_DECODE_TCU_STATE(x) (x[0]) -#define MAP_DECODE_ACU_STATE(x) (x[1]) -#define MAP_DECODE_ALC_STATE(x) (x[2]) +#define MAP_DECODE_VCU_TCU_STATE(x) (x[0]) +#define MAP_DECODE_VCU_ACU_STATE(x) (x[1]) +#define MAP_DECODE_VCU_ALC_STATE(x) (x[2]) #define MAP_DECODE_LV_SOC(x) ((x[3] << 8 | x[4]) /10) #define MAP_DECODE_LV_VOLTAGE(x) (x[5] << 8 | x[6]) -#define MAP_ENCODE_TCU_STATE(pnt, x) (pnt[0] = x) -#define MAP_ENCODE_ACU_STATE(pnt, x) (pnt[1] = x) -#define MAP_ENCODE_ALC_STATE(pnt, x) (pnt[2] = x) +#define MAP_ENCODE_VCU_TCU_STATE(pnt, x) (pnt[0] = x) +#define MAP_ENCODE_VCU_ACU_STATE(pnt, x) (pnt[1] = x) +#define MAP_ENCODE_VCU_ALC_STATE(pnt, x) (pnt[2] = x) #define MAP_ENCODE_LV_SOC(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) // 0-1000 #define MAP_ENCODE_LV_VOLTAGE(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) diff --git a/CAN_pwtdb.h b/CAN_pwtdb.h index 973980c..52d39e5 100644 --- a/CAN_pwtdb.h +++ b/CAN_pwtdb.h @@ -127,6 +127,59 @@ /**======================================================================**/ #define MAP_ENCODE_CMD_DriveEnable(pnt, x) (pnt[0] = x) +/**======================================================================**/ +#define CAN_TCU_ID_1 0x60 + +#define MAP_DECODE_BAT_FANS_TOP(x) (x[0]) +#define MAP_DECODE_BAT_FANS_BOT(x) (x[1]) +#define MAP_DECODE_RAD_FANS_LEFT(x) (x[2]) +#define MAP_DECODE_RAD_FANS_RIGHT(x) (x[3]) +#define MAP_DECODE_PUMP(x) (x[4]) +#define MAP_LIQUID_TEMP_1(x) (x[5]) +#define MAP_LIQUID_TEMP_2(x) (x[6]) +#define MAP_LIQUID_TEMP_3(x) (x[7]) + +#define MAP_ENCODE_BAT_FANS_TOP(pnt, x) (pnt[0] = x) +#define MAP_ENCODE_BAT_FANS_BOT(pnt, x) (pnt[1] = x) +#define MAP_ENCODE_RAD_FANS_LEFT(pnt, x) (pnt[2] = x) +#define MAP_ENCODE_RAD_FANS_RIGHT(pnt, x) (pnt[3] = x) +#define MAP_ENCODE_PUMP(pnt, x) (pnt[4] = x) +#define MAP_ENCODE_LIQUID_TEMP_1(pnt, x) (pnt[5] = x) +#define MAP_ENCODE_LIQUID_TEMP_2(pnt, x) (pnt[6] = x) +#define MAP_ENCODE_LIQUID_TEMP_3(pnt, x) (pnt[7] = x) + +/**======================================================================**/ + +#define CAN_TCU_ID_2 0x61 + +#define MAP_DECODE_TCU_CONTACTORS_STATE(x) (x[0]) +#define MAP_DECODE_TCU_CONTACTORS_ERROR(x) (x[1]) +#define MAP_DECODE_AUTONOMOUS_IGNITION(x) (x[2]) +#define MAP_DECODE_PRECHARGE_DONE(x) (x[3]) +#define MAP_DECODE_SDC_STATE(x) (x[4]) +#define MAP_DECODE_TCU_STATE(x) (x[5]) + + +#define MAP_ENCODE_TCU_CONTACTORS_STATE(pnt, x) (pnt[0] = x) +#define MAP_ENCODE_TCU_CONTACTORS_ERROR(pnt, x) (pnt[1] = x) +#define MAP_ENCODE_AUTONOMOUS_IGNITION(pnt, x) (pnt[2] = x) +#define MAP_ENCODE_PRECHARGE_DONE(pnt, x) (pnt[3] = x) +#define MAP_ENCODE_SDC_STATE(pnt, x) (pnt[4] = x) +#define MAP_ENCODE_TCU_STATE(pnt, x) (pnt[5] = x) + + +/**======================================================================**/ + +#define CAN_PWT_VCU_ID_1 0x23 + +#define MAP_DECODE_PWT_R2D_STATE(x) (x[4]) +#define MAP_DECODE_PWT_IGNITION_STATE(x) (x[5]) + +#define MAP_ENCODE_PWT_R2D_STATE(pnt, x) (pnt[4] = x) +#define MAP_ENCODE_PWT_IGNITION_STATE(pnt, x) (pnt[5] = x) + + + // #endif #endif // CAN_PWTDB_H \ No newline at end of file From 66bda91c6e6952bdc7b738ef363ee7300b49e906 Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Mon, 26 Aug 2024 10:27:04 +0100 Subject: [PATCH 20/23] update bms ids and msgs --- CAN_datadb.h | 2 ++ CAN_pwtdb.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/CAN_datadb.h b/CAN_datadb.h index ed04a23..b2cedd3 100644 --- a/CAN_datadb.h +++ b/CAN_datadb.h @@ -38,10 +38,12 @@ #define MAP_DECODE_MOTOR_TEMPERATURE(x) ((x[3] << 8 | x[2]) + 40) #define MAP_DECODE_INVERTER_TEMPERATURE(x) ((x[1] << 8 | x[0]) + 40) +#define MAP_DECODE_HV_VOLTAGE(x) (x[6] << 8 | x[5]) #define MAP_DECODE_HV_SOC(x) (x[7]) #define MAP_ENCODE_MOTOR_TEMPERATURE(pnt, x) (pnt[3] = (x - 40) >> 8, pnt[2] = (x - 40) & 0xFF) #define MAP_ENCODE_INVERTER_TEMPERATURE(pnt, x) (pnt[1] = (x - 40) >> 8, pnt[0] = (x - 40) & 0xFF) +#define MAP_ENCODE_HV_VOLTAGE(pnt, x) (pnt[6] = (x >> 8) & 0xFF, pnt[5] = x & 0xFF) #define MAP_ENCODE_HV_SOC(pnt, x) (pnt[7] = x) /**======================================================================**/ diff --git a/CAN_pwtdb.h b/CAN_pwtdb.h index 52d39e5..553d2c8 100644 --- a/CAN_pwtdb.h +++ b/CAN_pwtdb.h @@ -178,7 +178,52 @@ #define MAP_ENCODE_PWT_R2D_STATE(pnt, x) (pnt[4] = x) #define MAP_ENCODE_PWT_IGNITION_STATE(pnt, x) (pnt[5] = x) +/**======================================================================**/ + +#define CAN_PWT_BMS_ID_1 0x80 +//little endian +#define MAP_DECODE_PWT_BMS_PACK_INSTANT_VOLTAGE(x) (x[0] << 8 | x[1]) +#define MAP_DECODE_PWT_BMS_PACK_OPEN_VOLTAGE(x) (x[2] << 8 | x[3]) +#define MAP_DECODE_PWT_BMS_PACK_SOC(x) (x[4]) +#define MAP_DECODE_PWT_BMS_PACK_CURRENT(x) (x[5] << 8 | x[6]) + +#define MAP_ENCODE_PWT_BMS_PACK_INSTANT_VOLTAGE(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_OPEN_VOLTAGE(pnt, x) (pnt[2] = (x >> 8) & 0xFF, pnt[3] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_SOC(pnt, x) (pnt[4] = x) +#define MAP_ENCODE_PWT_BMS_PACK_CURRENT(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) + + + +#define CAN_PWT_BMS_ID_1 0x81 + +#define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE(x) (x[0] << 8 | x[1]) +#define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE_ID(x) (x[2]) +#define MAP_DECODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE(x) (x[3] << 8 | x[4]) +#define MAP_DECODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE_ID(x) (x[5]) +#define MAP_DECODE_PWT_BMS_PACK_AVG_CELL_VOLTAGE(x) (x[6] << 8 | x[7]) +#define MAP_ENCODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE_ID(pnt, x) (pnt[2] = x) +#define MAP_ENCODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE_ID(pnt, x) (pnt[5] = x) +#define MAP_ENCODE_PWT_BMS_PACK_AVG_CELL_VOLTAGE(pnt, x) (pnt[6] = (x >> 8) & 0xFF, pnt[7] = x & 0xFF) + + +#define CAN_PWT_BMS_ID_1 0x82 + +#define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_TEMP(x) (x[0]) +#define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_TEMP_ID(x) (x[1]) +#define MAP_DECODE_PWT_BMS_PACK_LOW_CELL_TEMP(x) (x[2]) +#define MAP_DECODE_PWT_BMS_PACK_LOW_CELL_TEMP_ID(x) (x[3]) +#define MAP_DECODE_PWT_BMS_PACK_AMBIENT_TEMP(x) (x[4]) + +#define MAP_ENCODE_PWT_BMS_PACK_HIGH_CELL_TEMP(pnt, x) (pnt[0] = x) +#define MAP_ENCODE_PWT_BMS_PACK_HIGH_CELL_TEMP_ID(pnt, x) (pnt[1] = x) +#define MAP_ENCODE_PWT_BMS_PACK_LOW_CELL_TEMP(pnt, x) (pnt[2] = x) +#define MAP_ENCODE_PWT_BMS_PACK_LOW_CELL_TEMP_ID(pnt, x) (pnt[3] = x) +#define MAP_ENCODE_PWT_BMS_PACK_AMBIENT_TEMP(pnt, x) (pnt[4] = x) + +/**======================================================================**/ // #endif From d3b79ad3631c5dd6fb73b659f5db019f9a74d38b Mon Sep 17 00:00:00 2001 From: perdo1305 <2222035@my.ipleiria.pt> Date: Mon, 2 Sep 2024 11:27:19 +0100 Subject: [PATCH 21/23] Scheisse do perdu FIxed multiple typos+ force push above chen --- CAN_pwtdb.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CAN_pwtdb.h b/CAN_pwtdb.h index 553d2c8..13d4fee 100644 --- a/CAN_pwtdb.h +++ b/CAN_pwtdb.h @@ -182,34 +182,34 @@ #define CAN_PWT_BMS_ID_1 0x80 //little endian -#define MAP_DECODE_PWT_BMS_PACK_INSTANT_VOLTAGE(x) (x[0] << 8 | x[1]) -#define MAP_DECODE_PWT_BMS_PACK_OPEN_VOLTAGE(x) (x[2] << 8 | x[3]) +#define MAP_DECODE_PWT_BMS_PACK_INSTANT_VOLTAGE(x) (x[1] << 8 | x[0]) +#define MAP_DECODE_PWT_BMS_PACK_OPEN_VOLTAGE(x) (x[3] << 8 | x[2]) #define MAP_DECODE_PWT_BMS_PACK_SOC(x) (x[4]) -#define MAP_DECODE_PWT_BMS_PACK_CURRENT(x) (x[5] << 8 | x[6]) +#define MAP_DECODE_PWT_BMS_PACK_CURRENT(x) (x[6] << 8 | x[5]) -#define MAP_ENCODE_PWT_BMS_PACK_INSTANT_VOLTAGE(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = x & 0xFF) -#define MAP_ENCODE_PWT_BMS_PACK_OPEN_VOLTAGE(pnt, x) (pnt[2] = (x >> 8) & 0xFF, pnt[3] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_INSTANT_VOLTAGE(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_OPEN_VOLTAGE(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[2] = x & 0xFF) #define MAP_ENCODE_PWT_BMS_PACK_SOC(pnt, x) (pnt[4] = x) -#define MAP_ENCODE_PWT_BMS_PACK_CURRENT(pnt, x) (pnt[5] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_CURRENT(pnt, x) (pnt[6] = (x >> 8) & 0xFF, pnt[5] = x & 0xFF) -#define CAN_PWT_BMS_ID_1 0x81 +#define CAN_PWT_BMS_ID_2 0x81 -#define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE(x) (x[0] << 8 | x[1]) +#define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE(x) (x[1] << 8 | x[0]) #define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE_ID(x) (x[2]) -#define MAP_DECODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE(x) (x[3] << 8 | x[4]) +#define MAP_DECODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE(x) (x[4] << 8 | x[3]) #define MAP_DECODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE_ID(x) (x[5]) -#define MAP_DECODE_PWT_BMS_PACK_AVG_CELL_VOLTAGE(x) (x[6] << 8 | x[7]) +#define MAP_DECODE_PWT_BMS_PACK_AVG_CELL_VOLTAGE(x) (x[7] << 8 | x[6]) -#define MAP_ENCODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE(pnt, x) (pnt[0] = (x >> 8) & 0xFF, pnt[1] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE(pnt, x) (pnt[1] = (x >> 8) & 0xFF, pnt[0] = x & 0xFF) #define MAP_ENCODE_PWT_BMS_PACK_HIGH_CELL_VOLTAGE_ID(pnt, x) (pnt[2] = x) -#define MAP_ENCODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE(pnt, x) (pnt[3] = (x >> 8) & 0xFF, pnt[4] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE(pnt, x) (pnt[4] = (x >> 8) & 0xFF, pnt[3] = x & 0xFF) #define MAP_ENCODE_PWT_BMS_PACK_LOW_CELL_VOLTAGE_ID(pnt, x) (pnt[5] = x) -#define MAP_ENCODE_PWT_BMS_PACK_AVG_CELL_VOLTAGE(pnt, x) (pnt[6] = (x >> 8) & 0xFF, pnt[7] = x & 0xFF) +#define MAP_ENCODE_PWT_BMS_PACK_AVG_CELL_VOLTAGE(pnt, x) (pnt[7] = (x >> 8) & 0xFF, pnt[6] = x & 0xFF) -#define CAN_PWT_BMS_ID_1 0x82 +#define CAN_PWT_BMS_ID_3 0x82 #define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_TEMP(x) (x[0]) #define MAP_DECODE_PWT_BMS_PACK_HIGH_CELL_TEMP_ID(x) (x[1]) From 35d4c1b0b51f6239e3b2bca1c33548264f2f71dc Mon Sep 17 00:00:00 2001 From: LartADcomputer Date: Thu, 5 Jun 2025 17:15:12 +0100 Subject: [PATCH 22/23] rpm tojal was wrong --- CANOPEN_db.h | 2 +- CAN_asdb.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CANOPEN_db.h b/CANOPEN_db.h index eb6cb5f..c94c6cf 100644 --- a/CANOPEN_db.h +++ b/CANOPEN_db.h @@ -10,7 +10,7 @@ /**================== Node IDS ==========================**/ #define NODE_ID_ACU 0x03 -#define NODE_ID_STEERING 0x05 +#define NODE_ID_STEERING 0x08 #define NODE_ID_BRAKE 0x06 //RESERVED DONT USE #define NODE_ID_RES 0x11 // DO NOT CHANGE!! ENFORCED BY RULES!!! /**======================================================================**/ diff --git a/CAN_asdb.h b/CAN_asdb.h index 1d9de8a..c989e77 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -72,11 +72,11 @@ #ifdef __LART_AXANATO_VCU_GATEWAY__ #define CAN_TOJAL_TEST 0x500 /**======================================================================**/ - #define MAP_DECODE_TOJAL_RPM(x) (x[0] << 8 | x[1]) + #define MAP_DECODE_TOJAL_RPM(x) ((x[1] << 8) | x[0]) #define CAN_TOJAL_SEND_RPM 0x510 /**======================================================================**/ - #define MAP_ENCODE_TOJAL_RPM(pnt, x) (pnt[0] = (x >> 8), pnt[1] = x) + #define MAP_ENCODE_TOJAL_RPM(pnt, x) (pnt[1] = (x >> 8), pnt[0] = x) #endif From 31ba66850add0b7b12920440d27b7e74f9abc84f Mon Sep 17 00:00:00 2001 From: LartADcomputer Date: Fri, 8 Aug 2025 11:20:04 +0100 Subject: [PATCH 23/23] rpm ids changed --- CAN_asdb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAN_asdb.h b/CAN_asdb.h index c989e77..272f6af 100644 --- a/CAN_asdb.h +++ b/CAN_asdb.h @@ -70,11 +70,11 @@ #ifdef __LART_AXANATO_VCU_GATEWAY__ - #define CAN_TOJAL_TEST 0x500 + #define CAN_TOJAL_TEST 0x499 /**======================================================================**/ #define MAP_DECODE_TOJAL_RPM(x) ((x[1] << 8) | x[0]) - #define CAN_TOJAL_SEND_RPM 0x510 + #define CAN_TOJAL_SEND_RPM 0x509 /**======================================================================**/ #define MAP_ENCODE_TOJAL_RPM(pnt, x) (pnt[1] = (x >> 8), pnt[0] = x) #endif