I just did a quick derivation (which I think is correct...) that might help clear up some of the confusion:
Assumptions:
- The PWM frequency is fast enough that the current waveform can be considered a straight line (should be true)
- Neglecting "small" voltage drops - wires, FET on resistance, etc.
A controller is functionally identical to a DC-DC buck converter. We can ignore the three phases and use a simple model:
View attachment 3
When the controller is on, the model is thus:
View attachment 2
Using Kirchoff's Voltage Law, we can derive the equation: Vbatt-Vbemf-Iavg*Rphase=Lphase*dI/dt, where Iavg is considered to be the average current over the PWM period (simpler this way).
So, during the on-state the current slope is given by: dI/dt=(Vbatt-Vbemf-Iavg*Rphase)/Lphase
When the controller is off and the diode is freewheeling:
View attachment 1
Using the same technique we derive the KVL equation: -(Vbemf+Vdiode+Iavg*Rphase)=Lphase*dI/dt
During the off-state the current slope is given by: dI/dt=-(Vbemf+Vdiode+Iavg*Rphase)/Lphase
The waveform looks like this:
Using the slopes found above, we can calculate the current ripple during on- or off-time by the duty cycle:
deltaI(on)=(Vbatt-Vbemf-Iavg*Rphase)/Lphase*D (where D is the duty cycle)
deltaI(off)=-(Vbemf+Vdiode+Iavg*Rphase)/Lphase*(1-D)
If the system is operating in steady-state at a constant average current, the magnitude of both deltaI terms must be equal:
(Vbatt-Vbemf-Iavg*Rphase)*D=(Vbemf+Vdiode+Iavg*Rphase)*(1-D)
Note that the inductance divides out. The actual PWM period is not important, so long as it's short enough that assumption #1 above applies, because the period would also divide out.
We do a little bit of algebra to get:
Iavg=(Vbatt*D-Vbemf-Vdiode*(1-D))/Rphase
Compared to the other terms, Vdiode is pretty small, so we can get rid of it and simplify to:
Iavg=(Vbatt*D-Vbemf)/Rphase
This equation agrees with a few things we know to be true:
- If the motor is at a dead stop (Vbemf=0) and the controller goes to WOT (D=1, no limiting), the current is Iavg=Vbatt/Rphase, the Ohmic limit
- If the throttle setting exactly equals the motor BEMF (Vbatt*D=Vbemf), no average current flows (in this simplified model)
- Similarly, at WOT (D=1), average current also drops to zero when BEMF reaches battery voltage (Vbatt=Vbemf)
I hope you're still with me, because now I'm going to point out how this helps the discussion!
- All other things being equal, decreasing the duty cycle decreases the average phase current flowing. This is why limiting works.
- All other things being equal, higher speeds -> higher BEMF -> lower phase current.
- If we assume limiting is in effect and phase current remains constant, higher speeds -> higher BEMF -> higher duty cycle D. This is why the throttle gradually gains more effective range as the bike speeds up when limiting is applied.
- Holding a constant throttle (D), if you go up a hill and speed starts to drop (Vbemf decreases), Iphase will increase assuming limiting is not in effect.