# Regenerative Braking Logic Table (PMAC)



## Evan (Feb 20, 2008)

It is my understanding that you would simply let all the gates open. The diodes you have across those gates will take care of the rest. If you have excess power you simply have a third gate across the motor with a very beefy power resistor to remove the extra power. The thing is that doing it that way is not a good idea because you wear out the slip rings faster when you do that. This is part of why IMHO why induction machines are favored. Now you don't need that if you have a way to make the controller add braking power threw the conventional break pads. The question is do you trust the computer *you* programmed with your breaking? If I was me doing the coding I would always feel nervous. Think about it this is like building a replacement for the commutator on a DC motor only 3 Phase. 

Not to change your plans but why are you chasing PMAC and not induction?


----------



## abudabit (Sep 18, 2008)

Evan said:


> The thing is that doing it that way is not a good idea because you wear out the slip rings faster when you do that. This is part of why IMHO why induction machines are favored.


I'm confused, I didn't think brushless permanent magnets had slip rings. Inductions have slip rings.


----------



## Evan (Feb 20, 2008)

No induction motors don't have slip rings because they use induction to create current in the rotor which is typically a squirrel cage. There is a "slip" which is a percentage relating stator frequency to rotor frequency.

PMAC = Perminent Magnet AC Motors have slip rings that send power to windings on the rotor. The stator is made of large permanent magnets.

Brushless DC = Basically a PMAC with some solid state system for generating AC from DC input.

No offense but you have it backwards.


----------



## major (Apr 4, 2008)

Evan said:


> No induction motors don't have slip rings because they use induction to create current in the rotor which is typically a squirrel cage. There is a "slip" which is a percentage relating stator frequency to rotor frequency.
> 
> PMAC = Perminent Magnet AC Motors have slip rings that send power to windings on the rotor. The stator is made of large permanent magnets.
> 
> ...


 
Hey Evan,

Some induction motors do have slip rings. These are wound rotor induction motors and the rotor resistance is adjusted externally via the slip rings. Such motors are used for fixed frequency applications and the rotor resistance is varied to control starting current and to get some degree of speed control. Slip ring induction motors have never been used in EVs because the VVVF (Variable Voltage Variable Frequency) drives negate the need. So EVs use squirrel cage induction motors which do not have slip rings.

Now for the PMAC and Brushless DC motors. My understanding is that these are basically the same machines, but the AC waveform is different. Sine wave vs some type of trapezoid. Also, that the brushless DC may use position sensors and the PMAC may not. ??? Not really sure. Kind of look like the same to me, looking at the machine. Anyway, I have never seen these with slip rings. All of these types have the windings on the stator and the rotor carries the permanent magnets. 

Regards,

major


----------



## major (Apr 4, 2008)

abudabit said:


> This is for a 3 phase PMAC controller...
> 
> Which gates do I open for regenerative braking? For example, lets say the sensor position at a specific time call for drive gate A-High and C-Low to be open - do I open regen gate A-High and C-Low, or would it be regen gate A-Low and C-High? Also for regen you need 6 additional gates, right?


Hi abudabit,

I am pretty sure that the gate firing sequence for the 3 phase bridge is the same for motor and generator operation. You still need the 3 phase wave form. What differs is the angle and modulation. I have not used PMAC, but have done a lot with ACIM drives. With those you adjust the frequency and modulation to get regen. Since the PMAC is synchronous, the frequency is fixed with the RPM, so I'm guessing you'd need to change the angle.

My thoughts,

major


----------



## abudabit (Sep 18, 2008)

I thought the rotor was the permanent magnets and the stator was the windings. It is a lot easier that way. What is the advantage of putting windings on the rotor?


*Edit* Evan, I think you're getting brushed PM motors confused with PMAC's which are brushless. Here is a quote from How Stuff Works:



> With the advent of cheap computers and power transistors, it became possible to "turn the motor inside out" and eliminate the brushes. In a brushless DC motor (BLDC), you put the permanent magnets on the rotor and you move the electromagnets to the stator. Then you use a computer (connected to high-power transistors) to charge up the electromagnets as the shaft turns. This system has all sorts of advantages
> 
> Because a computer controls the motor instead of mechanical brushes, it's more precise. The computer can also factor the speed of the motor into the equation. This makes brushless motors more efficient.
> 
> ...


As for why I'm using a PM motor instead of induction, it makes more sense to use PM in smaller applications. I'm doing a 10kw max application. I've heard anything above 5kw it is better to use induction from a cost / efficiency stand point but this is fine for me.


----------



## abudabit (Sep 18, 2008)

major said:


> Hi abudabit,
> 
> I am pretty sure that the gate firing sequence for the 3 phase bridge is the same for motor and generator operation. You still need the 3 phase wave form. What differs is the angle and modulation. I have not used PMAC, but have done a lot with ACIM drives. With those you adjust the frequency and modulation to get regen. Since the PMAC is synchronous, the frequency is fixed with the RPM, so I'm guessing you'd need to change the angle.
> 
> ...


Hmm... I guess I would have to invert the angle. I guess since it's back emf I'd have to do the opposite of what would be done with driving force.

I'll have to add a direction sensor to my tachometer, right now the way I designed it it doesn't know which direction the motor is turning.


----------



## judebert (Apr 16, 2008)

Why would you need a direction sensor? 

I'm hoping to get *major* to respond again. In ACIM motors, my research indicates, torque is proportional to slip. To get regen, you just run the stator at a _lower_ speed than the rotor, resulting in negative torque and power generation. (My big confusion here is where the power goes. If my controller is providing power to A and B windings, does the power go out of the C winding? Or am I not actually providing any power, but just opening the gates at the appropriate times and letting power come through? But if that's the case, where is the "induction" occurring? And do I always have to start my sentences with a preposition? )

I'm thinking the same thing is true of the brushless DC motors. The only difference is that their slip is supposed to be always 0. But as the magnet passes the coil, if you've got the gate open, it should generate electricity for you. In that case, you only need to know the rotor position, not its direction.


----------



## 3dplane (Feb 27, 2008)

abudabit!
Are we talking about brushless dc? (stationary windings 3 phase and rotating magnets?)
In that case when ever the rotor spins there is three phase power coming right back period. No need to know timing,direction,angles etc.just divert that through a rectifier and there is DC. Now to actually exceed battery pack voltage for regen thats a different story. My point is if it's bldc (don't be scared to call it blDC) and the rotor is spinning, it is now a three phase alternator without any excitation needed. If you are talking about some other type of motor then disregard the above.
Barna


----------



## abudabit (Sep 18, 2008)

3dplane said:


> abudabit!
> Are we talking about brushless dc? (stationary windings 3 phase and rotating magnets?)
> In that case when ever the rotor spins there is three phase power coming right back period. No need to know timing,direction,angles etc.just divert that through a rectifier and there is DC. Now to actually exceed battery pack voltage for regen thats a different story. My point is if it's bldc (don't be scared to call it blDC) and the rotor is spinning, it is now a three phase alternator without any excitation needed. If you are talking about some other type of motor then disregard the above.
> Barna


Thing is there can only be one high switch on and one low switch on at any given time, right? Or do you have all 6 open?


----------



## major (Apr 4, 2008)

judebert said:


> Why would you need a direction sensor?
> 
> I'm hoping to get *major* to respond again.


Hey jude,

About ready to leave town for a few days, so not much time to respond. My understanding is that you need position for BLDC control. Usually a resolver is used. An encoder is possible if it has the Z marker and you're smart enough to use it. Now there are ways to do BLDC without motor feedback, but if you are smart enough to do that you wouldn't be asking these questions.

Regards, 

major


----------



## major (Apr 4, 2008)

abudabit said:


> Thing is there can only be one high switch on and one low switch on at any given time, right? Or do you have all 6 open?


abudabit,

I think you usually have a high side switch on and modulate the other 2 low side switches, then a low side on and modulate the other 2 high side switches. This is the way to synthesize a 3 phase waveform.

Yeah, a BLDC would generate back to a battery with all switches open if it was spinning faster than base speed. The anti-parallel diodes would look like a rectifier bridge. But you would have no current control. At lower than base speed, you need to fire the switches as if you were doing boost converters. That is to short the motor coil and open it to have the inductive voltage from the decaying current add to the generated voltage from the magnet cutting the coils.

Regards,

major


----------



## Evan (Feb 20, 2008)

Abudabit - I was just running down the common configurations. There are slip ring versions of almost all motor types apparently. Sorry I got that wrong. I still think that you should just let the diodes take care of it. That is what I was getting at and unless I am mistaken what Major just said.


----------



## abudabit (Sep 18, 2008)

Very true about the current control. Probably a bad idea to feed the back emf to the the power source the same way it came in.

So here is what I'm thinking (this is still a rough draft in my head so bear with me): 

3 extra switches, one for each winding. Now if the drive logic would normally call for H L x at the currrent rotor position, for example, when the brake lever is pulled the dedicated regen switches will be On On Off (and the drive switches will all be off). I'll use diodes to rectify the voltages, and then use some regen logic to decide how much goes into a capacitor or the batteries and have the rest go through a power resistor. Might even have a few power resistors in parallel so the more you pull on the brake lever the more gets dissipated into dynamic braking. Not sure about that last part or how it would be implemented cost effectively. 

It'll be a good compromise between the most complex solution of having 6 extra switches for regen and the least complex of just having the back emf feed back into the same power system it came from.


----------



## major (Apr 4, 2008)

judebert said:


> (My big confusion here is where the power goes. If my controller is providing power to A and B windings, does the power go out of the C winding? Or am I not actually providing any power, but just opening the gates at the appropriate times and letting power come through? But if that's the case, where is the "induction" occurring?


Hey Jude,

Sittin' in a motel lobby on the free computer. So can't write much. No spell check. Anyway, as to how an induction motor generates. Study the example of an ACIM connected to 3 phase 60 Hz. Use a 4 pole. It will turn slightly less than 1800 RPM, it's synchronous speed. Say 1785 at no load. Slip is 15 RPM or 0.5 Hz. As you load it, slip increases and RPM decreases. It draws electrical power from the mains and converts it into mechanical power at the motor shaft.

Now, take that same motor connected to 60 Hz and the same mains voltage and drive it with a mechanical power source faster than 1800 RPM. Say 1860 RPM. Now you have negative 60 RPM or 1 Hz slip. What happens? You are now feeding power into the mains. The ACIM is a generator, converting mechanical power into electrical. The 60 Hz mains is taking that power. The frequency is the same. The voltage is the same. But this only works if you have the mains supply there to start with. It is supplying the magnetizing current in the ACIM.

So when you get to the inverter driven ACIM, treat it much the same. You still need that 3 phase excitation. The AC phase voltages will change little as it goes from motor to generator action, but the DC bus voltage will rise sharply unless that generated power is used, to charge a battery or wasted, in a resistor. There is still a magnetizing component of the phase currents which needs the fundamental frequency form the inverter bridge. But all the power really comes from the mechanical input to the shaft while it generates.

Well, up to the room for a lonely night. Hope this helps.

major


----------



## Madmac (Mar 14, 2008)

To control the regen loop the current drain of charging the batteries or the load resistor determines the amount of slip. As the voltage generated increases and is stored on the local capacitors the loop needs to check if the batteries can absorb the power or the load resistor needs to be switched in. Controlling this loop is needed to give a constant breaking feel to the system

I note that on some systems designed to work with pb batteries there does not seem to be a load resistor, It would be interesting to know how they deal with potential overcharging of the batteries.

It is very difficult to find any good information on the theory behind controlled regen on ACIM's. I think the only solution wll be to get the drive side working then experiment with the hardware to see how the paramters interact and use that information to create a simple model.

Madmac


----------



## judebert (Apr 16, 2008)

Thanks for the lesson, major. I appreciate you taking your time to help me out.

I'm programming a force-vector controller simulation. I intend to make the code Open-Source under the GPL, and provide versions for different microprocessors. I've examined the tech documents until I understand them (even managed to derive right-hand rule and figure out where the windings are supposed to go!), and I've created a little graphic display that looks kinda like an oscilloscope with a stator vector drawing. It's been on the back burner for my meatspace job, but I'm getting back to it.

I'm more comfortable with the software than the hardware. I know that there's a gate driver in the controller hardware, but I don't know how it does what it does. I'm more interested in how the controller needs to behave: give me the inputs and the desired outputs, and I'll make the microprocessor do what you want.

I've always been confused by the regen on an ACIM, but your explanation is starting to help. Driving the motor is no problem: knowing that I'm driving three coils, each generating a magnetic field 120 degrees apart, and that the apparent movement of these fields induces a similar magnetic field in the rotor, I can see how the rotor would be forced to move. 

Getting power out of the motor is more opaque. I'm still going to be driving those same three stator coils, so I'm pushing current _out_. That's going to induce a magnetic field in the rotor, which will create currents in the stator coils. But I'm already creating currents in the stator coils; it can't be going both out and in! Worse yet, the majority of the time, all three coils are energized; there's not an inactive coil for the current to use.

It's not an immediate problem, just something I'm trying to learn. Thanks again for taking the time to help out.


----------



## major (Apr 4, 2008)

Madmac said:


> I note that on some systems designed to work with pb batteries there does not seem to be a load resistor, It would be interesting to know how they deal with potential overcharging of the batteries.
> 
> Madmac


Well mac,

This is how I do it. First, run the system in torque control. The input from the throttle is a positive torque reference and the signal from the brake is a negative torque reference. When braking, the DC bus voltage rises and current flows into the battery. Depending on the torque level and the state of charge of the battery, the DC voltage will assume some level. The control program monitors this voltage. It has the maximum voltage set point for the battery charge. If the voltage continues to rise, as it nears this set point, the program modifies the torque command, reducing the braking torque, reducing the regen current, reducing the charge current avoiding overvoltage to the battery. Of course this results in less deceleration. The driver simply pushes harder on the brake peddle and gets into the friction brakes. It is intuitive. Not stopping fast enough, step harder on the brake.

So, the net result is the vehicle slows as desired, the battery is charged as much as posible without overvoltage and the kinetic energy which cannot be put into the battery is converted to heat by the friction brakes, which were designed to do this in the first place. No need to use a resistor. 

Regards,

major


----------



## Madmac (Mar 14, 2008)

Hi Major

That makes complete sense if you use part of the brake pedal travel to do regen. The driver becomes part of the control loop!! a neat solution. Requires some more thought to see if this is a better approach then the one below even though it does require modification to the brake pedal assembly.

In the system I have been working on taking the foot off the accelerator is going to start regen. This approach is the other popular way of doing regen and it emulates the de-acceleration caused by the IC engine drag. In this mode you want a consistent feel of speed reduction. This does mean that some other way is needed to lose the excess energy (dump resistor).

I did consider having a variable pot adjusting regen, taking the Metric Mind aproach, but decided that any driver new to the car would take a while to get used to it.

Madmac


----------



## major (Apr 4, 2008)

Madmac said:


> Hi Major
> In the system I have been working on taking the foot off the accelerator is going to start regen. This approach is the other popular way of doing regen and it emulates the de-acceleration caused by the IC engine drag. In this mode you want a consistent feel of speed reduction. This does mean that some other way is needed to lose the excess energy (dump resistor).
> 
> I did consider having a variable pot adjusting regen, taking the Metric Mind aproach, but decided that any driver new to the car would take a while to get used to it.
> ...


Hi mac,

You can use the same type of voltage control algorythm with the pedal-off type of control. And on my system, I can use an adjustment pot for regen strength (or total off). This is nice if road conditions are icy.

Usually the regen simulation of engine compression braking isn't strong enough to cause over voltage trouble, unless you have a long down grade.

Regards,

major


----------



## buzzforb (Aug 16, 2008)

Don't know if this will help explain things any.

http://www.electrodynamics.net/documents/electrodynamics_power_gen2002.pdf


----------

