You are on page 1of 19

Page 1

Project:

ILSLE wheel load sensor


CAN protocol

Client: ILJIN GmbH


Amsterdam Str.6a
97424 Schweinfurt, Germany

Contact Person: Dr. -Ing. Tomasz Grabiec

Contractor: GED mbH


Society for Electronics and Design
Pastoratsstrasse 3
D-53809 Ruppichteroth –Winterscheid
Internet: www.ged-pcb-mcm.de
Editor: Harald Lenz

Page 2

contents

CONTENTS ................................................. .................................................. .................................................. ...... 2

1 INTRODUCTION ................................................. .................................................. ..................................... 4

2 PROTOCOL STRUCTURE ................................................. .................................................. .............. 4


2.1 Message ID ............................................... .................................................. .......................... 4
2.2 Error message ................................................. .................................................. .................... 4
2.3 Depiction ................................................. .................................................. ......................... 4
2.4 Endianness ................................................. .................................................. .......................... 4
2.5 Complement representation ................................................. .................................................. ..... 5

3 COMMANDS (0X0 *: SYSTEM) ........................................... .................................................. ........ 5


3.1 Structure ................................................. .................................................. ............................... 5
3.2 0x00 - Reboot / switch-on message ............................................. ............................................ 5
3.3 0x01 - Version query ............................................... .................................................. ........ 6
3.4 0x02 - Abort ............................................... .................................................. .................... 6
3.5 0x03 - reset to zero ............................................... .................................................. ....... 6
3.6 0x0B - Bootloader ............................................... .................................................. ................ 7
3.7 0x0C - Bootloader cause ............................................. .................................................. ... 7

4th COMMANDS (0X1 *: SETTINGS) ........................................... ........................................ 8th


4.1 Structure ................................................. .................................................. ............................... 8th
4.2 0x10 - Save current settings ............................................. ................................. 8th
4.3 0x11 - restore factory settings .............................................. .......................... 8th
4.4 0x12 - Setting the Rx-CAN-ID ......................................... .................................................. .. 8th
4.5 0x13 - Set the Tx-CAN-ID ......................................... .................................................. .. 9
4.6 0x14 - Set the CAN bit rate ........................................... .................................................. 9
4.7 0x15 - Setting the DMS parameters ........................................... .......................................... 10
4.8 0x16 - Setting the temperature sensor parameters ........................................... ...................... 10
4.9 0x17 - Setting the acceleration sensor parameters ........................................... ............. 11
1.1 0x18 - Setting the conversion factor ............................................. ................................ 11
4.10 0x1C - factory calibration ............................................... ................................................ 12
4.11 0x1D - edit factory calibration .............................................. ............................... 13
4.12 0x1E - show factory calibration .............................................. .................................. 13

5 COMMANDS (0X2 *: MEASURED VALUES) ........................................... ............................................. 14


5.1 Structure ................................................. .................................................. ............................. 14
5.2 0x20 - strain gauges ............................................... .............................................. 14
5.3 0x21 - temperature sensors ............................................... ................................................. 15
5.4 0x22 - Accelerometer ............................................... ............................................ 15
5.5 0x23 - strain gauge compensated .............................................. ......................... 15

6th COMMANDS (0XA * ​/ 0XE * / 0XF *: BOOTLOADER) ..................................... ........................ 16

Page 3

6.1 Structure ................................................. .................................................. ............................. 16


6.2 0xA - set address .............................................. .................................................. .......... 17
6.3 0xE - Erase / Program ............................................. .................................................. ............ 17
6.4 0xF - fill page buffer ............................................ .................................................. ....... 17

7th USED ​ABBREVIATIONS ................................................ ................................................. 18

8th DOCUMENT HISTORY ................................................. .................................................. ............... 18


3

Page 4

1 introduction
Since the customer did not have a separate communication protocol for the
CAN interface could be presented, it was decided by mutual agreement that the GED the
Provides prototypes with a specially defined protocol to enable test operation.

2 protocol structure
2.1 Message ID
A message ID of the type "Standard" is used by default; this is 11 bits wide.
The following message ID is defined for commands to the device:
0x049 = 0b000.0100.1001

It is the ASCII code for the letter "I" to give the name Ilyin
symbolize.
The most significant bit is set in the message ID for the respective responses:
0x449 = 0b100.0100.1001

The send and receive ID as well as the respective


ID type ("Standard", "Extended") can be changed.
In order to avoid that the module no longer by reconfiguring the receive ID
is addressable (ID unknown), it sends a data packet with the receive ID when it is switched on
the send ID (see command "0x00").

2.2 error message


In the event of a protocol error (unknown command, incorrect parameter), the
received message is simply sent back to the host. Only the Messsage ID
replaced by the response ID.

2.3 Presentation
All CAN messages are represented as a series of bytes. Each byte is a two digit
Hex number that can alternatively be interpreted as a decimal number in the range 0 ... 255.
2.4 Endianness
The "Little Endian" format is used for numerical values ​that extend over several bytes
used. This means that the data is sent in the order "MSB first".

The CAN interface does not define any endianness, so the byte order has been adapted to the
CANopen protocol based.

4th

Page 5

2.5 Complementary representation


Negative numerical values ​are transmitted in two's complement representation.

3 commands (0x0 *: system)


3.1 structure
System commands to the sensor board are structured as follows:
<CC> [<PP ...>]

The individual fields are defined as follows:

Name field description


CC 0 ... 255 Command Code Command code (unique hex value)
PP * Parameter Data Parameter (see command description)

Responses from the sensor board are structured as follows:


<CC> [<DD ...>]

The individual fields are defined as follows:

Name field description


CC 0 ... 255 Command Code Command code (like request)
DD * Data fields Response data (see command description)

3.2 0x00 - Reboot / switch-on message


A system reboot (and thus also the switch-on message) can be carried out with the following command
can be generated at any time:
00
The answer is structured as follows:
00 <TT> <II II II II>

The individual fields are defined as follows:

Name field description


TT 0 ... 1 ID Type Standard ID (0) or Extended ID (1)
II 0x0… ID Receive ID

Page 6

0x1FFFFFFF

3.3 0x01 - version request


This command provides information on the hardware and firmware version:
01

The answer is structured as follows:


01 <AA> <II> <YY> <NN> <RR RR>

The individual fields are defined as follows:

Name field description


CC 0 ... 255 Command Code Command code (0x00)
AA 0 ... 255 HW major Hardware version (before point)
II 0 ... 255 HW minor Hardware version (by point)
JJ 0 ... 255 FW Major Firmware version (before point)
NN 0 ... 255 FW Minor Firmware version (by point)
RR RR 0 ... 65535 FW revision Firmware revision number

3.4 0x02 - abort


This command cancels all currently running measurements and transmissions:
02

The answer only consists of the command byte as confirmation.

3.5 0x03 - zero reset


This command defines the mean value of a measuring window as the zero point for the strain gauge
(Zero calibration). A window size is defined for the subsequent measurements, within
which the offset value is determined:
03 <FF>

The individual fields are defined as follows:

Name field description


FF 0 ... 255 Frame size Number of measured values ​to be averaged
6th

Page 7

The answer only consists of the command byte as confirmation.

3.6 0x0B - boot loader


The following command can be used to jump directly to the bootloader at any time:
0B

The answer is structured as follows:


0B <TT> <II II II II>

The individual fields are defined as follows:

Name field description


TT 0 ... 1 ID Type Standard ID (0) or Extended ID (1)
II 0x0… ID Receive ID
0x1FFFFFFF

In the unlikely event that faulty firmware has been written to the flash
that does not allow any more commands can be bridged (ie short-circuited) of the external
NTC must be forced to jump into the bootloader during startup. This backdoor
Functionality is only used as a safeguard in the event of an emergency.
When the system starts, the bootloader checks the integrity of the firmware and then starts it.
If the integrity check fails, the bootloader remains active, which is indicated by the above switch-on message
is recognizable.
The bootloader is used to carry out a firmware update via the CAN interface.
Under normal circumstances we strongly advise against changing to the bootloader!

3.7 0x0C - cause of the bootloader


To find out why the bootloader is active (primarily for debugging purposes), you can
the following command can be used:
0C

The answer is structured as follows:


0C <II>

The individual fields are defined as follows:

Name field description


II 0 ... 5 Cause ID Bootloader Reason ID:

7th

Page 8

0 → unknown
1 → Request via command 0x0B
2 → Invalid keyword address in the flash
3 → Invalid keyword in the flash
4 → Invalid CRC in the flash
5 → Backdoor activated

4 commands (0x1 *: settings)


4.1 structure
The structure of the setting commands is identical to that of system commands (see above).
It should be noted that changes to the settings do not take effect until these
saved ( 0x10 ) and a reboot ( 0x00 ) was carried out!

4.2 0x10 - Save current settings


This command saves the current settings in the flash memory so that they can be used from the
next time they are switched on:
10

The answer only consists of the command byte as confirmation.

4.3 0x11 - restore factory settings


This command restores the factory settings; to make them permanent should
they are also saved (see above):
11

The answer only consists of the command byte as confirmation.


4.4 0x12 - Setting the Rx-CAN ID
This command sets the CAN ID for receiving commands; all other ids will be
filtered out on the hardware side:
12 <TT> <II II II II>

The individual fields are defined as follows:

Name field description


TT 0 ... 1 ID Type Standard ID (0) or Extended ID (1)

8th

Page 9

II 0x0… ID Message ID
0x1FFFFFFF

The answer only consists of the command byte as confirmation.

4.5 0x13 - Setting the Tx-CAN ID


This command sets the CAN ID for sending responses:
13 <TT> <II II II II>

The individual fields are defined as follows:

Name field description


TT 0 ... 1 ID Type Standard ID (0) or Extended ID (1)
II 0x0… ID Message ID
0x1FFFFFFF

The answer only consists of the command byte as confirmation.

4.6 0x14 - Setting the CAN bit rate


This command sets the bit rate for CAN communication:
14 <NN> <DD>

The individual fields are defined as follows:

Name field description


NN 0 ... 4 Nominal bit rate Bit rate for the header part of the message:
0 → 50kbps
1 → 125kbps
2 → 250kbps (default)
3 → 500kbps
4 → 1000kbps
DD 0… 4 Data bit rate Bit rate for the header part of the message:
0 → 50kbps
1 → 125kbps
2 → 250kbps (default)
3 → 500kbps
4 → 1000kbps

In order to maintain compatibility with CAN "Classic", both bit rates must be configured identically
(default). The CAN FD mode, on the other hand, allows a higher bit rate for the
Data part than for the header part.

Page 10

The answer only consists of the command byte as confirmation.

4.7 0x15 - Setting the DMS parameters


This command sets the parameters for the DMS A / D converter:
15 <PP> <DDDD>

The individual fields are defined as follows:

Name field description


PP 0 ... 7 PGA gain PGA gain factor:
0 → 1x → ± 3.3 V
1 → 2x → ± 1.65 V
2 → 4x → ± 825 mV
3 → 8x → ± 412.5 mV (default setting)
4 → 16x → ± 206.25 mV
5 → 32x → ± 103,125 mV
6 → 64x → ± 51.5625 mV
7 → 128x → ± 25.78125 mV
DD 1… 2047 Data rate Data rate:
1 → 6400 PLC
2 → 3200 PLC
3 → 2133.33 PLC (default setting)
6 → 1066.67 PLC
10 → 640 PLC
20 → 320 PLC
40 → 160 PLC
80 → 80 PLC
160 → 40 PLC
320 → 20 PLC
384 → 16.67 PLC
640 → 10 PLC
1280 → 5 PLC
1920
2047 →
→ 3.33
3.13 PLC
PLC

The answer only consists of the command byte as confirmation.

4.8 0x16 - Setting the temperature sensor parameters


This command sets the parameters for the temperature A / D converter:
16 <TT>

The individual fields are defined as follows:

Name field description


10

Page 11

TT 0 ... 7 Sampling time Sampling time for the A / D converter:


0 → 2.5 cycles
1 → 6.5 cycles
2 → 12.5 cycles
3 → 24.5 cycles
4 → 47.5 cycles
5 → 92.5 cycles
6 → 247.5 cycles (default setting)
7 → 640.5 cycles

The answer only consists of the command byte as confirmation.

4.9 0x17 - Setting the acceleration sensor parameters


This command sets the parameters for the acceleration sensor:
17 <RR> <SS>

The individual fields are defined as follows:

Name field description


RR 1 ... 9 rate Data rate:
1 → 0.5Hz = 2000ms
2 → 1Hz = 1000ms
3 → 2Hz = 500ms
4 → 5Hz = 200ms
5 → 10Hz = 100ms
6 → 50Hz = 20ms
7 → 100Hz = 10ms
8 → 400Hz = 2.5ms
9 → 1000Hz = 1ms (default setting)
SS 0… 2 Scale Measuring range:
0 → ± 6g
1 → ± 12g
2 → ± 24g (default setting)

The answer only consists of the command byte as confirmation.

1.1 0x18 - Setting the conversion factor


This command is used to set a conversion factor, e.g. B. for converting
Digits to Newton:
18 <FF FF FF FF>

The individual fields are defined as follows:

11

Page 12

Name field description


FF FF -2147483648 ... Factor Conversion factor in millionths, ie the smallest
FF FF 2147483647 Value 1 means division by 1000000.
Default setting: 1000000 (measured value becomes 1: 1
passed through).

The answer only consists of the command byte as confirmation.

4.10 0x1C - factory calibration


This command adjusts the values ​for the temperature compensation of the DMS to the current ones
Environmental conditions. These are currently the coefficient a and the reference temperature T0 :
1C <FF>

The individual fields are defined as follows:

Name field description


FF 0 ... 255 Frame size Number of measured values ​to be averaged
(is multiplied internally by 256)

The answer is structured as follows:


1C <AA AA AA> <TT TT>

The individual fields are defined as follows:

Name field description


AA AA -8,388,608 ... Coeff. A. Constant coefficient x 0
AA 8,388,607
TT TT -32768… Ref. T0 Reference temperature T0 in units of 0.1 ° C
32767 (Two's complement representation)

Notes on factory calibration


• The factory calibration must be carried out in an unloaded condition
• If the factory calibration has not been carried out, the compensated strain gauge measurement is blocked
• The calibration data must then be saved with command 0x10
• Command 0x11 does not affect the calibration data
• To enable a particularly precise calibration, the frame size value
(Oversampling) internally multiplied by 0x100 (256); thus generates the maximum value 0xFF
65,536 measurements (duration: about half a minute)
• Thanks to the return of the calibration values, the fluctuation of the
Check the calibration values ​and adjust the oversampling if necessary

12th

Page 13

4.11 0x1D - Process factory calibration


This command is used to subsequently adjust the coefficients of the factory calibration.
1D <AA AA AA> <BB BB> <CC CC>

The individual fields are defined as follows:

Name field description


AA AA -65536 ... Coeff. A. Constant coefficient x 0
AA 65535
BB BB -65536… Coeff. B. Linear coefficient x 1 (multiplied by a factor of 1000,
65535 to make decimal fractions representable as whole numbers)
CC CC -65536… Coeff. C. Quadratic coefficient x 2 (with a factor of 1000
65535 multiplied so that decimal fractions can be represented as whole numbers
close)

The answer only consists of the command byte as confirmation.

4.12 0x1E - display factory calibration


This command is used to display the coefficients of the factory calibration.
1E

The answer is structured as follows:


1E <AA AA AA> <BB BB> <CC CC>
The individual fields are defined as follows:
Name field description
AA AA -65536 ... Coeff. A. Constant coefficient x 0
AA 65535
BB BB -65536… Coeff. B. Linear coefficient x 1 (multiplied by a factor of 1000,
65535 to make decimal fractions representable as whole numbers)
CC CC -65536… Coeff. C. Quadratic coefficient x 2 (with a factor of 1000
65535 multiplied so that decimal fractions can be represented as whole numbers
close)

Example: The preset values ​are for Coeff. B 6.7 * 1000 = 6700 (0x2c 0x1a) , as well as for
Coeff. C 0.002 * 1000 = 2 (0x02 0x00) .

13

Page 14

5 commands (0x2 *: measured values)


5.1 structure
Commands to the sensor board are structured as follows:
<CC> [<OO> [<RR RR> [<DD DD>]]]

The individual fields are defined as follows:

Name field description


CC 0 ... 255 Command Code Command code (unique hex value)
OO 0 ... 255 Oversampling oversampling per measured value (averaging);
Default setting: 0
RR RR 0 ... 65535 Repetitions Number of repetitions (i.e. number of additional
Answers); Default setting: 0; Special case 0xFFFF:
infinite repetition (until abort command)
DD DD 0 ... 65535 Delay Distance between the repetitions to be sent
in milliseconds; Default setting: 0

Each command generates one or more responses (depending on the parameterization).


Example:
20 02 05

Execute command 0x11, send (5 + 1) = 6 times the mean value (2 + 1) = 3 values.

Responses from the sensor board are structured as follows:


<CC> <DD ...>
The individual fields are defined as follows:
Name field description
CC 0 ... 255 Command Code Command code (like request)
DD * Data fields Measurement data (for format see command description)

5.2 0x20 - strain gauges


This command requests one or more measured values ​from the strain gauge.
The answer is structured as follows:
20 <DD DD DD>

The individual fields are defined as follows:

Name field description


14th

Page 15

DD DD -8,388,608 ... Data Measurement data in two's complement representation


DD 8,388,607

5.3 0x21 - temperature sensors


This command requests one or more measured values ​from both temperature sensors.
The answer is structured as follows:
21 <II II> <EE EE>

The individual fields are defined as follows:

Name field description


II II -32768 ... Internal Internal temperature in units of 0.1 ° C
32767 Temperature (Two's complement representation)
EE EE -32768… External External temperature in units of 0.1 ° C
32767 Temperature (Two's complement representation)

5.4 0x22 - accelerometer


This command requests one or more measured values ​from the acceleration sensor.
The answer is structured as follows:
22 <XX XX> <YY YY> <ZZ ZZ>

The individual fields are defined as follows:


Name field description
XX XX -32768 ... X axis Acceleration value on the X axis in
32767 Two's complement representation
YY YY -32768… Y axis Acceleration value on the Y-axis in
32767 Two's complement representation
ZZ ZZ -32768… Z axis Acceleration value on the Z axis in
32767 Two's complement representation

5.5 0x23 - strain gauge compensated


This command requests one or more temperature-compensated measured values ​from
Strain gauges.
The answer is structured as follows:
23 <DD DD DD DD>
15th

Page 16

The individual fields are defined as follows:

Name field description


DD DD -2147483648 ... Data Measurement data in two's complement representation
DD DD 2147483647

6 commands (0xA * / 0xE * / 0xF *: Bootloader)


6.1 structure
The bootloader protocol differs from the standard protocol in that the command code
is in the first nibble.
All bootloader commands either send no response (command F *) or a response
in the following format:
<CC> <SS> <PP ...>

The individual fields are defined as follows:

Name field description


CC 0x00 ... 0xFF Command Code Command code of the associated command
SS 0x00 ... 0xFF status Status code:
0x00 → OK
0x10 → Invalid flash page specified
0x11 → Invalid chunk address specified
0x20 → Bootloader in wrong state
0x21 → Missing chunk
0x22 → CRC error
0x30 → Failed to delete the flash
0x31 → Failed to write the flash
0x80 → Invalid command
PP 0x00 ... parameter Status parameters depending on the status code:
0xFFFFFFFF 0x00 → No parameter
0x10 → Flash page index (1 byte)
0x11 → chunk index (2 bytes)
0x20 → status index (1 byte)
0x21 → chunk index (2 bytes)
0x22 → Flash page index (1 byte)
0x30 → Flash page index (1 byte)
0x31 → Flash page index (1 byte)
0x80 → No parameter

The process of a firmware update is as follows:


• Reading in the source file, appending a CRC32 (polynomial 0x04C11DB7, preset

16

Page 17

0xFFFFFFFF)
• For each started flash page (2048 bytes):

◦ Send command 0xA (set address)


◦ Repeated sending of command 0xF (fill buffer)
◦ Send command 0xE (erase flash and write again)

In order to simplify the update process, GED is using the program


Iljin_Flash_Utility.exe is made available, which by means of an IXXAT USB-to-CAN
Adapter can perform the update.

6.2 Set 0xA address


This command sets the target address (page number) in the flash, the firmware offset does not
included:
A <N> <NN>

The individual fields are defined as follows:

Name field description


NNN 0x000… Address Index Flash page address, starting with 0
0xFFF

The answer is structured as stated above.


6.3 0xE - Erase / Program
This command writes the data previously written into the buffer with 0xF for a complete
Page (2048 bytes) into Flash:
E0

The answer is structured as stated above.

6.4 0xF - fill page buffer


This command writes data into the page buffer:
F <A> <AA> <DD> <DD> <DD> <DD> <DD> <DD>

The individual fields are defined as follows:

Name field description


AAA 0x000… Address Index Chunk address within the flash page
17th

Page 18

0xFFF
DD 0x00 ... 0xFF data Data to be written

This command does not send a response.

7 Abbreviations used

DMS Strain gauges


ID Identification Number

8 Document History
date modification Surname
02/16/2021 Initial creation Lenz
02/24/2021 • Command 0x00 now causes a reboot Lenz
• Notice of the entry into force of recruitment
• Added setting of the CAN bit rate
04/26/2021 • Voltage ranges for the gain factor Lenz
corrected
• Added reference to hex format
• Bootloader added
05/04/2021 • Command 0x0C added Lenz
05/26/2021 • DMS temperature compensation added Lenz
06/09/2021 • Typos in command 0x1C fixed Lenz
03.09.2021 • Commands 0x1D and 0x1E added Lenz
08.09.2021 • Command 0x18 added Lenz

18th

You might also like