Lishui Controller Modification - Firmware Flash Project

saneagle

Esteemed Pedelecer
Oct 10, 2010
8,981
4,017
Telford
Stealth morse codes to activate full throttle for 10, 30, 60, 200000 seconds, after which it reverts to 6kph limitation?
KT controller and LCD does that without stealth codes. You set the controller to be completely legal and save the settings. When you start your next ride, you can set it to whatever you want and not save the settings. Those new settings will be active until you switch off, then it will revert to saved settings. Note that the LCD will automatically switch off and revert to the saved settings if you stop the bike for a few minutes.
 

guerney

Esteemed Pedelecer
Sep 7, 2021
12,155
3,393
KT controller and LCD does that without stealth codes. You set the controller to be completely legal and save the settings. When you start your next ride, you can set it to whatever you want and not save the settings. Those new settings will be active until you switch off, then it will revert to saved settings. Note that the LCD will automatically switch off and revert to the saved settings if you stop the bike for a few minutes.
Wish my display did all that, unfortunately changing values onscreen alters nothing until save.
 

Woosh

Trade Member
May 19, 2012
21,371
17,338
Southend on Sea
wooshbikes.co.uk
KT controller and LCD does that without stealth codes. You set the controller to be completely legal and save the settings. When you start your next ride, you can set it to whatever you want and not save the settings. Those new settings will be active until you switch off, then it will revert to saved settings. Note that the LCD will automatically switch off and revert to the saved settings if you stop the bike for a few minutes.
You could do that easily with an arduino without needing OSF and firmware flashing.
 

guerney

Esteemed Pedelecer
Sep 7, 2021
12,155
3,393
You could do that easily with an arduino without needing OSF and firmware flashing.
An arduino hanging off the thang aint so stealth?
 

Woosh

Trade Member
May 19, 2012
21,371
17,338
Southend on Sea
wooshbikes.co.uk
An arduino hanging off the thang aint so stealth?
You are right of course. You will have to add it I line with the 1 to 4 julet cable.
 

Sparksandbangs

Pedelecer
Jan 16, 2025
188
56
Fixed the assist indication on the display. Now works and blinks when the pedals are rotated.

Finally starting to understand the PAS settings. Borrowed this diagram from the German forum.
63819

Ramp end and PAS timeout are timed amounts between 2 PAS pulses. This is in recorded in 8000ths of a second.

Pas timeout cuts the power if no pulse has been seen for the determined period (must be longer than Ramp end).
Ramp end is the point that the power for the selected level is applied.

It looks like my previous statement that power is increased with cadence was wrong. My understanding now is that power is increased with cadence at lower speeds of crank rotation as some sort of soft start. When a predetermined level is reached the power for that level is applied.

I have had the ramp end setting far too low meaning that I have flattened the incline on the graph. Adjusting the number upwards should steepen that ramp and bring the power on sooner.

Third attempt at the V hill this morning. Behaved exactly the same. Power came back on the uphill as soon as the speed dropped below 25kmph.
 
  • Like
Reactions: Woosh

Sparksandbangs

Pedelecer
Jan 16, 2025
188
56
Assuming I've got the maths right.
63827
Previous setting of Ramp end was 1000, 12 pulses per rotation, so a cadence of 40rpm before full power from selected assist level applied.
Now adjusted to 1500 so 27rpm. Will see what difference it makes later.

Edit: Feels better, I'm going to keep increasing it to see how it feels. Also I can't add up. The 8000 should be the top line divided by everything else. I've amended the calculation above.
 
Last edited:
  • Like
Reactions: Woosh and Jodel

Sparksandbangs

Pedelecer
Jan 16, 2025
188
56
Moved the ramp time up even further to 3500.

Set the battery bar to drop a level just above the actual voltage on he LCD3 display. Kept adjusting the calibration factor down until it changed and then knocked it back up a bit. Now should hopefully be accurate to the points that I've set it.

Looking at the code for the Watts in the display it seems it bit weird. The controller calculates the power in Watts using the current and the voltage as well as the calibration factor that I mentioned earlier. It then converts this into a number between 0 and 255 with each increment representing 0.25A. The display receives this value and multiplies it with the line voltage it measures from the battery to get the power in Watts.

Seems a bit silly to calculate in Watts then convert again to a value representing Amps then have the display convert that back into Watts. So simplified it to convert the battery current into the transmitted number. Will see what happens later.

Fourth time down and up the V. Same results as previously.
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
8,981
4,017
Telford
Moved the ramp time up even further to 3500.

Set the battery bar to drop a level just above the actual voltage on he LCD3 display. Kept adjusting the calibration factor down until it changed and then knocked it back up a bit. Now should hopefully be accurate to the points that I've set it.

Looking at the code for the Watts in the display it seems it bit weird. The controller calculates the power in Watts using the current and the voltage as well as the calibration factor that I mentioned earlier. It then converts this into a number between 0 and 255 with each increment representing 0.25A. The display receives this value and multiplies it with the line voltage it measures from the battery to get the power in Watts.

Seems a bit silly to calculate in Watts then convert again to a value representing Amps then have the display convert that back into Watts. So simplified it to convert the battery current into the transmitted number. Will see what happens later.

Fourth time down and up the V. Same results as previously.
If it helps, here's a trace from a standard KT controller. You can see that changing power levels gives a more or less instant step. Likewise, look to where there is zero current because of free-wheeling, then see the step when the pedalling starts. The scale at the bottom is seconds, so if there is any ramp, it's exceptionally steep. You can also see the effects of the power cutting in and out when at the maximum speed, which is about the level of the black line labelled "level3".

If you look at the point 8448, that's where I was going downhill above the speed limit, as indicated by the speed trace, then the bike slows down as I go up a medium hill and the power cuts back in on level 3. The change in speed throughout the chart is basically indicating the steepness of the hill up or down.

63854
 
Last edited:
  • Like
Reactions: Sparksandbangs

Sparksandbangs

Pedelecer
Jan 16, 2025
188
56
If it helps, here's a trace from a standard KT controller.
like that. Interesting.

I was considering putting the KT controller back on for a test as I couldn't remember how the power came on. Just to confirm from a standing start it ramps up almost instantly to the assistance level selected?

My aim is to massively reduce the ramp. Setting at 3500 should make the power kick in at 11.5 rpm which is about 1 rotation every 5 seconds. I did consider working on removing it entirely but less power while maneuvering slowly might be desirable. It's all trial and error and I can't imagine that I would be spinning at less than speed that while moving.

One of the main problems I have had is that I don't really trust the power on the display. It's always seemed excessively high compared to the limits that I've set. That is why I've ordered a Watt meter to see if it is accurate (well I've accidentally ordered two but that is another story). Hopefully the changes that I've made today will improve the accuracy. Once I've sorted out the pedal assist, I'll move on to fine tuning the power levels. When that's done I'll start testing it with a 36V battery.
 

Sparksandbangs

Pedelecer
Jan 16, 2025
188
56
The battery bars bounce up and down. It really needs some dampening sorting out. When I started this project I'd never done any coding in C. I've looked at each bit of code, tried to work out what it does and then tinkered with it to improve or fix it or replicated it it elsewhere to make new functions. While it's worked well writing some dampening code from scratch might be a step too far for me at the moment.

Might be an annoyance I just have to live with.
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
8,981
4,017
Telford
The battery bars bounce up and down. It really needs some dampening sorting out. When I started this project I'd never done any coding in C. I've looked at each bit of code, tried to work out what it does and then tinkered with it to improve or fix it or replicated it it elsewhere to make new functions. While it's worked well writing some dampening code from scratch might be a step too far for me at the moment.

Might be an annoyance I just have to live with.
I love the work you're doing. Anything that anybody does to add to the knowledge base should be congratulated.

Over the 15 years I've been riding electric bikes, I tried just about every motor, controller and system in an attempt to find the perfect ebike solution. For me, the standard KT controller is perfect. It gives me whatever power I want when I want it, while at the same time, it lets me pedal as hard or easy as I want in any circumstance. None have ever broken nor over-heated. I stuggle to understand why anybody would want to change anything. I encourage people to experiment and try different things until they find their own ebiking nirvana, but if you do that, don't be surprised to end up where I am.
 

Sparksandbangs

Pedelecer
Jan 16, 2025
188
56
For me, the standard KT controller is perfect. It gives me whatever power I want when I want it, while at the same time, it lets me pedal as hard or easy as I want in any circumstance. None have ever broken nor over-heated. I stuggle to understand why anybody would want to change anything. I encourage people to experiment and try different things until they find their own ebiking nirvana, but if you do that, don't be surprised to end up where I am.
Who knows? Maybe I'll convert you.
 

Sparksandbangs

Pedelecer
Jan 16, 2025
188
56
The new power calculation is interesting. It has dropped the displayed wattage massively. Is it right though?

I was turning up the power to get the same feeling that the KT gave so it is possible it is right. It is under what I would have expected though. Looks like I'll have do do some more research into phase currents and battery currents.
 

Advertisers