Controller operation modes

Slightlypedantic

Pedelecer
Aug 25, 2022
75
10
East Sussex
Hi All,

Apologies for long post. I have been trying to understand how controllers work, or at least the key principles. I've picked up some useful info from other threads, and especially posts by NealH and vfr400 (=Honda m/cycle?). Thanks to them and everyone else that has contributed.

I'd like to summarise my current understanding. Perhaps those with better knowledge can say if I'm right or wrong.

Ohm's law is always fundamental: V/R=I where V=volts, R =resistance (ohms) and I=current (amps).
Voltage drives current, against resistance. Resistance R is fixed in any motor system, so, for example, double the voltage gives double the current, half the voltage gives half the current. 48V is 33% more than 36V, thus giving 33% more current and hence 33% more torque.

The applied voltage drives the current - not the other way around.

The voltage comes from the battery. It is reduced to a greater or lesser extent by the controller according to the "power" (? - see below) level selected, before being fed to the motor.

The other fundamentals are:
Torque is rotational force measured in Newtons (force) x Radius (metres), i.e. "N.m" (the "." means "x"). For example:
- 50 Newtons force at 1 m radius = 50 x 1 = 50 N.m
- 25 Newtons force at 2 m radius = 25 x 2 = 50 N.m
- 100 Newtons force at 0.5 m radius = 100 x 0.5 = 50 N.m
- 50 Newtons force at 0.5 m radius = 50 x 0.5 = 25 N.m
- And so on.

Torque is not power. They are different things. Power is the rate at which work is being done:
- Torque x radial speed = mechanical power in watts.
- Amps x volts = electrical power in watts.
These two would be equal except for efficiency losses which result in heat being given off, so that the mechanical power delivered is always less than the electrical power consumed. (Efficiency varies, maximum c.80%?).

The magnetic force generated by current flowing in the motor windings is directly proportional to the current and is nothing to do with the voltage. Because of this, torque is always proportional to the current flowing. More current gives more torque.

The controller mosfets switch on and off very rapidly to give a percentage of "on" time and a percentage of "off" time, so that the average percentage of "on" time represents the proportion of full battery voltage that is passed on the the motor. For example, assuming a nominal 36V battery, 10% on/90% off gives 3.6 volts, 50% on/50% off gives 18 volts and 100% on/ 0% off gives 36V. (I'm ignoring voltage sag, heating effects, etc to keep things simple.)


In a cheaper controller, the controller mosfet switching is instructed by the "power" level selected by the rider. So, it's not actually a "power" level at all, it's a voltage level. Hence "voltage control". I assume the controller matches its output voltage to the reference voltage provided by the display's "power" (i.e. voltage) level setting.

This means the motor will run up to the fastest speed it can for the "power" level (i.e. voltage) selected. The result is relatively strong torque as the motor starts at low speed, reducing as the speed picks up until an equilibrium is reached - effectively a speed limit. The actual speed will vary depending upon rider/bike weight, gradient, wind and all the rest.

Higher "power" (i.e. voltage) levels give stronger initial torque, tailing off at a higher speed. Presumably this is why some people refer to a "speed controller"?

The reason the torque reduces as the speed increases is due to "back emf" (electro-motive force). This is the reverse voltage produced due to the motor also acting as a generator. The back emf voltage increases as the motor spins progressively faster, cancelling out an increasing proportion of the voltage applied via the controller. So, with a "voltage" controller we feel an initial surge of torque that tails off as speed increases.

The "speed" of a motor is the no-load speed (bike running with the wheel off the ground), where the applied voltage is nearly matched by the back emf. They are never quite equal because friction still has to be overcome. (If they were equal we would have invented perpetual motion as there would be no energy loss in the system!) The actual no load speed depends on the design of the motor and the voltage applied.



A more sophisticated controller might have any of the following features in addition to the simplistic description above:

1. The "power" level (voltage) selected could be ramped up from a lower initial value as the bike starts moving, to soften the initial kick of torque and smooth out some of the variation of torque with speed.

2. Information from the motor/wheel speed sensor could be used to vary the controller voltage to maintain a constant maximum speed for each setting. "Speed" controller? I don't know if any controllers actually use this.

3. The motor current could be monitored by the controller, which could vary the voltage applied to the motor so as to maintain a more constant current and hence torque over a wider speed range, thus giving a more consistent level of assistance. In this case the "power" level selected would represent a current level not a voltage level. Hence the term "current controller"?

4. Clever things could no doubt be done with more sophisticated software.


So, have I got this right? Any comments would be appreciated. If I've been unclear anywhere, please do say and I'll try to correct it.

Thanks in advance. Please don't be shy to tell me if I'm wrong - just explain why!

Cheers.
 
Last edited:

Sturmey

Esteemed Pedelecer
Jan 26, 2018
641
351
68
Ireland
.......... Resistance R is fixed in any motor system..........
Ohms law really only applies to linear resistances. There is a problem when you apply it to a 'system' which doesent have a fixed resistance as such . But you can apply it to say the components of a system if they are linear . Anyhow, when you double the voltage to a motor, you also double its potential speed. Now, a lot depends on the linearity of the motors load. In the case of a bike, the load is not linear but rises sharply with speed as the resistance to motion due to drag/air resistance increases by the cubed of the speed.
That's why, with a dynamic system, you need something like the motor simulator below that takes account of all the factors (including the load) as for example below.
Also note that battery amps is not the same as motor amps and the controller switching, in conjunction with the motor inductance, can multiply/increase the motor current when it steps down the voltage.

 
Last edited:
  • Agree
Reactions: Woosh

Slightlypedantic

Pedelecer
Aug 25, 2022
75
10
East Sussex
Ohms law really only applies to linear resistances. There is a problem when you apply it to a 'system' which doesent have a fixed resistance as such . But you can apply it to say the components of a system if they are linear . Anyhow, when you double the voltage to a motor, you also double its potential speed. Now, a lot depends on the linearity of the motors load. In the case of a bike, the load is not linear but rises sharply with speed as the resistance to motion due to drag/air resistance increases by the cubed of the speed.
That's why, with a dynamic system, you need something like the motor simulator below that takes account of all the factors (including the load) as for example below.
Also note that battery amps is not the same as motor amps and the controller switching, in conjunction with the motor inductance, can multiply/increase the motor current when it steps down the voltage.

 

Slightlypedantic

Pedelecer
Aug 25, 2022
75
10
East Sussex
Thanks Sturmey, you know much more than me! I was relying on what I could remember from "A" level physics from over 50 years ago and had stupidly forgotten about inductance. I doubt that's all I got wrong...


In terms of how different types of controller work, I'm curious to know what the controller is actually changing as I ramp the assistance level up and down, and how that might be influenced by software.

The cheaper Lishui type seems to top out at a certain speed (subject to legal limit) according to the assistance level selected, although since that speed varies according to gradient, wind, etc it's obviously not controlling speed as such but more likely voltage, or current, or power level perhaps. Am I on the right lines here?

What do more sophisticated controllers such as KT do differently?
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
6,814
3,152
Telford
I'd like to summarise my current understanding. Perhaps those with better knowledge can say if I'm right or wrong.

Ohm's law is always fundamental: V/R=I where V=volts, R =resistance (ohms) and I=current (amps).
Voltage drives current, against resistance. Resistance R is fixed in any motor system, so, for example, double the voltage gives double the current, half the voltage gives half the current. 48V is 33% more than 36V, thus giving 33% more current and hence 33% more torque.

The applied voltage drives the current - not the other way around.

The voltage comes from the battery. It is reduced to a greater or lesser extent by the controller according to the "power" (? - see below) level selected, before being fed to the motor.

The other fundamentals are:
Torque is rotational force measured in Newtons (force) x Radius (metres), i.e. "N.m" (the "." means "x"). For example:
- 50 Newtons force at 1 m radius = 50 x 1 = 50 N.m
- 25 Newtons force at 2 m radius = 25 x 2 = 50 N.m
- 100 Newtons force at 0.5 m radius = 100 x 0.5 = 50 N.m
- 50 Newtons force at 0.5 m radius = 50 x 0.5 = 25 N.m
- And so on.

Torque is not power. They are different things. Power is the rate at which work is being done:
- Torque x radial speed = mechanical power in watts.
- Amps x volts = electrical power in watts.
These two would be equal except for efficiency losses which result in heat being given off, so that the mechanical power delivered is always less than the electrical power consumed. (Efficiency varies, maximum c.80%?).

The magnetic force generated by current flowing in the motor windings is directly proportional to the current and is nothing to do with the voltage. Because of this, torque is always proportional to the current flowing. More current gives more torque.

All correct so far. It is actually a little more complicated than that, but what you wrote is effectively correct and good enough to do calculations and estimates.

The controller mosfets switch on and off very rapidly to give a percentage of "on" time and a percentage of "off" time, so that the average percentage of "on" time represents the proportion of full battery voltage that is passed on the the motor. For example, assuming a nominal 36V battery, 10% on/90% off gives 3.6 volts, 50% on/50% off gives 18 volts and 100% on/ 0% off gives 36V. (I'm ignoring voltage sag, heating effects, etc to keep things simple.)

No. The controller only uses algorithms to switch the mosfets on and off at high and varying frequencies. Some people argue that 36v on half the time is the same as 18v, but it isn't. It's 36v for half the time. That's important for how it's affected by the back emf. Say back emf of 18v applied to 36v on half the time. The result would be 18v for half the time to give half as much current as without it. If a back emf of 18v was applied to a voltage of 18v, you'd get zero volts and no current.

In a cheaper controller, the controller mosfet switching is instructed by the "power" level selected by the rider. So, it's not actually a "power" level at all, it's a voltage level. Hence "voltage control". I assume the controller matches its output voltage to the reference voltage provided by the display's "power" (i.e. voltage) level setting.

This means the motor will run up to the fastest speed it can for the "power" level (i.e. voltage) selected. The result is relatively strong torque as the motor starts at low speed, reducing as the speed picks up until an equilibrium is reached - effectively a speed limit. The actual speed will vary depending upon rider/bike weight, gradient, wind and all the rest.

Higher "power" (i.e. voltage) levels give stronger initial torque, tailing off at a higher speed. Presumably this is why some people refer to a "speed controller
"?

No. There are two basic types of controller: Speed control limits the speed in each LCD/LED control panel setting; current control limits the current in each setting. Each type can have a soft start that ramps up the current at startup. They tend to be the more expensive ones. Most controllers have a flat current that stays constant until the back emf reduces the effective voltage enough to reduce the current. Obviously, the current controller has a different flat current for each LCD level.

The reason the torque reduces as the speed increases is due to "back emf" (electro-motive force). This is the reverse voltage produced due to the motor also acting as a generator. The back emf voltage increases as the motor spins progressively faster, cancelling out an increasing proportion of the voltage applied via the controller. So, with a "voltage" controller we feel an initial surge of torque that tails off as speed increases.

The "speed" of a motor is the no-load speed (bike running with the wheel off the ground), where the applied voltage is nearly matched by the back emf. They are never quite equal because friction still has to be overcome. (If they were equal we would have invented perpetual motion as there would be no energy loss in the system!) The actual no load speed depends on the design of the motor and the voltage applied.


Correct, but for all controllers. there is no "voltage" controller.


A more sophisticated controller might have any of the following features in addition to the simplistic description above:

1. The "power" level (voltage) selected could be ramped up from a lower initial value as the bike starts moving, to soften the initial kick of torque and smooth out some of the variation of torque with speed.

Yes. some have that, regardless of type.

2. Information from the motor/wheel speed sensor could be used to vary the controller voltage to maintain a constant maximum speed for each setting. "Speed" controller? I don't know if any controllers actually use this.
Yes, all controllers with speed control work like that. They can also get the speed from hall sensors or back emf for sensorless ones. No, you can't vary controller voltage. They only control current.

3. The motor current could be monitored by the controller, which could vary the voltage applied to the motor so as to maintain a more constant current and hence torque over a wider speed range, thus giving a more consistent level of assistance. In this case the "power" level selected would represent a current level not a voltage level. Hence the term "current controller"?
No. Controllers control current. Current controllers do exactly that.

4. Clever things could no doubt be done with more sophisticated software.
Generally, that's most controllers that aren't Chinese.

Finally, yours is a speed controller. LiShui normally have a ramp down in current as you approach the max speed in each level so that you don't feel a sudden cut-off. That ramp down is just an algorithm in the CPU. Cheaper ones don't have that.
 
  • Like
Reactions: danielrlee

Sturmey

Esteemed Pedelecer
Jan 26, 2018
641
351
68
Ireland
In terms of how different types of controller work, I'm curious to know what the controller is actually changing as I ramp the assistance level up and down, and how that might be influenced by software......
What do more sophisticated controllers such as KT do differently?
I have attached a training document below that explains a lot about the inner workings of a basic controller. In page 8, it explains how a reference voltage can alter the pulse width ( which controls the current as saneagle explained above). However, it does not explain how this reference voltage is generated and perhaps this is what your interested in.
At a simple level, this reference voltage can come from a throttle. However, usually some type of 'comparator' is implemented. One way this can be done is to get a reference voltage sourced from either the motor (back emf) voltage (e.g speed throttle signal) or use the the main shunt that measures battery current (amp throttle signal) or in some controllers, a shunt is fitted on the phase wires which can give a (torque throttle signal). As a note, torque can only be directly measured at the phase wires or its circuits. (It may be possible to estimate it using the other signals). I am not sure exactly how KT controllers measure for their 'torque simulation'. It seems to me that they just use the main shunt battery current but I am not sure and I know nothing about Lishui controllers. Anyhow, the reference signals is compared to the selected riders input (e.g. Throttle, Pas level selection, torque/cadence sensor etc) and the output is used to adjust the pulse width which controls the motor current. (Basically a feedback loop type of mechanism). On modern controllers, this is all done digitally, all analogue signals are converted to digital values and can be manipulated in software).
Another discussion can be had about whats the best way to implement control of the motor from the users perspective. I am a bit of an easy rider, I like to pedal easily so my personal favorite is the KT torque simulation arrangement, setting the pas level to 3 or 4 out of 5, and using the throttle for occasional bursts of extra power.
 

Attachments

Last edited:

Woosh

Trade Member
May 19, 2012
20,368
16,870
Southend on Sea
wooshbikes.co.uk
The cheaper Lishui type seems to top out at a certain speed (subject to legal limit) according to the assistance level selected, although since that speed varies according to gradient, wind, etc it's obviously not controlling speed as such but more likely voltage, or current, or power level perhaps. Am I on the right lines here?
subject to programming. I use Lishui controllers since 2011. They are self learning. That means you don't have to set the motor's number of poles, sensored or sensorless etc which is a big plus for kits. They can be programmed for speed control, current control or a mixture. Current control replaces speed steps by current steps. Current controls torque hence acceleration. Current control is particularly attractive for those with physical impairment, giving a very smooth start from standstill.
 

Nealh

Esteemed Pedelecer
Aug 7, 2014
20,917
8,533
61
West Sx RH
I would opt for current control every day over speed control whether it is a current controller hub bike or Torque sensor mid drive type bike. The ride power level is determined by the rider and not the bike system as in a speed controller.
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
6,814
3,152
Telford
I have attached a training document below that explains a lot about the inner workings of a basic controller. In page 8, it explains how a reference voltage can alter the pulse width ( which controls the current as saneagle explained above). However, it does not explain how this reference voltage is generated and perhaps this is what your interested in.
At a simple level, this reference voltage can come from a throttle. However, usually some type of 'comparator' is implemented. One way this can be done is to get a reference voltage sourced from either the motor (back emf) voltage (e.g speed throttle signal) or use the the main shunt that measures battery current (amp throttle signal) or in some controllers, a shunt is fitted on the phase wires which can give a (torque throttle signal). As a note, torque can only be directly measured at the phase wires or its circuits. (It may be possible to estimate it using the other signals). I am not sure exactly how KT controllers measure for their 'torque simulation'. It seems to me that they just use the main shunt battery current but I am not sure and I know nothing about Lishui controllers. Anyhow, the reference signals is compared to the selected riders input (e.g. Throttle, Pas level selection, torque/cadence sensor etc) and the output is used to adjust the pulse width which controls the motor current. (Basically a feedback loop type of mechanism). On modern controllers, this is all done digitally, all analogue signals are converted to digital values and can be manipulated in software).
Another discussion can be had about whats the best way to implement control of the motor from the users perspective. I am a bit of an easy rider, I like to pedal easily so my personal favorite is the KT torque simulation arrangement, setting the pas level to 3 or 4 out of 5, and using the throttle for occasional bursts of extra power.
I think what's in that document is all very old stuff and not relevant to ebike controllers. All modern controllers are digital and have microprocessors in them, The PWM is done by algorithms in the CPU software. That's how they can adjust the pulse width to follow a sine wave in sinewave controllers.

"Torque simulation" is just current control. When KT made their first current control controllers, the alternatives were speed control ones with no soft start. The low current on the lower levels gave a much softer start which was compared with bikes that had torque multiplication systems and torque sensors, so they gave it the name "Torque Simulation".

Most controllers give current feedback to the CPU by measuring the voltage drop across a shunt. It's basically battery current. Some can get the feedback by measuring the voltage drop across mosfets. I've heard it said that some controllers can limit the phase current separately from the total current by using the mosfet voltage drop, but I've got a feeling that that's a misunderstanding, as they are both related to each other. I've seen the programming settings, but I think the result would be whichever is the higher/lower setting takes precedence.

In simple terms, there is a CPU that takes inputs. According to the input signals, the software algorithms calculate the pattern for switching on and off the mosfets.. That pattern manifests itself in six 5v digital outputs. They go to 6 transistors that switches 14v in the same pattern to switch the mosfets on and off.
 
Last edited:

Slightlypedantic

Pedelecer
Aug 25, 2022
75
10
East Sussex
Thanks for all the useful posts.

So, modern controllers are much more sophisticated than I thought. With suitable software/algorithms a high degree of control flexibility can be achieved, probably way above my understanding.

Whilst modern control methods may be beyond the scope of Sturmey's controller training document, in fairness he does say that it describes a "basic controller". I found his document very useful as it describes how the mosfet inverter circuit actually drives a brushless motor in the first place.

So, is my understanding of how the mosfets and motor work correct, at least at a simple level? I'm ignoring Pulse Width Modulation (PWM) control for the moment. This it, FWIW:

With a simple theoretical motor comprising three coils (stator) and one rotating magnet (rotor), the coils are equally spaced at 120 degrees.
(Real world motors presumably have more coils, their number divisible by three so that every third coil is phased the same and driven by the same mosfet sequence. Presumably the number of rotor magnets would reflect the number of coils, say one pole per three coils?)

As any rotor magnet pole (say north) is just leaving a coil, any electro-magnetic force (emf) from current through that coil is predominantly radial, whereas for the next coil ahead the emf is predominantly tangential. As the rotor pole moves further towards the next coil, the emf with respect to the coil it is leaving becomes less radial and more tangential, whereas for the coil it is approaching the reverse happens.

If the emf is predominantly radial then there is no point in having the coil switched on as it does not assist rotary motion significantly. As the pole passes the coil, the emf would be completely radial and this is the "neutral point".

The inverter mosfets switch off for a period either side of the neutral point since current then flowing would be largely wasted and would mainly generate waste heat. The key to this is timing, taken from Hall sensors or back emf detection to ascertain the neutral point.

After the rotor pole has passed the next coil, the mosfets switch on again but with polarity reversed, such that the coil no longer attracts the pole towards itself, but repels it on towards the next pole, where the process is repeated. The diagrams in Sturmey's document show all three phases working in sequence with a dead period near the neutral point and polarity reversing either side of a coil.

Three phases means three mosfets and the ability to reverse polarity means two sets of three, i.e. six mosfets in total. Does the ability to reverse polarity give rise to the term "inverter"?

The simple square wave profile, with the full voltage being either on or off, implies a lack of efficiency since full current is still being delivered near the cut-off points where emf direction has a significant radial component (not useful) and much less tangential (useful).
(In a sine wave controller, PWM control ensures the current applied follows a sine wave pattern that more closely matches the useful tangential component and is therefore less wasteful of power. This should cause the motor to run cooler and more smoothly, thus giving better range.)

Varying the ratio of mosfet on to off time (no PWM) would give a basic form of control, but without the refinement we are used to today.


Getting back to CPU control and Saneagle's point, overlaying the basic switching with high frequency PWM pulses enables a wide range of control by means of software programming that controls/varies the pulse widths. With full voltage being applied throughout the "on" periods, current is driven effectively against the back emf. So, to achieve (for example) a soft start, all that is needed is to modify the pulse widths according to an algorithm such that the current ramps up progressively until it matches whatever is required for the power setting selected.

For a current controller, the controller monitors motor current, which it infers from the voltage across a battery shunt resistor or some other method. The controller can then adjust the pulse widths such that the current remains steady and matches, say, a preset value according to the controller setting. This means that a steady torque can be applied over a wide range of cadences. A simple algorithm using current and cadence data could be used to maintain a constant power level instead, which might be more useful. More complex programming could give us a combination, but that's starting to get away from my simplistic attempt to understanding the basics.

For a speed controller, I'm a bit less clear. From the feel of the system, there seem to be three components: soft start, strong torque, and then tailing off to a plateau level. As one increases the power setting, torque comes back in and then tails off again but at a higher speed. Starting off in a higher setting gives a big kick of torque. So far so good? But what puzzles me is that the speed for each power setting varies according to load. If I pedal along at, say, 10 mph on the level in power level one, why do I have to up the power level when I come to a moderate gradient, and yet again if it's steeper? It feels as though the power or torque is being controlled, not the speed. If the speed was being controlled surely the current and hence torque would be varied to maintain that speed? Can someone please enlighten me?

It would also be great if someone could tell me if my assessment above is broadly correct, or not. If I am talking rubbish, do please let me know!

Thanks to all contributing to this thread.
 

Woosh

Trade Member
May 19, 2012
20,368
16,870
Southend on Sea
wooshbikes.co.uk
FOC is the acronym for field oriented control.
FOC is a control technique. It uses a fairly powerful CPU to shape the current of a BLDC motor when it rotates into sine wave, resulting in lower noise and smoother operation. Older generation of controllers used less powerful chips and the shape of their phase currents are trapezoids instead of sinusoids.
The image below illustrates the shape of the current envelope. The phase currents are delivered in sub millisecond pulses (PWM, pulse width modulation). Think of FM radio for an analogy.





oscilloscope trace of a sine wave:



shaping the current envelope is difficult becase the electromotive force varies with a number of variables:



Basic parameter symbols
icurrent
kcoupling factor of respective winding
linductance
rresistance
ttime
Ttorque
uvoltage
\psi
flux linkage
\tau
normalized time
\tau
time constant (T.C.) with subscript
\omega
angular velocity
���
{\displaystyle \sigma l_{s}}
total leakage inductance
 
Last edited:

saneagle

Esteemed Pedelecer
Oct 10, 2010
6,814
3,152
Telford
Thanks for all the useful posts.

So, modern controllers are much more sophisticated than I thought. With suitable software/algorithms a high degree of control flexibility can be achieved, probably way above my understanding.

Whilst modern control methods may be beyond the scope of Sturmey's controller training document, in fairness he does say that it describes a "basic controller". I found his document very useful as it describes how the mosfet inverter circuit actually drives a brushless motor in the first place.

So, is my understanding of how the mosfets and motor work correct, at least at a simple level? I'm ignoring Pulse Width Modulation (PWM) control for the moment. This it, FWIW:

With a simple theoretical motor comprising three coils (stator) and one rotating magnet (rotor), the coils are equally spaced at 120 degrees.
(Real world motors presumably have more coils, their number divisible by three so that every third coil is phased the same and driven by the same mosfet sequence. Presumably the number of rotor magnets would reflect the number of coils, say one pole per three coils?)

As any rotor magnet pole (say north) is just leaving a coil, any electro-magnetic force (emf) from current through that coil is predominantly radial, whereas for the next coil ahead the emf is predominantly tangential. As the rotor pole moves further towards the next coil, the emf with respect to the coil it is leaving becomes less radial and more tangential, whereas for the coil it is approaching the reverse happens.

If the emf is predominantly radial then there is no point in having the coil switched on as it does not assist rotary motion significantly. As the pole passes the coil, the emf would be completely radial and this is the "neutral point".

The inverter mosfets switch off for a period either side of the neutral point since current then flowing would be largely wasted and would mainly generate waste heat. The key to this is timing, taken from Hall sensors or back emf detection to ascertain the neutral point.

After the rotor pole has passed the next coil, the mosfets switch on again but with polarity reversed, such that the coil no longer attracts the pole towards itself, but repels it on towards the next pole, where the process is repeated. The diagrams in Sturmey's document show all three phases working in sequence with a dead period near the neutral point and polarity reversing either side of a coil.

Three phases means three mosfets and the ability to reverse polarity means two sets of three, i.e. six mosfets in total. Does the ability to reverse polarity give rise to the term "inverter"?

The simple square wave profile, with the full voltage being either on or off, implies a lack of efficiency since full current is still being delivered near the cut-off points where emf direction has a significant radial component (not useful) and much less tangential (useful).
(In a sine wave controller, PWM control ensures the current applied follows a sine wave pattern that more closely matches the useful tangential component and is therefore less wasteful of power. This should cause the motor to run cooler and more smoothly, thus giving better range.)

Varying the ratio of mosfet on to off time (no PWM) would give a basic form of control, but without the refinement we are used to today.


Getting back to CPU control and Saneagle's point, overlaying the basic switching with high frequency PWM pulses enables a wide range of control by means of software programming that controls/varies the pulse widths. With full voltage being applied throughout the "on" periods, current is driven effectively against the back emf. So, to achieve (for example) a soft start, all that is needed is to modify the pulse widths according to an algorithm such that the current ramps up progressively until it matches whatever is required for the power setting selected.

For a current controller, the controller monitors motor current, which it infers from the voltage across a battery shunt resistor or some other method. The controller can then adjust the pulse widths such that the current remains steady and matches, say, a preset value according to the controller setting. This means that a steady torque can be applied over a wide range of cadences. A simple algorithm using current and cadence data could be used to maintain a constant power level instead, which might be more useful. More complex programming could give us a combination, but that's starting to get away from my simplistic attempt to understanding the basics.

For a speed controller, I'm a bit less clear. From the feel of the system, there seem to be three components: soft start, strong torque, and then tailing off to a plateau level. As one increases the power setting, torque comes back in and then tails off again but at a higher speed. Starting off in a higher setting gives a big kick of torque. So far so good? But what puzzles me is that the speed for each power setting varies according to load. If I pedal along at, say, 10 mph on the level in power level one, why do I have to up the power level when I come to a moderate gradient, and yet again if it's steeper? It feels as though the power or torque is being controlled, not the speed. If the speed was being controlled surely the current and hence torque would be varied to maintain that speed? Can someone please enlighten me?

It would also be great if someone could tell me if my assessment above is broadly correct, or not. If I am talking rubbish, do please let me know!

Thanks to all contributing to this thread.
For a speed controller, the algorithms are some thing like the amount of current (torque) given depends on the difference between your actual speed and the target maximum speed in each selected level. Something like
current = d( Tl-S) +c
where c is a constant amount, d is a simple multiplier, S is actual speed Tl is the target speed for the level selected. c is small compared to the other component. When your speed approaches the target speed, current decreases, and when there's a big difference, there's high current. That algorithm is nested in others that limit the maximum current to say 15A and the top speed to say 15 mph. You can see from that formula that increasing the level (target speed), the current increases.
 

Sturmey

Esteemed Pedelecer
Jan 26, 2018
641
351
68
Ireland
........The cheaper Lishui type seems..........
The German forum has a long and detailed discussion (94 pages) on the workings and possible customization of some of these controllers. ( with Google Chrome, right click and translate in English). To clarify another point, these controllers seem to fit the shunts on the 3 motor phases as discussed and shown in photo below, so a more accurate and better measured motor torque current control is possible.

50220
 
  • Like
Reactions: Woosh

Slightlypedantic

Pedelecer
Aug 25, 2022
75
10
East Sussex
Saneagle's equation (below) seems to explain how the controller responds and fits well with the motor characteristics noticed when changing power levels.

Current = d(Tl-S) + c

Where:
  • d is a simple multiplier
  • S is actual speed
  • Tl is the target speed
  • c is a constant amount (c is small compared to the other component)
The controller could adjust d and c, as well as Tl, in response to a change in power level by the rider.

At lower power level settings multiplier d could be set to lower values, so current and torque would also be lower. This would give more docile characteristics for lower speeds and would also explain why the target speed cannot be achieved in lower power levels when encountering hills.

I suspect that as progressively higher power levels are selected d increases as well as Tl, allowing higher current to produce stronger torque. This would allow the motor to overcome higher loads (e.g. wind resistance, gradient) and/or achieve a higher target speed.

Current and torque reduce as actual speed S approaches target speed Tl, producing the smooth tailing off that is noticed. Is the purpose of c to modify the tailing off characteristic by providing a little extra current so that the target speed is achieved more quickly? Perhaps c increases with higher power levels? Presumably c is relatively small so that it can't cause actual speed to overshoot significantly above the target speed.
 
Last edited:

Slightlypedantic

Pedelecer
Aug 25, 2022
75
10
East Sussex
Now wondering if I've jumped to the wrong conclusion...

If, for example, "power" level 3 gave Tl = 10 mph and level 5 gave TL = 15 mph, then, at 5 mph, PWM pulse width, current and torque would be double in level 5 compared to level 3. So, no need for d to change with power level?

Perhaps d is just a constant to make the units work? (Saneagle called it a "simple multiplier".) For example, a different value would be used for kph and mph so that the same speed gave the same current regardless of the speed units?

Could someone put me straight on this please!

Thanks.
 

Sturmey

Esteemed Pedelecer
Jan 26, 2018
641
351
68
Ireland
I cant tell you anything about the formulae. But below is a simplified flow chart of how this function can typically be implemented in software. The PWM duty cycle value is adjusted (incrementally) depending on whether the current (as in present) motor speed is either greater or less than the user selected speed (handlebar).
PS. I have added the word 'incrementally' as this often best describes how this is done. To take your example, if you decide to increase speed from 10 to 15 mph, your 'user set speed' will increase and be greater than the 'current speed' causing the software to 'increase speed' and increase the pwm duty cycle. The software keeps looping and keeps incrementing/increasing the duty cycle (pulse width) in steps until the motor speed matches the selected speed (or full power) (speed control).
50236
 
Last edited:
  • Like
Reactions: Woosh

Woosh

Trade Member
May 19, 2012
20,368
16,870
Southend on Sea
wooshbikes.co.uk
Now wondering if I've jumped to the wrong conclusion...
possibly. Saneagle said 'something like this', so don't take his formulae too rigidly.
The controller is programmable, its algorithm varies with the manufacturer and model. In the main, if you are climbing a steep gradient in speed control mode, each time you increase the assist level, you'll get immediately an extra push that shows that the 'd' factor in his formulae increases with assist level regardless of your current speed and target speed. With current control, the transition up is smooth, there is no jerking. The throttle is the perfect example of current control.