• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

Lishui "Open Source Firmware" project / KingMeter 5S

I have an e-bike whose display key-disp KD26E has stopped working. A replacement display costs a ridiculous amount of money online
There are a lot of very cheap offers, but the seller warns:
1786346418189.png

As said already, without having a working system, you can't reverse engineer, how the signals have to be.

two of the five pins from the display go to the controller inputs labeled S2 and AX2.
Have you tried to simply short one of the wires to GND? Maybe, the display just emulates a simple three speed switch.
But if TX and RX on the controller are not connected to the display, there will be no UART communication. Very early displays just used a linear voltage output to switch the levels.
 
Last edited:
There are a lot of very cheap offers, but the seller warns:
View attachment 391497

As said already, without having a working system, you can't reverse engineer, how the signals have to be.


Have you tried to simply short one of the wires to GND? Maybe, the display just emulates a simple three speed switch.
But if TX and RX on the controller are not connected to the display, there will be no UART communication. Very early displays just used a linear voltage output to switch the levels.
Hello,
You are absolutely right. I have confirmed experimentally that the AX2 pin receives an analog voltage, and the voltage changes depending on the selected speed/assist level.
Therefore, I believe any analog display that changes the voltage on its signal wire according to the selected speed level should work for my controller.
The only problem is that I am not sure which type of analog display I need. Could you please help me identify the correct one?
Thank you!
 
No, you have to look for a four wire version, 5 wire version are UART types. Of course we dont't know the function of the fifth wire on your KD26 display.

The fifth wire from the original display goes to S2, but I don’t know what it is responsible for.

I did an experiment. I removed the display from my wife’s bike. It also has a 5-pin connector. The first time I connected it, it didn’t work. Then I measured the voltage on the control wires and found that they were reversed. I swapped them around, and the bike started working. It could even switch between the speed levels, but the first speed level didn’t work.

It’s possible that the first speed level corresponds to a very low voltage, which the controller cannot detect. Speed levels 2 and 3 worked correctly.

I went further and found another display I had, but this one has a 4-pin connector. However, the wiring and signals are completely different from the first one, so I couldn’t get the bike to work with it.

I’m attaching a photo of the first display from my experiment, as well as a photo of the second display disas29072.jpg29049.jpgsembled.
 

Attachments

  • 29048.jpg
    29048.jpg
    2.4 MB · Views: 1
The displays look very similar externally, but one has a 5-pin Juliet connector, while the other has a 4-pin connector.
 
No, you have to look for a four wire version, 5 wire version are UART types. Of course we dont't know the function of the fifth wire on your KD26 display.

According to the link you sent, do you think this display is analog and would it be compatible with my bike?

Changing the connector and soldering the wires correctly is not a problem for me.
 
Hi folk,
Is there anywhere a schematic or a draft of the schematic for the Lishui controller available?
I have a single-shunt controller with STM32F030 controller and am curious if my FOC can be fitted to this controller
 
Is there anywhere a schematic or a draft of the schematic for the Lishui controller available?
Yes, see the EBiCS repo:

I have a single-shunt controller with STM32F030 controller
Doing FOC with a single shunt is possible, but no fun, you have to trigger the ADC readings dynamically at the right phases of the PWM period to get the single phase currents...
See chapter 5.3 of the STM paper:

1787228019096.png
1787228148098.png
 
Yes, see the EBiCS repo:


Doing FOC with a single shunt is possible, but no fun, you have to trigger the ADC readings dynamically at the right phases of the PWM period to get the single phase currents...
See chapter 5.3 of the STM paper:

View attachment 391889
View attachment 391890
I have this problem with the shunt every day)) so this is the smallest of problems 😅 The biggest is to find a time
Taking this chance to ask you. Did you try to use CubeIDE? Or do you plan to migrate to CubeIDE?
 
Did you try to use CubeIDE?
The M365 branch is already ported to the CubeIDE.
The CubeIDE has an import filter for STM32Workbench projects, so it should be no problem to convert any other branch. But I don't recommend that, as Lishui uses clone processors sometimes, that can't be flashed directly from the CubeIDE. The documented tweaks of some config files that are working to use clones with the STM32Workbench, don't work with the CubeIDE...
 
Last edited:
The M365 branch is already ported to the CubeIDE.
The CubeIDE has an import filter for STM32Workbench projects, so it should be no problem to convert any other branch. But I don't recommend that, as Lishui uses clone processors sometimes, that can't be flashed directly from the CubeIDE. The documented tweaks of some config files that are working to use clones with the STM32Workbench, don't work with the CubeIDE...
This is an argument, did not know about that. Indeed, make sense to stay on STM32Workbench.
Thank you!
 
Back
Top