Sevcon Gen4 CAN messages

Hube-

1 mW
Joined
Jul 21, 2014
Messages
14
I was planning to build a custom dashboard for the Sevcon Gen4 Size6 controller by reading the CAN messages. However, I don't have access to the DVT software and therefore can't customize messages. I am stuck with the settings I have. Is there any way to decipher these frames? If not, I have to resolve with a less elegant solution.

These are taken from the bench test. No throttle or anything. I am mostly interested on RPM, Power, Current and Voltage.

"ID (hex)";"DLC";"Data (hex)"
" 80";"0";""
"286";"8";"00 00 00 00 12 00 FE FF"
"339";"8";"00 00 00 00 00 00 9A 03"
"173";"8";"D4 7D 2A 01 25 02 24 00"
"156";"7";"FD 05 21 00 00 00 00"
"279";"8";"00 00 00 00 00 00 00 00"
" 80";"0"
"286";"8";"00 00 00 00 FC FF F8 FF"
"339";"8";"00 00 00 00 00 00 9A 03";
"173";"8";"D4 7D 2A 01 25 02 24 00"
"156";"7";"FD 05 21 00 00 00 00"
"279";"8";"00 00 00 00 00 00 00 00"

BR
 
Well, if they use straightforward conversion from hex to decimal for the values, you can put hte driven wheel off ground, then measure various things externally, and convert the hex data to see if any of the values closely match what you know a particular thing should be.

RPM and voltage are the easiest; current depends on if they are meauring battery or phase. Battery is easy to measure externally; phase less so.
 
I am trying to do the same, use the CAN data to drive a display from my Size 6. I haven’t been able to initialise CAN yet so work in progress. I may be able to help with the CAN data you have posted. I will check those values in my DVT tomorrow and see if I can decipher them.

Bernel
 
Hi Hube,
This is what I have found out so far.
80 0 is a sync message
286 8 is the second transmitted PDO
339 8 is the second received PDO
73 8 is a time stamp
56 7 is a time stamp
279 8 is the first received PDO

The first column is the COB-ID, the second column is the data length. I have not worked out the hex values yet but they are data.

Can you enlighten us all on what you used to capture this data?
 
Take a look at the opensource OVMS project for the Renault Twizy which uses a GEN4 sevcon and allows both monitoring of system parameters and changing of tuning profiles. Also have a look at the Sevcon CANopen Master Object Dictionary spreadsheet which defines the data types for every object and that will save you having to manually decode the data.
 
Thank you! So I suppose all the interesting data is in the PDOs. I used the IXXAT CAN-USB and IXXAT canAnalyser3 Mini software to read the messages. I checked the interesting values from the Sevcon CANopen Master Object Dictionary spreadsheet but not sure how could I use these. At least there are scaling factors for each value. Not sure if any of those are included in my CAN setup.
 
The addresses are the COB ID’s of each TPDO, each PDO contains objects such as battery voltage, motor current etc. You will need to know what object(s) are in each PDO then you can work out the decimal values from the hex values and apply any scaling to get readable data.

Each TPDO can hold 8 bytes of data.


Bernel
 
hello all

I'm trying to decode raws frames canbus from a Sevcon Gen4 and I'm lost, anyone can help me pleas ?

Below, a part of frames captured:

can0 080 [0]
can0 120 [8] 00 00 00 00 02 00 01 00
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F9 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]
can0 120 [8] 00 00 00 00 03 00 F8 FF
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F9 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]
can0 120 [8] 00 00 00 00 09 00 08 00
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F9 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]
can0 120 [8] 00 00 00 00 FB FF FB FF
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F9 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]
can0 120 [8] 00 00 00 00 07 00 11 00
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F8 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]
can0 120 [8] 00 00 00 00 01 00 0C 00
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F9 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]
can0 120 [8] 00 00 00 00 03 00 F8 FF
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F9 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]
can0 120 [8] 00 00 00 00 FD FF 03 00
can0 326 [8] 00 00 00 00 00 00 8D 06
can0 303 [6] D4 7D 7C 00 F6 00
can0 200 [8] F9 02 00 00 00 00 00 00
can0 397 [6] 00 00 00 00 00 00
can0 080 [0]

I have the Objects dictionnary but I don't know how to convert frames to match with index and subindex. :confused:

Please help me

Thank you
 
Hi,

Here is my ESP32 code for the CAN part. Hope this helps. I have no time to translate everything, and also I don't remember any more how all this works :p. I'm not professional programmer. If I remember correctly, I had the IXXAT USB-CAN dongle which I used to translate what bit meant what.


void canbus(void * pvParameters) { // Core 0 loop
for (;;) {
CAN_frame_t rx_frame;
if (xQueueReceive(CAN_cfg.rx_queue, &rx_frame, 3 * portTICK_PERIOD_MS) == pdTRUE) {

if (rx_frame.MsgID == 0x80) {
}

if (rx_frame.MsgID == 0x154) {
}

if (rx_frame.MsgID == 0x128) {
}

if (rx_frame.MsgID == 0x297) {
//ptc = (rx_frame.data.u8[7] << 8)+ rx_frame.data.u8[6]; // motor temperature
ptc = rx_frame.data.u8[7] << 8;
ptc = rx_frame.data.u8[6] | ptc;

}

if (rx_frame.MsgID == 0x301) {
battery_voltage_test = (rx_frame.data.u8[1] * 255 + rx_frame.data.u8[0]) * 0.0625;
if (battery_voltage_test > 150){
battery_voltage = 0;
}
else{
battery_voltage = battery_voltage_test;
}

heatsink = rx_frame.data.u8[2];

//battery_current_test = ((rx_frame.data.u8[4]*255 << 8) + rx_frame.data.u8[3])*0.0625;
battery_current_test = (rx_frame.data.u8[4]*255 + rx_frame.data.u8[3])*0.0625;
if (battery_current_test > 1500){
battery_current = 0;
}
else{
battery_current = battery_current_test;
}

}

if (rx_frame.MsgID == 0x298) {
rpm_test = (rx_frame.data.u8[7] << 8) + (rx_frame.data.u8[6] << 8) + (rx_frame.data.u8[5] << 8) + rx_frame.data.u8[4];

if (rpm_test > 10000){
rpm = 0;
}
else{
rpm = rpm_test;
}

v = radius_of_wheel * rpm / gearing;
v = round(v);

}

/*
Serial.print(millis());
Serial.print(",");
Serial.print(rx_frame.MsgID, HEX);
Serial.print(",");
Serial.print(rx_frame.FIR.B.DLC, HEX);

for(int i = 0; i < 8; i++){
Serial.print(",");
Serial.print(rx_frame.data.u8, HEX);
}
Serial.println();
*/
}
}
 
Back
Top