“Infineon” EB3xx e-bike controller protocol

Some time ago the anonymous chinese manufacturers started to produce newer “Infineon”-based boards with new features. Thus, the settings protocol has changed. Here’s an attempt to reverse-engineer it as well. The info is not guaranteed to be correct, however, I will fix it as soon as new info will be gathered or errors will be found.

The serial protocol of the EB3xx boards is similar to that of the EB2xx boards, but with some modifications. First of all, serial port settings are: 38400 baud, 8 data bits, no parity, 2 stop bits (38400 8N2). Then the program starts sending out the byte ‘8’, until the user presses the “flash” button on the programming adapter. At this point the microcontroller boots, reads the serial port, sees the “8” and answers with a “U”. After this “Parameter Designer” will send out a block of 32 bytes, which contains the controller settings; the table that follows describes every byte of this array. Finally, after receiving the data block and testing the checksum the controller replies with two bytes in sequence: a ‘Q’ and an ‘R’ (this differs from EB2xx protocol).

Offset

Range of values

Description

0

2

Unknown data, same as in EB2xx protocol

1

15

Unknown data, same as in EB2xx protocol

2

0 … 255

PhaseCurrent: the phase current limit. The actual value depends on the controller model (or, rather, of the current measuring schematic). To compute the actual value, use one of the formulas from the following table:

Model

Formula

EB306/Lyen

V = I * 1.25 - 0.2

EB309/Lyen

V = I * 1.25 - 10.2

EB312/Lyen

V = I * 0.624 - 6

EB315/Lyen

V = I * 0.624 - 12

EB318/Lyen

V = I * 0.416 - 11.9

For example, the value for EB312 at 60A phase current would be:

V = 60 * 0.624 - 6 = 31.44 ~= 31

Note that the formulas for EB206-212 Lyen edition controllers are the same as for “generic” Infineon controllers.

3

0 … 255

RatedCurrent: the battery current limit. The actual value depends on the controller model (or, rather, of the current measuring schematics). To compute the actual value, use one of the formulas from the following table:

Model

Formula

EB306/Lyen

V = I * 1.399 + 0.15

EB309/Lyen

V = I * 1.399 + 0.15

EB312/Lyen

V = I * 0.7 + 0.07

EB315/Lyen

V = I * 0.7 + 0.07

EB318/Lyen

V = I * 0.467 + 0.03

For example, the value for EB312 at 20A rated current would be:

V = 20 * 0.7 + 0.07 ~= 14

4

0 … 255

HaltVoltage: The battery voltage at which controller cuts out the power. The programmed value does not depend on the controller model and can be computed by the following formula:

V = U * 3.184

5

0 … 255

Tolerance: The voltage rise on the battery after power has been cut off by HaltVoltage condition to enable the power back. Some batteries (e.g. Pb) will restore their voltage after a bit of rest. The value can be computed with the same formula as HaltVoltage:

V = U * 3.184

6

38 … 127

LimitSpeed: This is the speed value to use when the speed limit switch (or wire-plug) is connected to ground (“SL” contact on the board). The actual value to program can be derived from the speed percent (0-99%) with the following formula:

V = SL * 1.28 (sic! this is different from SpeedX)

7

0: Switch 3spd X1 X2
1: Cycle 3spd X1

2: High Switch 3spd !X1 !X2

3: Cycle 4spd X1

SpeedMode: The behavior for the 3-position switch; how to select one of the pre-programmed speed limits.

8

24 … 95

Speed1: The speed “1” setting. The actual value to program can be computed from the speed percent (30-120%) with the following formula:

V = SL / 1.26

9

24 … 95

Speed2: The “default” speed, when not using any kind of speed switches. The formula for the programmed value is:

V = SL / 1.26

10

24 … 95

Speed3: The third speed setting. The formula for the programmed value is:

V = SL / 1.26

11

10 … 100

BlockTime: The amount of time to try rolling the wheel before deciding that it has been blocked (e.g. if the Hall sensors signals won’t change for that much time, the controller will stop trying). The programmed value is:

V = T * 10

12

10 … 150

AutoCruisingTime: If the throttle position stays still for that much time, the controller will lock this value and even if you release the throttle, it will keep the speed. The programmed value is:

V = T * 10

13

0: Enable

1: Disable

SlipChargeMode: This mode, if enabled, will allow you to brake with the throttle - when you release the throttle, it will start braking. Note that this is incompatible with “Auto Cruising” feature.

14

0: Common VCC

1: Common GND

IndicateMode: The work mode for the LED indicator contacts (P1-P3 on the board). The P3 output (along with the speed LED signals P1 and P2) can be active high or active low depending on this setting.

15

0, 4, 8, 255

EBS Level: The amount of energy to regenerate while braking. When 0, no energy will be recovered, thus no regen braking; when 4, a medium amount of energy will be recovered (recommended for small wheels) and 8 for the highest amount of recovered energy (strong braking). The actual programmed value:

V = L * 4

The value 255 seems to mean “unlimited regeneration current”, but this has not been tested.

16

0 … 191

ConverseSpeed: This is the reverse rotation speed, activated by connecting the DX3 contact on the board to GND. The formula for the value is:

V = SL * 1.91

17

0 … 255

EBSLimVoltage: The regeneration voltage limit. The formula is the same as for the voltage values above, e.g.:

V = U * 3.285

Note: This is supposed to use the same circuitry as HaltVoltage, thus the formulas should be identic. However, in KEBL the formulas are slightly different. To me, the HaltVoltage formula looks more correct.

18

0: Low

1: High

GuardLevel: this sets the polarity of the “anti-theft” signal (controller blocks the motor from rotating). When set to 0, connecting the TB contact to ground will activate the feature; when set to 1 a high signal will activate the feature.

19

0: Disabled

1: Enabled

BarProtect: enables protection against burned out throttle electronics. If throttle signal goes above ~4V (normally it is below), controller stops.

20

0: Fast

1: Slow

1:1 Design: this is for pedal assist sensor.

21

1 .. 13

PAS Start Pulse: This is the amount of pulses from the PAS sensor to skip before starting assisting to pedalling. The programmed value is 2 less than the actual number of pulses, e.g. programming a ‘8’ will start the assistant after the 10th pulse.

22

0 … 3

DefaultSpeed: This determines which of the four programmed speed limits will be default after power on (0 - Speed1 … 3 - Speed4).

23

24 … 95

Speed4: The fourth speed setting. The formula for the programmed value is:

V = SL / 1.26

24

0 - 120 degree

1 - 60 degree

2 - Compatible

PhaseDegree: the (electric) angle between Hall sensors

25

0  191

1+1 Max Speed: This sets the speed limit when using the pedal assistant. The formula for the value is:

V = SL * 1.91

26

0: No
1: Yes

LimitCruise: So far it’s not clear what this does.

27

0..6

Controller type:

Model

Value

EB306

1

EB309

2

EB312

3

EB315

4

EB318

5

EB324

6

28

0

Unused

29

0

Unused

30

0

Unused

31

0 … 255

The exclusive disjunction (XOR) of the previous 31 bytes (a kind of check sum).