Hi. First ebike conversion.

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,986
Basildon
I'm not sure that Mtr Amps (motor winding phase currents) represent the peak currents, perhaps they represent average current in some way.

Here's something that's been puzzling me for a while - if rpm is low so that the controller is current limiting then what actually limits the current? The FETs switch the field coils between the 0v and 36/48V so does the controller turn them off as soon as it detects the current limit through the shunt? What then about the inrush currents?

Your description in term of average energy being applied makes a lot of sense, and is the way I approach things, but I'm struggling to see how the control electronics work when they are current limiting.
It's very simple. The battery wires are connected directly to each motor phase in both directions. The only thing stopping current from flowing is the 6 mosfets (one for each direction in each of three phases), which are basically electronic switches. The controller CPU opens the mosfets in short pulses to let current through. The sum of the currents coming out of the controller must be equal to the current going into it, so the average current in each phase wire must be 1/3 of the current in the battery wires. You have inductors and capacitors that can store energy and release it, so within each pulse, all sorts of weird things happen, but you can't create any extra energy.

The controller controls the current by measuring the battery current through the shunt, then limiting it through each of the 6 mosfets with the PWM duty cycle. When I talk about pulses, there are two types. When you look at how three phase motors work, we talk about timed pulses to kick each phase around to move the magnets from one pole to the next, but each pulse is made up of a subset of much smaller PWM pulses, and now that we have sine-wave controllers, the PWM for each pulse varies throughout the pulse.

 
Last edited:
  • Like
Reactions: danielrlee
D

Deleted member 25121

Guest
It's very simple. The battery wires are connected directly to each motor phase in both directions. The only thing stopping current from flowing is the 6 mosfets (one for each direction in each of three phases), which are basically electronic switches. The controller CPU opens the mosfets in short pulses to let current through. The sum of the currents coming out of the controller must be equal to the current going into it, so the average current in each phase wire must be 1/3 of the current in the battery wires. You have inductors and capacitors that can store energy and release it, so within each pulse, all sorts of weird things happen, but you can't create any extra energy.

The controller controls the current by measuring the battery current through the shunt, then limiting it through each of the 6 mosfets with the PWM duty cycle. When I talk about pulses, there are two types. When you look at how three phase motors work, we talk about timed pulses to kick each phase around to move the magnets from one pole to the next, but each pulse is made up of a subset of much smaller PWM pulses, and now that we have sine-wave controllers, the PWM for each pulse varies throughout the pulse.

Here's the schematics for a Chinese S-KU63 controller:
33402

The FETs at the top right switch the 3 phase wires between 36V and 0v, the latter via a shunt for current sensing.
I can't see how the currents can be limited unless the FETs are only partially turned on but in that case they'd get very hot and there's no feedback around them to control their ON resistance.
 

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,986
Basildon
Here's the schematics for a Chinese S-KU63 controller:
View attachment 33402

The FETs at the top right switch the 3 phase wires between 36V and 0v, the latter via a shunt for current sensing.
I can't see how the currents can be limited unless the FETs are only partially turned on but in that case they'd get very hot and there's no feedback around them to control their ON resistance.
The current is controlled by pulsing the mosfets at very high frequency. The longer the open pulse compared with the closed pulse, the more current comes through. It's called pulse width modulation (PWM), which is a common way to control DC current.
They often talk about the average voltage output because the voltage is switched on and off, but I prefer to see it as the current being switched on and off with the voltage staying constant. That makes it easier to understand in relation to back emf.
 
D

Deleted member 25121

Guest
The current is controlled by pulsing the mosfets at very high frequency. The longer the open pulse compared with the closed pulse, the more current comes through.
Yes, I'm familiar with PWM and that must be the the way the controller limits the power applied to the motor. The longer the open pulse compared with the closed pulse, the more power comes through where power is proportional to volts * amps * duty cycle of the pulses.

The controller can measure the current, via the shunt, but it has no way of controlling it other than turning it on and off.

So when a controller is set to give a limit of say 10A, what does that really mean? It's not the peak current so is it the average current from the battery?

I think I've answered my own question, it must be average current drawn from the battery.

So when a controller is set to give a limit of say 10A the battery must be able to provide an average of 10A and a peak current of much higher. If there were very large capacitors in the controller they could provide the peak current but I don't believe there are any.

Is this right do you think?
 

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,986
Basildon
It measures the incoming current through the shunt. It all goes to the motor, so it's outgoing current too. It adjusts the duty cycle up and down when it sees anything other than 10A in the situation you describe. The measurement is the voltage drop across the shunt. That voltage goes straight into an analogue to digital converter in the CPU, so it has a number (N) which it can compare with the known number equivalent to 10A (n10A).
If N>n10A, decrease duty cycle.
If N<n10A, increase duty cycle.

This happens every few clock ticks of the 16 MHz CPU, so something like a million times a second.

There is/are large capacitor/s in the controller to smooth out the battery current - directly across the input battery wires. 470microF +100microF in the schematic above.
 
Last edited:
D

Deleted member 25121

Guest
It measures the incoming current through the shunt. It all goes to the motor, so it's outgoing current too. It adjusts the duty cycle up and down when it sees anything other than 10A in the situation you describe. The measurement is the voltage drop across the shunt. That voltage goes straight into an analogue to digital converter in the CPU, so it has a number (N) which it can compare with the known number equivalent to 10A (n10A).
If N>n10A, decrease duty cycle.
If N<n10A, increase duty cycle.
I'm not meaning to be awkward, just keen to understand how things work. I'm an engineer who, amongst other activities, designs circuits using microcontrollers and creates their firmware but I'm not so familiar with motor control.

The current measured through the shunt will be the instantaneous current which will be the battery voltage divided by the motor impedance. With low rpm, and little back EMF, when the pulse is applied the battery voltage will be across the motor winding and the current will rise relatively slowly because of the winding inductance. It will then settle to a value that is the battery voltage divided by the DC resistance of the winding. The settled current could well be higher than the programmed "current limit" since there's nothing to limit it other than the battey voltage and CD resistance of the windings.

Pulsing the current via PWM won't effect that "settled current" but it will effect the average current over a revolution of the motor. I think that the "current limit" is actually this average current.
 
D

Deleted member 25121

Guest
vfr400 - am I right in thinking that a 48V controller shouldn't be used with a 36V battery?
 

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,986
Basildon
vfr400 - am I right in thinking that a 48V controller shouldn't be used with a 36V battery?
Correct unless it's the 36v/48v version, where the voltage can be selected in the settings. AFAIK, the only thing that changes in the settings is that a different multiplier is used with the measured voltage to work the battery level display and the LVC. The 24V/36v and 36v versions have different components inside, so can't cope with 48v.
 
D

Deleted member 25121

Guest
With say a 10A 48V controller what would you recommend the minimum current capacity of the battery pack be, 10A, 15A, 20A?
 

Woosh

Trade Member
May 19, 2012
19,476
16,423
Southend on Sea
wooshbikes.co.uk
the simplest way to understand how things work is this diagram:



this is a simple BLDC, as used in a hard drive motor. An e-bike motor may have 8-48 magnet poles instead of 4 but the principle is exactly the same.
Note the middle point where 3 coils are joined together.
In a 6-FET controller (the most popular design for BLDC motors, including e-bikes), the controller will switch on two of its 6 FETs at a time.
Each motor phase wire (Green, Blue, Yellow) will be connected to 36V then to ground when the rotor moves fron one magnet pole to the next.
The middle point isn't static, its voltage can oscillate very significantly.
That's why you can tweak the software in many ways to modify the magnet flux, including reversing the polarity (ie generate a reverse field).
Here is a typical waveform:
 
Last edited:

Woosh

Trade Member
May 19, 2012
19,476
16,423
Southend on Sea
wooshbikes.co.uk
With say a 10A 48V controller what would you recommend the minimum current capacity of the battery pack be, 10A, 15A, 20A?
I use 1.5C as a yardstick.
10AH battery is good for 15A controller.
So if you limit your controller to 10A, then 7AH should be OK.
 

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,986
Basildon
I'm not meaning to be awkward, just keen to understand how things work. I'm an engineer who, amongst other activities, designs circuits using microcontrollers and creates their firmware but I'm not so familiar with motor control.

The current measured through the shunt will be the instantaneous current which will be the battery voltage divided by the motor impedance. With low rpm, and little back EMF, when the pulse is applied the battery voltage will be across the motor winding and the current will rise relatively slowly because of the winding inductance. It will then settle to a value that is the battery voltage divided by the DC resistance of the winding. The settled current could well be higher than the programmed "current limit" since there's nothing to limit it other than the battey voltage and CD resistance of the windings.

Pulsing the current via PWM won't effect that "settled current" but it will effect the average current over a revolution of the motor. I think that the "current limit" is actually this average current.
Don't forget that there are 3 phases , 2 directions and maybe 20 poles, so 120 main pulses per revolution , and the motor turns at around 1000 rpm (5:1 reduction), which makes 120,000 pulses per minute or 2000 pulses per second.

I wouldn't start thinking about impedence because what happens is extremely complicated because of a nasty thing called reactance, for which you need third order differential equations to figure it out, and tyou need to know about Laplace transforms to solve them.
 
D

Deleted member 25121

Guest
I use 1.5C as a yardstick.
10AH battery is good for 15A controller.
So if you limit your controller to 10A, then 7AH should be OK.
I was wondering about the minimum current capability of the battery, would it be eg 10A, 15A, 20A..?
 
D

Deleted member 25121

Guest
I'm not meaning to be awkward, just keen to understand how things work. I'm an engineer who, amongst other activities, designs circuits using microcontrollers and creates their firmware but I'm not so familiar with motor control.

The current measured through the shunt will be the instantaneous current which will be the battery voltage divided by the motor impedance. With low rpm, and little back EMF, when the pulse is applied the battery voltage will be across the motor winding and the current will rise relatively slowly because of the winding inductance. It will then settle to a value that is the battery voltage divided by the DC resistance of the winding. The settled current could well be higher than the programmed "current limit" since there's nothing to limit it other than the battey voltage and CD resistance of the windings.

Pulsing the current via PWM won't effect that "settled current" but it will effect the average current over a revolution of the motor. I think that the "current limit" is actually this average current.
I think I'm right, looking at the bottom of this great link in more detail:
Imotor=Ibattery/D where
Imotor = current through the motor windings
Ibattery = current drawn from the battery pack
D = the PWM duty cycle, which can range from 0 to 1

So the controller "current limit" is Ibattery, the average current drawn from the battery pack and Imotor can be much higher. I'd been thinking that the controller "current limit" was the maximum current through the motor windings.

This means that the peak current from the battery can be much higher that the controller "current limit", hence my question about minimum current capability of the battery .
 
D

Deleted member 25121

Guest
Don't forget that there are 3 phases , 2 directions and maybe 20 poles, so 120 main pulses per revolution , and the motor turns at around 1000 rpm (5:1 reduction), which makes 120,000 pulses per minute or 2000 pulses per second.

I wouldn't start thinking about impedence because what happens is extremely complicated because of a nasty thing called reactance, for which you need third order differential equations to figure it out, and tyou need to know about Laplace transforms to solve them.
2000 pulses per second is a period of 500us. The inductance of the motor coils will serve to slow down the changes in current in the coils and reduce rather than increase average coil currents. I agree, it can probably be ignored on the grand scale of things.

Back EMF caused by the coils is a totally different issue mind :)
 

Woosh

Trade Member
May 19, 2012
19,476
16,423
Southend on Sea
wooshbikes.co.uk
I was wondering about the minimum current capability of the battery, would it be eg 10A, 15A, 20A..?
the batteries are usually fitted with 25A BMS, but if you exceed 1.5C, you can shorten the life of your battery.
 

Woosh

Trade Member
May 19, 2012
19,476
16,423
Southend on Sea
wooshbikes.co.uk
2000 pulses per second is a period of 500us. The inductance of the motor coils will serve to slow down the changes in current in the coils and reduce rather than increase average coil currents. I agree, it can probably be ignored on the grand scale of things.
remember the floating middle point? it is not static. Watch the video and note the short pulses within each main pulse. You may have a main period in the order of 500 microseconds but inside that, you have harmonics created by the interference between the increase flux in the connected coils and the decay in the third coil.
 

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,986
Basildon
2000 pulses per second is a period of 500us. The inductance of the motor coils will serve to slow down the changes in current in the coils and reduce rather than increase average coil currents. I agree, it can probably be ignored on the grand scale of things.

Back EMF caused by the coils is a totally different issue mind :)
You don't need to worry about all that theory. everything adds up and is easy to understand if you consider bateery voltage pushing the current through the motor, and the current going through the motor is equal to the current coming out of the battery, The only other thing is the back emf, which you can consider as an opposing battery, where it's voltage = RPM x KV.
 

Backpeddle

Finding my (electric) wheels
Aug 8, 2019
20
6
I think I'm right in saying than according to a certain Mr Ohm, V=IR, where R is the resistance of the motor windings. For a given motor, if V increases then I (the current) will also increase.
This is wrong youre using the wrong equation this is a power calculation and the windings are not the same in the TSDZ2 48v and 36v motors.
Now
P is power in watts
I is current in Amps
V is voltage in volts

Power = current x voltage

Now consider for example a motor rated at 48volts drawing 15 amps this is producing:-

48 X 15 = 720 watts

Now a 36v motor drawing 15 amps:-

36 x 15 = 540 watts

Now to compare like for like as with a TSDZ2 , which is a torque sensing motor, both motors producing 750watts working at the same advantage.
power at 36v = power at 48v = 750w
At 48v, I = 15A
Therefore
V x I = V x I
36 x I = 48 x 15
Therefore
I = 48x15/36
I = 20A
At 48v only 15A is required for the same power output of a 36v motor drawing 20A.

Note this does not take account of any losses due to heat produced hence losses. I f you can shed light on that would have been constrctive.
 
D

Deleted member 25121

Guest
You don't need to worry about all that theory. everything adds up and is easy to understand if you consider bateery voltage pushing the current through the motor, and the current going through the motor is equal to the current coming out of the battery, The only other thing is the back emf, which you can consider as an opposing battery, where it's voltage = RPM x KV.
Yep, that's the conclusion I came to. I was thinking the controller current limit was the maximum current going into the motor and consequently getting confused by how the controller could achieve that.
If you consider the controller current limit and battery current to be the average (rather than maximum) currents then everything comes together.
Thanks to you and Woosh for helping me understand this.