Lishui Controller Modification - Firmware Flash Project

Woosh

Trade Member
May 19, 2012
21,432
17,354
Southend on Sea
wooshbikes.co.uk
As far as I could make out from that figure, it is not as per my post.

Wondering whether KT pas level is actually controlling battery current rather than motor current, like @Sparksandbangs is trying to achieve. It would be interesting to see motor phase current along with battery current & speed for any specific pas level with KT controller.
I am confused too. It seems by the name of the jpg file, the plot that saneagle posted in #50 was made with the speedict kit, not a KT controller.
Also, unless I am mistaken, if your chosen assist level means that the controller will aim for example 5A battery current and you slow down, you don't need all the 5A, you'll need a lot less. What would the controller do?
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
9,152
4,084
Telford
As far as I could make out from that figure, it is not as per my post.

Wondering whether KT pas level is actually controlling battery current rather than motor current, like @Sparksandbangs is trying to achieve. It would be interesting to see motor phase current along with battery current & speed for any specific pas level with KT controller.
The recording device is basically a wattmeter with GPS or speed sensor and data logger. It fits between the battery and controller to record current, voltage watt-hours, speed, etc. The problem with phase current is that it's very nebulous as far as the rider is concerned, so there's no need to be interested in it. Most people can't even understand what it is. There have been countless discussions on ES about it causing everybody to end up scratching their heads. On the other hand, the rider can see and feel the direct link between battery current and torque so that's the only one I'm interested in. Phase current is just some theoretic calculation. It never has a real value because it's pulsing in alternating directions, sometimes square wave and sometimes pseudo-sinusoidal.
 

Sturmey

Esteemed Pedelecer
Jan 26, 2018
739
389
68
Ireland
I think its usual to use the battery current to control the motor power and this gives a more natural feeling. However, it can be useful to be given the option to be able to manually set a maximum limit on phase current as this sets a torque limit at low speeds. I could see where this may be useful to prevent the shredding of plastic gears or on say front hub conversions to prevent drop out breakage or reduce skidding etc. I think some controllers (Grin?) have this.
There is plenty of online discussion about this e.g.
 
Last edited:
  • Like
Reactions: Woosh

saneagle

Esteemed Pedelecer
Oct 10, 2010
9,152
4,084
Telford
I think its usual to use the battery current to control the motor power and this gives a more natural feeling. However, it can be useful to be given the option to be able to manually set a maximum limit on phase current as this sets a torque limit at low speeds. I could see where this may be useful to prevent the shredding of plastic gears or on say front hub conversions to prevent drop out breakage or reduce skidding etc. I think some controllers (Grin?) have this.
There is plenty of online discussion about this e.g.
That article is complete BS. He mentions twice that the controller increases the voltage by PWM. It doesn't. The battery wires go straight to the MOSFETS and from there straight to the phase wires. All the CPU can do is open and close the gate. No other components are involved.Secondly, the bit about current limiting is a complete red herring. All he's saying is that the back emf provides an additional limit at higher RPM. That's the same whether you're controlling phase current or battery current. It doesn't do anything special to protect gears. You can achieve the same by lowering the battery current. It's all pseudo academic shite. Battery current is simple, logical and understandable.

All that he says about different current limits at different RPM are completely invalidated by the actual graphs of current that I provided above. I'm guessing that all his BS is in relation to some super controller for high power applications, not our basic 250w ebike controllers.

And another thing. I have seen controllers with shunts on each phase, but they're pretty rare. Most controllers have one two or three shunts sharing the current where it comes into the controller. In that case, how can the controller measure the phase current accurately? My guess is that it doesn't. It simply uses a multiplying factor on the battery current. These are all the points discussed on ES years ago that never got bottomed out.
 
Last edited:

Woosh

Trade Member
May 19, 2012
21,432
17,354
Southend on Sea
wooshbikes.co.uk
That article is complete BS. He mentions twice that the controller increases the voltage by PWM.
I disagree. It explains just as well as you do the differences between phase current and battery current.

First mention:
Phase current is typically much higher than battery current because the controller uses PWM to boost voltage and current for a given torque.
Nothing wrong here. The voltage at the coils is not the same as at the battery.

Second mention:
Since controllers use PWM to boost motor voltage, the instantaneous current in the coils can exceed the battery current. In practice phase current is often set ~2–3× battery current.
Nothing wrong here either. That's how a fluorescent tube works.
 

Woosh

Trade Member
May 19, 2012
21,432
17,354
Southend on Sea
wooshbikes.co.uk
The voltage at the coils is not the same as at the battery.
Here is the explanation by ChatGPT:

For instantaneous coil voltage: v=Ri+L di/dt+ev

Note the crucial di/dt. PWM modulates that term.
 

afzal

Pedelecer
Mar 26, 2023
54
23
Kerala, India
if your chosen assist level means that the controller will aim for example 5A battery current and you slow down, you don't need all the 5A, you'll need a lot less. What would the controller do?
I have familiarity only with the internals of FOC controllers (phase current controlled). For those if set current is 5A & load is less, then phase current is less corresponding to the load, motor will at highest possible speed for that situation, an example being giving slight/high throttle with wheel in air, it draws very less current, motor would be running at highest possible speed.
 
  • Like
Reactions: Woosh

afzal

Pedelecer
Mar 26, 2023
54
23
Kerala, India
The problem with phase current is that it's very nebulous as far as the rider is concerned, so there's no need to be interested in it.

On the other hand, the rider can see and feel the direct link between battery current and torque so that's the only one I'm interested in. Phase current is just some theoretic calculation. It never has a real value because it's pulsing in alternating directions, sometimes square wave and sometimes pseudo-sinusoidal.
I disagree, motor assist felt by the rider is the motor torque, which in turn is proportional to phase current,

Motor torque = Kt x I

I - motor current
Kt - motor torque constant, which is related to motor Kv

I stand by everything mentioned in post #120, the only misunderstanding I had was that KT did motor phase current control. If it is controlling battery current, for a certain pas level it is not providing constant torque, rather torque is highest at low speed & torque gets reduced as the speed increases based on the expressions mentioned earlier.

[ Ignoring trapezoidal case to keep things simpler ]
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
9,152
4,084
Telford
I disagree, motor assist felt by the rider is the motor torque, which in turn is proportional to phase current,

Motor torque = Kt x I

I - motor current
Kt - motor torque constant, which is related to motor Kv

I stand by everything mentioned in post #120, the only misunderstanding I had was that KT did motor phase current control. If it is controlling battery current, for a certain pas level it is not providing constant torque, rather torque is highest at low speed & torque gets reduced as the speed increases based on the expressions mentioned earlier.

[ Ignoring trapezoidal case to keep things simpler ]
It doesn't matter what any theory says. Anybody, who has used a KT controller with current control can see that torque is flat across the speed range until the back emf becomes the controlling factor. Normal phase current control without other effects of field weakening or timing control can't change that effect of back emf.

Can someone please answer this question: How does a typical 250w Lishui controller measure phase current to control it?

I would love all you guys to be correct, and I hope that OP can make a better software solution than the standard KT software. If he does, I'll use it. So far, with all your theory, he hasn't achieved it yet. The standard Lishui and other cheap controllers' speed control is absolute shite. I'm pretty sure that Lishui has current control software. At least some other manufacturer does because it's on at least some Volt bikes that don't have KT controllers.
 
Last edited:

Woosh

Trade Member
May 19, 2012
21,432
17,354
Southend on Sea
wooshbikes.co.uk
How does a typical 250w Lishui controller measure phase current to control it?
like most controllers, the current is measured by the voltage drop across the low side shunt resistors.
It doesn't matter what any theory says.
OK but I don't believe you think that normally.
Anybody, who has used a KT controller with current control can see that torque is flat across the speed range until the back emf becomes the controlling factor.
That is pretty much the case with all the controllers I use. The main difference is speed controllers tend to be jerkier, especially around starting off and assist level change.
I'm pretty sure that Lishui has current control software. At least some other manufacturer does because it's on at least some Volt bikes that don't have KT controllers.
Lishui gives to the customers what they want. Their default algorithm is a mixture, works well enough to keep Lishui at the top of the food chain beside Bafang and Tongsheng. KT is really for enthusiasts.
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
9,152
4,084
Telford
like most controllers, the current is measured by the voltage drop across the low side shunt resistors.
That would be excellent if they had such shunts, but the only shunts I've noticed are the ones between the battery and MOSFETs to measure the battery current. Have yours got them on the separate phases?
 

Advertisers