BLDC Brain

amberwolf said:
Alan B said:
I also like the idea of an analog ebraking control. Perhaps a separate brake lever or smaller trigger since hydraulic brakes don't allow much motion before they come on and modifying them for dual action is difficult.

Perhaps a simple hollow add-on lever to the face of the existng lever, rather like the unlocking lever on a set of vice grips, but outside the brake lever rather than inside like the vice grips. It could be setup with a hall and magnet easily enough. I've considered somethinglike this fro my pwm-ing of the regular digitalebrake lines,if i ever get to that experiment.

Excellent idea. I had a similar thought. Here's one a bit more outside the box: How about a magnetic finger ring, so the regen comes on when your finger approaches a hall sensor on the brake lever. Either slide it along the lever, or approach it from top or front.

I like the hollow letter better.
 
Alan B said:
How about a magnetic finger ring, so the regen comes on when your finger approaches a hall sensor on the brake lever. Either slide it along the lever, or approach it from top or front.
Given how often I end up with injured fingers that couldn't be used for that, it wouldn't work for me. Also, I would probably lose the ring.

I used to have a magnet installed in a glove for my throttle on DayGlo Avenger, when I used the friction drive and rebuilt scooter controller. The hall sensor was buried under the grip. But I had to always hold the bar just right, and moving my hands outward or inward for comfort kept it from working. :(
 
Alan B said:
Hi Pat. Lots of good information. Thanks. I did read your long posts and they don't appear to address my question about the voltage boost mechanism.
[...]
PWM into a motor is a voltage bucking operation. Where is the voltage boost in the normal PWM commutation cycle?

Study the PWM buck circuit going one way (battery-->controller-->motor). Now look at it the other way (motor-->controller-->battery) and voilà... you have a boost circuit! That's why I went into all that bi-directional current control discussion - a two-FET buck circuit is always a boost circuit seen the other way, it just depends on which FETs we switch and for how long. That's what I was trying to explain when talking about the three possible modes of current control in such a circuit:

High side FET switched only: Buck only operation, current flows from battery to motor only.
Low side FET switched only: Boost only operation, current flows from motor to battery only.
Both FETs switched together: Buck/Boost operation, current flow is bi-directional basically depending on Vbattery, Vmotor and the PWM duty cycle (see math in previous post).

The momentary shorting of the coils you describe for boost operation happens when the low side PWM'ing FET is turned on, since the other end of the coil is being held low by a second phase's low side FET(s) during the whole commutation cycle.

Any better?
Pat
 
Great info, thanks!

Whats a good freqency for regen? The original blog entry suggested 1K Hz, but it makes an awful whine, which I've not heard from other e-bikes on regen.

Has anyone ever measured what infineon does?

For regen, is it best to set three Lower FETs on at the same time, or is there a good reason to use sequencing and pairing, eg, AB, BC, CA?

It doesnt appear that standard Infineon can measure reverse current. With the shunts on the lower side, I don't think this is possible. Regen power measurement would be a nice feature.

Mark.
 
ZapPat said:
Alan B said:
Hi Pat. Lots of good information. Thanks. I did read your long posts and they don't appear to address my question about the voltage boost mechanism.
[...]
PWM into a motor is a voltage bucking operation. Where is the voltage boost in the normal PWM commutation cycle?

Study the PWM buck circuit going one way (battery-->controller-->motor). Now look at it the other way (motor-->controller-->battery) and voilà... you have a boost circuit! That's why I went into all that bi-directional current control discussion - a two-FET buck circuit is always a boost circuit seen the other way, it just depends on which FETs we switch and for how long. That's what I was trying to explain when talking about the three possible modes of current control in such a circuit:

High side FET switched only: Buck only operation, current flows from battery to motor only.
Low side FET switched only: Boost only operation, current flows from motor to battery only.
Both FETs switched together: Buck/Boost operation, current flow is bi-directional basically depending on Vbattery, Vmotor and the PWM duty cycle (see math in previous post).

The momentary shorting of the coils you describe for boost operation happens when the low side PWM'ing FET is turned on, since the other end of the coil is being held low by a second phase's low side FET(s) during the whole commutation cycle.

Any better?
Pat

Good morning, Pat. Thanks for trying. I was hoping for an explanation of how the circuits actually work but we are not getting there. I'll have to figure it out when I have time. In order to write control software for this it must be correctly understood at a pretty low level.

You can PWM either the high side FETs or the low side during normal buck operation, it doesn't matter. Both must be changed for commutation according to the hall sensors. This asynchronous mode of operation depends on the body diodes of the FETs to conduct the PWM off cycle inductive current. A more efficient arrangement is to use synchronous rectification by using complementary PWM on the opposite side FET (opposite the FET already doing PWM) instead of depending on the inherent body diode. This appears to me to be an opportunity for regeneration at lower throttle settings with this technique (as the coils are shorted). Perhaps this is what Pat was attempting to describe earlier.

In one thread on ES the OP was testing a new Kelly controller and found it had regenerative deceleration when he backed off the throttle. I suspect that this controller was using synchronous rectification as that mode appears to have that characteristic.

A simple asynchronous regeneration cycle can be produced by simultaneously pulsing all three high or all three low side FETs on at once. This converts motor back EMF to current and then boosts it up in voltage where the inherent body diodes in the FETs rectify it for battery charging. No commutation or hall interpretation is necessary. For those experimenting with simple software this appears to be a good algorithm to start with.

Take care to never turn on both high and low side FETs on the same phase as this produces a shoot through event, shorting out the battery. Transitioning between power and regen modes must be done carefully to insure a shoot through event never occurs. Some dead time is required as FETs turn on and turn off is not instant or symmetrical. Microprocessors designed for this use usually have dead time timers designed in to make this easier to do correctly and safely.

The devil is in the details here, everything is determined by which FETs are turned on when. Precision in both understanding and control is required. Mistakes in this software can cause rapid smoke release from the FETs.

I would suggest using the same frequency for regen as the usual PWM.
 
Alan B said:
Mistakes in this software can cause rapid smoke release from the FETs.

Ooooh, yeah! :twisted: Not to mention the magic smoke to FET plasma conversion cycle :twisted: :twisted: And Einstein was wrong... matter can be destroyed!
 
texaspyro said:
Alan B said:
Mistakes in this software can cause rapid smoke release from the FETs.

Ooooh, yeah! :twisted: Not to mention the magic smoke to FET plasma conversion cycle :twisted: :twisted: And Einstein was wrong... matter can be destroyed!

No, no...

Lavoisier told us matter cannot be destroyed. Einstein told us it could, what you would get for it, and helped figure out how to do it (but that was 140 or so years later).

Cameron
 
Alan B said:
Good morning, Pat. Thanks for trying. I was hoping for an explanation of how the circuits actually work but we are not getting there. I'll have to figure it out when I have time. In order to write control software for this it must be correctly understood at a pretty low level.

Hi Alan, both you and Amberwolf have already explained pretty well how the boost principal works to create regen-direction current. I was trying to give an example of how this can be done in reality by PWM'ing the low side FET(s) only (while the other end of the coil is being held low) and thus using them as the "shorting" device and the motor's inductance to boost the motor's phase voltage up over the batteries voltage. Here's a couple of pictures to maybe help clarify:
Boost_circuit.png

(here the inductor is the two phases in conduction, the "supply" is the motor's BEMF, the switch is the PWM'ed phase low side FET, the diode being the PWM'ed phase high side FET's body diode, and the "load" being the battery)

Now if we look at the buck version of the converter:
220px-Buck_circuit_diagram.svg.png

(This time though the "supply" becomes the battery, the switch is the the PWM'ed *high* side FET, the diode being the PWM'ed phase *low* side FET's body diode, and the "load" being the motor, but the inductor is still the same two phases in conduction)

Both these examples assume that one non-PWM'ed motor phase is being held *low* during the whole commutation cycle (with the third phase left floating as 6 step commutaion dictates), which we don't see in the two examples above. Of course you could hold that second phase high during the commutation period, in which case you will get a buck converter by switching the opposite high side FET this time instead of the low side FET as was required before. This is probably why you say that we can make a buck converter by switching the high side FET just as well as the low side FET, it's just that my example assumes that the conducting phase is being held low only, never high.


A simple asynchronous regeneration cycle can be produced by simultaneously pulsing all three high or all three low side FETs on at once. This converts motor back EMF to current and then boosts it up in voltage where the inherent body diodes in the FETs rectify it for battery charging. No commutation or hall interpretation is necessary. For those experimenting with simple software this appears to be a good algorithm to start with.
I guess this would work, but one disadvantage of this simple method is that you will now be using two FET body diodes instead of only one to conduct your regen current. Not a showstopper or anything, it just lowers the regen efficiency of the controller a fair bit. However it is not very hard at all to do it properly using only the two required phases because your controller is already well aware of the current commutation cycle's switching needs. Thus your controller already knows which phase should be doing PWM and which phase should be held low at that moment for either driven or regen.
In other words, during any of the 6 commutation states, the two phases to be active are no different weather in drive or regen mode. it's just the duty cycle and which FET(s) are selected to be actively PWM'd (high and/or low side) that dictates which way the current flows in my example, since I hold the other phase low and never switch it high. Changing the polarity of the other phase would be another way of doing it too as this will invert the behavior of the PWM'd phase.

So to sum it up, if you are PWM'ing the simple and common way (only the high or low side FET on at a time, no synchronous switching), then changing either the polarity of your PWM'd phase or the polarity of the conducting phase changes the controller's behavior from drive only to regen only.

Pat
 
Great thread.
 
Back
Top