# Regenerative Braking



## joamanya89 (Feb 13, 2012)

Hi, I've got a problem, I'm working on my own controller, I'm doing it by my self, but here is the question, it will be for an DC motor, untill now, I'm working at an smaller size, so I can try anything I would imagine and then do it for real.

I'm working with a 24 V motor, and the power controller goes great, but when I'm trying to re charge the battery pack I have got these problem...

The motor never gives back to me more than 14V or perhaps 15V, so, how could I re-charge my 24V battery pack if I can't get enough voltage?

did someone do it before?


----------



## major (Apr 4, 2008)

joamanya89 said:


> Hi, I've got a problem, I'm working on my own controller, I'm doing it by my self, but here is the question, it will be for an DC motor, untill now, I'm working at an smaller size, so I can try anything I would imagine and then do it for real.
> 
> I'm working with a 24 V motor, and the power controller goes great, but when I'm trying to re charge the battery pack I have got these problem...
> 
> ...


Hi joama,

Remember I told you that you need a regen capable controller?



major said:


> joamanya89 said:
> 
> 
> > I've got a quiestion here, what if you use a microcontroller to che on a tacometer and you do all the needed stuff so when you push your break or just leave your accelerator pedal it just conect a direct circuit between your batteryes and your DC motor (been them close), so you can charge your batteryes with no problem an with out an other thing else than your DC motor.
> ...


You didn't believe me then, do you now?

When the motor turns into a generator the voltage will be less so the controller needs to function in a boost mode for reverse current. In other words, it needs to be designed to function as a regeneration capable converter.

Regards,

major


----------



## joamanya89 (Feb 13, 2012)

I'm sorry if I didn't pay atention to you before, I don't really know why I didn't.

But now we are on the same thought's line, so, I completely understand what you are saying, and I'm trying to do that, I have done de controller to regulate the power to the motor, and now, I'm looking how to do the part of regenerative.

I'll try to explain you what I have done untill now, so perhaps you could find my mistake...

To control these motor I have use a microcontroller and with PWM and a few transistors I have done the power control, ok?

using software I had programing a code that when I'm not having power to the motor, another circuit gets on, and this circuit is the one which will charge the batteryes, but as I told you before, It never get enough voltage back from the motor .

Do you have an Idea what does have the dc controllers to get the necesary voltage back?

the 24V motor is a brushed motor.


----------



## joamanya89 (Feb 13, 2012)

Sorry I didn't catch when you said "boost mode", so do you think they use a DC-DC transformer to push up the voltage?


----------



## major (Apr 4, 2008)

joamanya89 said:


> Sorry I didn't catch when you said "boost mode", so do you think they use a DC-DC transformer to push up the voltage?


Have you ever heard of a half bridge? Do some research on the power electronic components and topology of converters. There are countless resources on the web and in libraries. Here's a few.

http://www.4qd.co.uk/fea/regen.html 
http://www.4qd.co.uk/fea/half.html 
http://www.4qdtec.com/pwm-01.html


----------



## joamanya89 (Feb 13, 2012)

major said:


> Have you ever heard of a half bridge? Do some research on the power electronic components and topology of converters. There are countless resources on the web and in libraries. Here's a few.
> 
> http://www.4qd.co.uk/fea/regen.html
> http://www.4qd.co.uk/fea/half.html
> http://www.4qdtec.com/pwm-01.html


Major, thank you a lot for all the information you had given to me,
now that I had read it all, perhaps we could discuss about a few things I couldn´t catch, not sure if it was my english or the logical...

At first, the controllers they show up there are completly hardware, and I´m trying to make mine mixing hardware and software, because from there I will be able get a lot of information to be shown later, like current flow, voltage etc, but do you think it is a bad idea to make mine using part of softwar?

when I say software I mean, using a microcontroller to interpretate the potentiometer signal and give the signal to the transistors...

Then, one of the things I didnt catch was if the flywheel MOSFET after gets on, if it gets of by it´s own or you have to swich it of after an X time the get the reg?

And,what do you think is better tu use? MOSFET or IGBT?

Again thanks a los for the information.


----------



## Siwastaja (Aug 1, 2012)

Hi,

using a microcontroller to make either a isolating switch-mode power supply or a boost converter is fairly easy. Practically, you are applying a PWM signal to a MOSFET (a simple flyback transformer, or a boost converter) or MOSFETs (half or even full bridge), and this makes the transformer or a coil increase the voltage, 

but you will need some kind of feedback; I think you should measure current going from the motor to the battery and use that to adjust the PWM duty cycle.

I think the boost converter is the way to go here; you don't need isolation. If done right, you will get very good efficiency and simple construction with only one MOSFET. See http://en.wikipedia.org/wiki/Boost_converter

Regarding the question about MOSFET vs. IGBT, the choice is very clear here; for voltages this low, go for MOSFETs. For something like 200-300 volts and up, IGBT.


----------



## joamanya89 (Feb 13, 2012)

Siwastaja said:


> Regarding the question about MOSFET vs. IGBT, the choice is very clear here; for voltages this low, go for MOSFETs. For something like 200-300 volts and up, IGBT.


I'll check well everything you had told me, but, what I'll do at the end will be a controller for a 75V motor, and it will drive perhaps 200A or 250A, do you still thinking that MOSFETs are a go choice?


----------



## joamanya89 (Feb 13, 2012)

Let me now if I catch you...

I had upload a verry simple (verry simple) schemic of the controller circuit, it is just for power the motor, not for reg, an it has not the half bridge, etc.

But, I woul like to use the isolator to protect the microcontroller, so you think it schemic is ok? I use 3 MOSFETs to handle more current.

but when you had sayed


> but you will need some kind of feedback; I think you should measure current going from the motor to the battery and use that to adjust the PWM duty cycle.


Why do you need it? to adjust the duty cycle for what? for reg??


----------



## joamanya89 (Feb 13, 2012)

the schemics


----------



## PStechPaul (May 1, 2012)

The schematic is only a very rough approximation of what you need. You must have a half-bridge or full bridge with the motor to handle the commutating current during the off cycles, and you need proper gate drivers for the MOSFETs. It's good that you want to make your own controller, but you need to understand all of the concepts of the DC motor you have chosen and the drive circuitry. It might be better to get a kit, or at the very least just build a low-power controller as an experiment before trying to make one for a roadworthy EV. Good luck!


----------



## joamanya89 (Feb 13, 2012)

PStechPaul said:


> The schematic is only a very rough approximation of what you need. You must have a half-bridge or full bridge with the motor to handle the commutating current during the off cycles, and you need proper gate drivers for the MOSFETs. It's good that you want to make your own controller, but you need to understand all of the concepts of the DC motor you have chosen and the drive circuitry. It might be better to get a kit, or at the very least just build a low-power controller as an experiment before trying to make one for a roadworthy EV. Good luck!


Why isn't an optoacoplator a good gate driver? if it has a time response of 3 micro seconds...


----------



## Siwastaja (Aug 1, 2012)

joamanya89 said:


> Why isn't an optoacoplator a good gate driver? if it has a time response of 3 micro seconds...


Simply put, a MOSFET is actually not a voltage-controlled device! It's a "charge controlled". This means, when you apply a voltage, the internal capacitance of the MOSFET gets charged, and when you drive it off, this capacitance gets discharged. So, you need a strong current supply for both directions to drive a MOSFET quickly. 

In the simplest optoisolator circuit, you typically have a pullup resistor doing the "on" state, and this is VERY VERY slow. Your "3 microseconds" is then for the phototransistor starting to conduct and make the "off" state, and it indeed can be faster - but still not 3 microseconds, because even the phototransistor cannot supply enough current for the MOSFET to make it turn of quickly.

Any of this doesn't matter if you use slow enough switching (for example: you can use something like 10 Hz for a heating element control), but you probably want high enough switching in an EV to avoid strong noise and jerky drive. So, the simplest solution is to buy ready-made ICs that include the optoisolator AND a push-pull FET driver in the same case. They don't cost much more than the bare optoisolators. They can supply something like 1-2 A for both directions, whereas your optoisolator circuit can supply something like 10-100 mA for one direction and just a few mA to another.

I would still use MOSFETs at your proposed voltage around 100V or so, but IGBT might be usable in some cases, too. For my own AC controller, I'm going for IGBTs but the battery voltage will be about 320V. I think IGBT's start dominating somewhere at the 200-300V mark, but I could be wrong.

My comment about feedback was for your question about voltage boosting for regen braking. Just do some googling for "boost converter" and you will see. Basically you could measure the regen braking current with a MCU ADC and adjust PWM duty cycle in a PI loop. The combination of one MOSFET, one diode and one inductor does the voltage boosting.


----------



## major (Apr 4, 2008)

Siwastaja said:


> The combination of one MOSFET, one diode and one inductor does the voltage boosting.


The 2 MOSFETs in the half bridge do the job along with the inductance of the motor, or is that what you mean?


----------



## TEV (Nov 25, 2011)

http://www.paulandsabrinasevstuff....
http://ecomodder.com/wiki/index.php/ReVolt


----------



## joamanya89 (Feb 13, 2012)

I would like to know as Major, if the half bridge works like you had say the as that combination of MOSFET, diod and inductance?

And I'll ad some information of my goal, I'm trying to convert a citroen mehari to an electric, thats why I'm thinking in a 75V system, and perhaps 100Ah lithium or 250Ah plumb-acid.

The motor I'll use will be some of these http://www.electricmotorsport.com/store/ems_ev_parts_motors_brush-type.php

perhaps that information could help.

the mehari says on it manual that has 30Hp, so I had base that information to get the same HP in electric.

Do you think it is a good motor elecction?

By the way, thank you both for your tolerance with me for my english and thak's too for your helping!


----------



## PStechPaul (May 1, 2012)

Supposedly you can get just about the same effective performance from an electric motor 1/2 to 1/3 the size of the ICE. The ICE HP is often peak power and the torque curve has only a small "sweet spot", while an electric motor is usually rated at continuous and it has a fairly flat torque curve. So you will probably do OK with a 15 to 20 HP motor, as long as that is the true continuous spec. I assume your vehicle is very small. I think you should keep all the existing gears and clutch so you can maximize efficiency and performance, and make the conversion easier. 

For reference:
http://en.wikipedia.org/wiki/Citro%C3%ABn_M%C3%A9hari
http://www.citrobe.org/mehari.htm
http://citroenmehari.com/

A pretty cool little vehicle:


----------



## Siwastaja (Aug 1, 2012)

major said:


> The 2 MOSFETs in the half bridge do the job along with the inductance of the motor, or is that what you mean?


I think we were discussing about voltage boosting for the regen to work properly with lower RPM's with a PM DC motor, and for that purpose, I suggested using a separate boost converter, which uses one MOSFET, a diode and a separate inductor.

Motor control seems to be a separate issue, and naturally it is more important. Maybe these two can be combined with fewer components. Haven't been thinking about that.

IMO, the OP should do the very basic controller with no regen circuitry first. If upscaled from the small 24V test design, the slow FET driving, noise, bypassing, possible lack of gate clamping etc. will become problems and should be solved first.


----------



## joamanya89 (Feb 13, 2012)

Yes, that is what I 'm exacttly going to do, keeping the gears and clutch, and also I'll try to put everithing on front, because of the DC current, there could be a huge power losses if I put the battery pack on the trunck, thanks for all the information and nice picture, I'll try mine loks like that one.!


----------



## joamanya89 (Feb 13, 2012)

Siwastaja said:


> I think we were discussing about voltage boosting for the regen to work properly with lower RPM's with a PM DC motor, and for that purpose, I suggested using a separate boost converter, which uses one MOSFET, a diode and a separate inductor.
> 
> Motor control seems to be a separate issue, and naturally it is more important. Maybe these two can be combined with fewer components. Haven't been thinking about that.
> 
> IMO, the OP should do the very basic controller without regen first.


Don't you think the motor and half bridge could work as the boost converter? why is that?, using that is how I could have the both controller and reg together.


----------



## joamanya89 (Feb 13, 2012)

I'll do that first, and fix everything, so the you can help me with the reg...

Afew questions to keep working on the small size:

What frequenzy should I use? 31KHz would be ok? that for the PWM I mean!


----------



## Siwastaja (Aug 1, 2012)

For a motor controller, the PWM frequency typically varies in the range of about 4 - 20 kHz. Lower for better efficiency, higher for less audible noise.

If you want to do 31 kHz, you will need very good FETs and very very very good and expensive drivers for them. 

I'd say go for around 5 kHz first. If the noise bothers you, then try 10-15 kHz.

And don't forget the proper MOSFET drivers even at 5 kHz. MOSFETs work directly off MCU legs or simple optocoupler ONLY for very slow switching or very small MOSFETs.


----------



## joamanya89 (Feb 13, 2012)

Siwastaja said:


> For a motor controller, the PWM frequency typically varies in the range of about 4 - 20 kHz. Lower for better efficiency, higher for less audible noise.
> 
> If you want to do 31 kHz, you will need very good FETs and very very very good and expensive drivers for them.
> 
> ...



Thank you again, I'll do everything you had told me, now I'm seeking about a proper driver...

You will have news from me soon!


----------



## major (Apr 4, 2008)

Siwastaja said:


> I think we were discussing about voltage boosting for the regen to work properly with lower RPM's with a PM DC motor, and for that purpose, I suggested using a separate boost converter, which uses one MOSFET, a diode and a separate inductor.


Hi Siw,

There is no need to add components to get regen when you use a half bridge. It is done this way in commercial drives. Here is a quote from a link I supplied in post #5. 


> This type of circuit (where hi-side is turned on when the loside is off) is capable of sourcing current *or sinking it*. The way this works is that the reversed motor current is now a forward current to the flywheel MOSFET so when this is on it shorts out the motor - whose braking current rises during this period (arrow B, reversed). The Flywheel MOSFET now turns off, but this current must keep flowing - because of the motor's inductance. So it flows as reverse current through the drive MOSFET, recharging the battery as is does so. The extra voltage for this is derived from the energy stored in the motor's inductance. The process of switching from drive to braking is entirely automatic. Moreover it is done entirely by the motor's speed exceeding the drive voltage and without any change of state or switching within the controller. The regen braking is, if you like, a by-product of the design of the controller and almost a complete accident.


Ref: http://www.4qdtec.com/pwm-01.html 

Regards,

major


----------



## joamanya89 (Feb 13, 2012)

major said:


> Hi Siw,
> 
> There is no need to add components to get regen when you use a half bridge. It is done this way in commercial drives. Here is a quote from a link I supplied in post #5.
> 
> ...


Pardon major, but could you explain me something I had ask you before? How do you calculate the needed time to swich the hi-side MOSFET on and off?? Because it doesn't happen by it self... I tottaly understand the rest...


----------



## PStechPaul (May 1, 2012)

I think 31 kHz will be too high. Many IGBTs are rated at 10-20kHz. The higher the PWM frequency the greater switching losses will be. And you will have to pay more attention to gate wiring and stray capacitance and inductance, and you will need better snubbers and bypass capacitors on the controller. I suggest 5-10kHz, or maybe 16 kHz max. These are audible frequencies (to young people and dogs) so you might want to go higher to reduce an annoying whine, but at the cost of efficiency and possibly destructive stresses on components.

The brushed DC motor when driven as a generator will AFAIK put out about the same voltage as that which would drive it at that speed. But that will always be less than the battery pack voltage.


----------



## major (Apr 4, 2008)

joamanya89 said:


> Pardon major, but could you explain me something I had ask you before? How do you calculate the needed time to swich the hi-side MOSFET on and off?? Because it doesn't happen by it self... I tottaly understand the rest...


1.) Never turn both on at the same time. That is a shoot thru (shorts the DC bus).

2.) When high side switch is on, low side is off. When low is on, high is off.

3.) Allow for appropriate dead time suitable for device characteristics and circuitry.

4.) Devote percentage of the PWM cycle period to the switch's on-time such that it yields the duty cycle desired for the controlled voltage to the motor.

Note: I am not a power electronics guy. This is just from a motor guy's perspective having used motors and controllers for many years 

Or on the other hand, if you are asking about the actual switching time as in the speed at which the device is turned on and turned off, I'll defer to a power electronic guy


----------



## joamanya89 (Feb 13, 2012)

Hi every one! I'm back and I've done a lot...

Right now I'm almost done with my small controller for a 24V motor, but I got a few questions that perhaps you could answer me, because not a lot of people knows about these kind of controllers...

1) when I stop powering the motor, then switch OFF the drive MOSFET, and turns ON the flywheel MOSFET for a current peak's periods, and turns the drive mosfet back ON to re-charge the batteryes...

allright, but first, should I turn on the drive MOSFET for re-charging using PWM at 100%? or just using logical signal and make it work on saturation and no PWM?

did I explain myself?

an then, what would be approximately the minimum speed for re charging, because, if I turn on the drive MOSFET for re-charging, in some moment the car will be almost stop, and it will start flowing current in the normal way and it will start accelerate... am I wrong? so the re-charge time should be moderated to don't start accelerate again when you don't want...?


----------



## PStechPaul (May 1, 2012)

Regeneraive braking for a brushed DC motor is not as simple as it may appear. Here is a short discussion in the sci.electronics.design NG about the principles:
http://sci.tech-archive.net/Archive/sci.electronics.design/2006-07/msg03365.html

Here is a user manual for a regenerative drive that describes the operation as being in the second and fourth quadrants of operation which is where the motor torque is opposite the direction of shaft rotation:
http://www.kinecor.com/documents/catalogues/minarik/MDManuals/250-0265.pdf

The usual freewheeling diode across the motor essentially shunts the inductive current but does nothing with BEMF since it is in the reverse direction. But AIIU for dynamic braking or regenerative drive you need to apply a load to the motor which will dissipate power or cause the bus voltage to be increased by the BEMF and thus charge the bus capacitors or batteries.

Here is another discussion:
http://electronics.stackexchange.com/questions/16654/braking-a-dc-brushed-motor

Since BEMF will always be less than the drive voltage at maximum motor speed, it will never be enough on its own to charge the batteries. So you will probably need to apply some sort of wide range DC-DC converter to the motor during braking, to extract maximum power. It may be possible to design a circuit which uses an inductive boost converter topology to do this conversion as part of the PWM drive. Essentially you would need to shunt the motor current through an inductor or use the motor's own inductance to get the inductive "kick" and a voltage high enough to charge the batteries. 

This is essentially a "brain dump" so please don't just accept what I'm saying without verification. Usually there is a freewheeling diode across the motor to give the current stored in its inductance a path when the drive current is switched off. Without it there could be a very high voltage inductive kick. But that is just energy stored in the motor's inductance, and its polarity is opposite that of regeneration or BEMF. I think it is possible to use this energy to charge a capacitor instead of dumping it through the freewheeling diode.

But then, for braking, the motor becomes a generator, and if the drive is off, it does not provide any braking action. You can put a load on the motor, however, and convert that BEMF to energy and stopping power. ISTM that this could be done by using the high side IGBT or MOSFET to apply the motor's output to an inductor and create a boost converter, whose output would be used to charge the bus capacitors or batteries. I'll try to do a simulation and get back to this...


----------



## major (Apr 4, 2008)

PStechPaul said:


> Regeneraive braking for a brushed DC motor is not as simple as it may appear.


But it is, except for series wound motors. But for PM and shunt (or SepEx) brushed DC motors, regen is simple when your drive is a half bridge or H bridge as explained in the reference I cited in post #24.

I think you are really confusing the issue. One of the references in your post is for a DC drive intended to operate from the AC mains through a rectifier. It cannot regenerate back through the rectifier, so requires a dump circuit to bleed off the DC bus for second and forth quadrant operation, ie. dynamic braking. But for DC drives using battery supplies and non-series motors, regeneration is commonplace.


----------



## joamanya89 (Feb 13, 2012)

Allright, it is getting quite interesting!, At least for me...

I agree with you major, that one of the reference was for AC-DC conversion energy, and it does not have relationship with these case, but, one thing that PstechPaul had say make sense, and is that the motor as a generator would never get enough voltage (at least in the regenerative braking, perhaps in a free falling by a mountain it can).

I've been reading about the theory and the "freewheeling diode across the motor", and lets try to make it works:

As I see, in these case the Flywheel MOSFET works as the freewheeling diode...









Now, the situation is that I would never get enough voltage to re-charge the battery, at least,if I use a DC-DC converter or a "charge bomb" with capacitors, in the second situation, do you know if the capacitors could be a LOAD for the motor to brake the car?

if it is like that, if the capacitors could be a LOAD, then I could make a "charge bomb" and use it first to brake and then to high up the voltage and re load the battery (using motor as generator and capacitors in siries)

Am I going wrong with these idea...?


----------



## major (Apr 4, 2008)

joamanya89 said:


> Allright, it is getting quite interesting!, At least for me...
> 
> I agree with you major, that one of the reference was for AC-DC conversion energy, and it does not have relationship with these case, but, one thing that PstechPaul had say make sense, and is that the motor as a generator would never get enough voltage (at least in the regenerative braking, perhaps in a free falling by a mountain it can).
> 
> ...


Again from post #24: 


> The way this works is that the reversed motor current is now a forward current to the flywheel MOSFET so when this is on it shorts out the motor - whose braking current rises during this period (arrow B, reversed). The Flywheel MOSFET now turns off, but this current must keep flowing - because of the motor's inductance. So it flows as reverse current through the drive MOSFET, recharging the battery as is does so.


Once you grasp this concept, you'll see the simplicity. All you need to do is leave the flyback MOSFET on and the current will reverse and then start modulation to use the half bridge and motor inductance as a boost converter to raise the generated voltage from the armature above the battery potential.


----------



## PStechPaul (May 1, 2012)

OK, I've been busy with this, and from what I can tell the circuit cited with the SG3524 does not accomplish regeneration. In fact there is this:
The circuit is current limited in drive mode but if you were to start a vehicle at the top of a hill and go in to regen braking downhill, there is nothing to limit the regenerated current. It is quite possible to add limiting to the regen braking and 4QD have a uniquely simple and efficient way of doing this - the like of which I have seen nowhere else. You'll have to join 4QD-TEC to get detail!​The circuit shown alternates drive to the top and bottom MOSFETs. When the top MOSFET is driven, it shorts out the motor, and performs dynamic braking by dissipating the motor's output as a generator, but there is no regeneration. The idea of using the motor's inductance is reasonable but not trivial. I have made a simulation that demonstrates how using inductance in the top side can achieve regeneration:










Note that V2 simulates the motor generating 12 VDC while the bus voltage is 24 VDC. The bottom MOSFET is off. The top MOSFET is modulated at 10 kHz with a 75% duty cycle, and the series inductor L2 in conjunction with a second winding L1 forms a boost converter, with voltage spikes that charge C1 until it exceeds the bus voltage and provides charging current I(v1). But the upper MOSFET's body diode is no longer across the motor so it may be necessary to add another one, D3. This is essentially the same as switching in a DC-DC converter across the motor for braking. 

It may be possible to use the motor's own inductance by modulating the upper MOSFET and tapping off the inductive spike, but the body diode still limits this to the bus voltage. However, this may be essentially the same thing and it may apply charging current to the bus. It is of opposite polarity to the original drive current, and thus when interrupted will drive the high side of the motor more positive, and the current will be pumped into the bus. OK, I think I see now! 

So, here is the simulation using the motor inductance. It actually works better than what I had above, and is much simpler and thus more elegant and, dare I say it, better! At least now there is a way to verify the operation and a tentative circuit which can be built and tested:


----------



## joamanya89 (Feb 13, 2012)

OK, I'll try to ask you some things, because o got a bit confuse but perhaps it was because of the english...

so, Paul yo say finally it is possible to do it on de major's way?

but I've seen you use some capacitors, I've been thinking about it, and I think I know how to use the capacitors but perhaps I'm wrong.

1st) why did you use the high mosfet at 75%? any reason or just random? why couldn't I use it at 100%?

2nd) once the high mosfet is on and the low one is off, shouldn't be there One capacitor of arround 13V (if my motor give's me 12v too when ir works as generator), then you use it in series with the motor inductance so you get arround 25V and it begine charging back the batteryes?


----------



## PStechPaul (May 1, 2012)

joamanya89 said:


> OK, I'll try to ask you some things, because o got a bit confuse but perhaps it was because of the english...
> 
> so, Paul yo say finally it is possible to do it on de major's way?
> 
> but I've seen you use some capacitors, I've been thinking about it, and I think I know how to use the capacitors but perhaps I'm wrong.


The capacitors are mostly to make the simulation work but there should be some anyway in a real circuit. 



> 1st) why did you use the high mosfet at 75%? any reason or just random? why couldn't I use it at 100%?


It cannot be 100% because the motor would be shorted. The ON time is to charge the inductance of the motor and the OFF time is to allow the energy to be dumped into the capacitor and the DC bus. The exact ratios and times must be determined by the actual components.



> 2nd) once the high mosfet is on and the low one is off, shouldn't be there One capacitor of arround 13V (if my motor give's me 12v too when ir works as generator), then you use it in series with the motor inductance so you get arround 25V and it begine charging back the batteryes?


It may be possible to use a "flying capacitor" circuit to transfer energy that way, but the inductance of the motor is more convenient and simpler.


----------



## joamanya89 (Feb 13, 2012)

so, if the capacitor was just to make the example works, you think using just the motor inductance and the motor movement am I going to re-charge my batteries?

I got lost a fwe post ago... the problem is I couldn't understan what did you write down, so I got a got a bis confussed...

these should work like these: .... ?

you modulate de PWM between 0% and 100% in the los MOSFET to power the motor, ok?

Then when you are not longer accelerating you turns off the los MOSFET and turns on the high MOSFET to handle the inductance of the motor.

Then when you accelerate again you turns off the high MOSFET and start PMWing the low MOSFET.

is it like that?


----------



## PStechPaul (May 1, 2012)

That's essentially all you need to do. But you must modulate the upper MOSFET in order to get regen. Turning it ON 100% would be like shorting the motor while it was generating and it could cause too much current through the MOSFET and cause it to fail. To do this properly, you should use a current monitor and determine when the current reaches a safe peak level, at which time you turn off the MOSFET drive and allow the inductive energy to flow into the battery pack to charge it. But you also need to make sure the charging current is not excessive, especially if your pack is already fully charged. In that case, you should just leave the top MOSFET off and allow the voltage to be generated without going anywhere. But you also need to be concerned if the motor spins fast enough to generate voltage greater than the pack voltage. In such a case the freewheeling diode would conduct and dump the current into the bus.


----------



## joamanya89 (Feb 13, 2012)

When the re-charge momento begins, I should modulate the high MOSFET, but also when I turn it off (ie: 75% on, and 25%of), in that 25% of the time, the low MOSFET must be turned on... because, if I don't do it, the current will not flow back to the battery, am I wrong?

And could you please explain what did you mean when you sayed: "In such a case the freewheeling diode would conduct and dump the current into the bus."

What de bus means?


----------



## PStechPaul (May 1, 2012)

You only need to modulate the top MOSFET. The current from the generating motor flows through it in the forward direction, and when it is turned off, that current will flow into the bus (which is just the main DC supply or battery bank + capacitors), through the "freewheeling" diode which is part of the lower MOSFET (or IGBT). Since it is charging the bus, the current flows in the opposite direction of that when the motor is being driven.


----------



## joamanya89 (Feb 13, 2012)

So the lowr MOSFET never turns of??










where in that image, where is missing the diode you are saying? because in that image if the los MOSFET is of, and the high one is on, it will not go current to the bus .


----------



## major (Apr 4, 2008)

Hey joama,

Do you read what I post? Do you forget quickly? Or don't believe me?



joamanya89 said:


> So the lowr MOSFET never turns of??





major said:


> 1.) Never turn both on at the same time. That is a shoot thru (shorts the DC bus).
> 
> 2.) When high side switch is on, low side is off. When low is on, high is off.





joamanya89 said:


> where in that image, where is missing the diode you are saying? because in that image if the los MOSFET is of, and the high one is on, it will not go current to the bus .


MOSFET devices always have an antiparallel or intrinsic diode. They are not shown in the diagram, but they are there.

The "high one" is called the Flywheel MOSFET in the diagram, correct? When it is on, it shorts the armature and inductance therein and there is no charge delivered to the DC bus during that period.


----------



## joamanya89 (Feb 13, 2012)

Really, sorry about my repetitive questions, but some times I get very conffused about the lenguage...! but really guys, I do belive and try everything you had tell me...

Now I had finish my "mini" power controll, the motor is working well, I'm doing some reserch to get a good re-charging to the battery pack.

Perhaps you could help me with a little problem, I needed to conect the MOSFET s using the same 15V than the res of the stuff (MOSFET driver, opto-isolator), because of a problem that you have to unificate all GND.

But to do it for real, I will need to fill the mosfets with 75V and the driver and opto-isolator with 15V..., how could I do to deal with the unificated GND?


----------



## PStechPaul (May 1, 2012)

It is frustrating for me because many of the questions are easily answered by means of a simple web search. Here are some resources that should provide all you need to know. I am hesitant to offer specific advice because a full power motor controller involves high currents and potentially lethal voltages and I am not confident in your abilities to understand what's involved. You must have a certain level of electronics knowledge and real world experience, which I have not seen demonstrated. If you have a small controller successfully running a motor, I'd like to see details such as a schematic and pictures or video, and a credible explanation of its operation. So here are some links:

http://www.analog.com/en/circuits-from-the-lab/cn0196/vc.html
http://www.irf.com/product-info/datasheets/data/ir2114ss.pdf
http://www.irf.com/technical-info/designtp/dt04-4.pdf

As you can hopefully see, there is no requirement for a common ground. The lower MOSFET can share the same ground as the battery negative bus, but the high side must be floating at the level of the drive voltage (battery supply bus), and of course the drive voltage must be 10-15V above that, depending on the gate characteristics.

If you have any specific questions on this material, I'd be glad to try to help. But I suggest that you build a half bridge circuit with bootstrap gate drivers, or at least use a simulator such as LTSpice, to learn how it works. Good luck.


----------



## joamanya89 (Feb 13, 2012)

First of all, don't worry, I wount try anything with out befor check it whith someone who really knows about ir, like showing it to you or someone else, ok?

Then, thank you very much for all the time you had give me, and for all your answers.

And 3th, I'll be back after I had readen all these material you had give me, and after having a good performance in my small controller!

Thanks again for your time


----------



## joamanya89 (Feb 13, 2012)

Hi, first of all, thank you for the links, and sorry if it is frustating for you, but it is not that easy for me to serch it on google on english and get the same resolts than you.

I'm reading them, as you had say it is not that hard, but I'll introduce more math on my circuito.

I'l let you know about my advances...

by the way, why do they say thatif a car says that has 100hp, in electrical motor is like 70hp? why that diference?


----------



## PStechPaul (May 1, 2012)

AFAIK most ICE motors are rated at peak "brake" HP which is the maximum it can possibly achieve under ideal conditions, and the actual output power on a vehicle will be considerably less, depending on fuel, atmospheric conditions, temperature, engine tolerances, and wear, plus the HP peak drops off sharply at other RPMs and load.

An electric motor, particularly a standard ACIM, is usually rated at true continuous power, and most can be operated at 2x-3x or greater torque for significant periods of time, and also can be overclocked with a greater frequency and voltage to get an additional 2x-3x power.

An electric motor also gives a relatively constant peak torque over a wide range of RPM, while in an ICE you must reach a certain speed to get the same torque. Sometimes this can be attained by a torque converter or by slipping the clutch, or with a variable ratio transmission.

But, in general, an electric motor of 1/3 to 1/2 the HP rating of the ICE will "feel" about the same, or better. 

The figure you mention, of a 70HP electric motor being equivalent to a 100HP ICE, may be the common conversion of true continuous to intermittent duty, which uses sqrt(2), or 1.414, or the inverse which is 0.707. But in my experience this is related to overload current (which is proportional to torque), so the losses at an overload of 140% doubles because of I^2R and requires a 50% duty cycle rating.


----------



## joamanya89 (Feb 13, 2012)

So in my case, a mehari says tha has 30HP, so with a motor that is 10.75HP cont, and 21HP pk I should be allright?

I'm trying to know which kind of motor, I mean the voltage an amperage to do every calculation that I need.


----------



## PStechPaul (May 1, 2012)

The Mehari engine was rated at 33HP peak, so it would be good to install an electric motor with a similar peak HP. Much depends on the actual type of motor you will use. Your 10.75 HP motor with 21 HP peak might be a little underpowered, but it should work OK. It's usually best to get a somewhat larger motor because it will be more efficient and will have more reserve power if needed. The actual power you get, and the torque to the wheels, depends on other factors, so try to come up with a complete package (motor, controller, and batteries), and it should be pretty easy to determine how well it will work for you.


----------



## joamanya89 (Feb 13, 2012)

Hi, all right, I've got my small controller workin great!, with all the capacitors working great, and the regenerative current is flowing ( I have seen it by tester, when the motor is working it flows positive to around 800mA, and when the motor is regenerating it flows negative a lot less than when is working but is ok, because the motor has almost no mass, so, physics says it's ok,  )

Now I've got these question, when I was checking the current flow at the same time I was checking the voltge between positive and negative on the motor, and it also was opposite as the voltage when the motor was working, but it was not that much, it was like, holding the voltage at some levels, but constantly going down, perhaps because of the no mass on the motor??

Or it should hold the the voltage level?


----------



## joamanya89 (Feb 13, 2012)

Hi, I have solved what I had poste before more or less, but the current is flowing back ok?, but... the motors isn't stoping any faster... didn't you say something about that the motor needs a load to stop? and that the batteryes o capacitors works like a load?, because my motor is not stoping, I mean, of corse is stoping but because it gas no more power but not stoping as a breack...


----------



## major (Apr 4, 2008)

joamanya89 said:


> Hi, I have solved what I had poste before more or less, but the current is flowing back ok?, but... the motors isn't stoping any faster... didn't you say something about that the motor needs a load to stop? and that the batteryes o capacitors works like a load?, because my motor is not stoping, I mean, of corse is stoping but because it gas no more power but not stoping as a breack...


It is difficult to understand what you write. But when regenerative braking occurs, the motor becomes a generator (or the source) and the battery is the load. If the motor (working as a generator) only has an inertia making it rotate, then if it delivers power to the battery, it will reduce RPM.


----------



## joamanya89 (Feb 13, 2012)

I'm sorry about my carelessness on my writing... I was in a hurry and I forgot to use a translator to help me.

But you had answer me exactly what I asked, thanks!

Everything is working great, but my problem is that I have just one little wheel rolling with my motor, so it has almost no mass, so is quite difficult to get a clear measurement of the current flow, I'll try to change it wheel, or to make up with something to fix these situation.

One thing I have noticed, is that my wheel doesnt stop quite fast when the reg brake works, should I espect something like a normal brake? or it doesn't stop that much?

Does the car that use reg-brake use a normal one too?

Have I been clearer on these post? It is important for me to write in a kindly way, so I can be able to keep a productive chat with you...


----------



## PStechPaul (May 1, 2012)

It will certainly help to add a flywheel to the motor shaft so it will build up rotational inertia energy and then you will be able to measure the current and voltage returning to the batteries and/or bus capacitors when you enable braking mode. It may not stop as quickly as a mechanical brake, and there is probably a lower limit at which the regeneration circuit will no longer be effective, because the voltage will be too low for it to work with. At that point, if you want effective braking, you may need to just apply a low resistance or short across the motor.

If you have some electronic equipment it would be helpful to take some measurements as the motor comes up to speed under load, and as it slows to a lower RPM when you brake it. You should use an oscilloscope to see the current rise in the motor inductance and the voltage spike when the short is removed. You should see current rise at a fairly linear rate and then level off as it nears saturation, at which point the short should be removed. When the current rise is much less than the peak you might as well just keep it shorted to complete the braking process.


----------



## major (Apr 4, 2008)

joamanya89 said:


> One thing I have noticed, is that my wheel doesnt stop quite fast when the reg brake works, should I espect something like a normal brake? or it doesn't stop that much?
> 
> Does the car that use reg-brake use a normal one too?


Of course the EVcar which has regenerative braking also has the original service brakes in place. Never rely on regen entirely, for safety sake.

As for the effectiveness of regenerative braking, I think it can do like 90% of the job of decelerating the EV in normal traffic driving. The propulsion system can use the same current level for both acceleration and deceleration, therefore the same torque. On the surface, this would mean that braking time would equal accel time. So for instance, 0 to 60 in 8 seconds; 60 to zero in 8 seconds. In the real world, aero drag and friction always work against motion (try to slow you), so the braking times turn out to be less (quicker) than acceleration times.

Same thing on the test stand. If your motor (& control) can accelerate to say 2000 RPM in 2 seconds, it should be fully capable of deceleration from 2000 to 0* in less than 2 seconds. Note that *, as you approach zero RPM, the generated voltage becomes too low and you lose the ability to completely stop. But this is typically very near 0 RPM.

If you are unable to quickly decelerate the motor rotor then I suspect your circuitry is limiting you. I might suggest that you fashion a test stand where you use a second motor to drive your test motor (acting as a generator) at a constant speed. This will give you longer periods for observation and adjustments. And also try generating into a resistive load in place of the battery. You might learn something


----------



## joamanya89 (Feb 13, 2012)

Thanks!, I had already thought on using a second motor, I'm making everything to approach to that model, then I'll tell you what my data is, by misfortune I do not have an oscilloscope, so, my data will be taken by using a stopwatch, and two testers, one for voltage, and other for amperage.

About the mechanical brakes, I've read that you have to use a vacuum pump (I know that de gas motors generate it self a vacuum), so actualy, the recovered energy in deed will be use to power the pump, perhaps not all of it, but a good part of it, isn't it?


----------



## joamanya89 (Feb 13, 2012)

Alright!!! MY WORK IS DONE!

My mini controller is working great with one battery for the uController, another one for my driver, and another one of course to drive the motor, the reg-brake is working great, the HI MOSFET is working at arround 80% when it is reging (the only thing I could improve is to get a current sensor (hall sensor perhaps), to improve the working cicle of the HIGH MOSFET.

Really, everything is done!

Paul, you have asked me before, that you wanted a report about my controller, to be sure I'm not going to kill my self when I do it for real, jaja , so, what kind of things would you like to know?


----------



## PStechPaul (May 1, 2012)

I see at least one problem with your circuit. R1 should be connected to the source of the top MOSFET and Vs, and not ground as you show. It might work as shown on 25V, but since Vs can go as high as 25V it will dissipate 625 mW and much more at higher bus voltage.

You also have Vcc tied to 25V, which is the absolute maximum rating. I assume that is the battery voltage, which is unregulated and could be higher. If you get regen, or during external charging, the voltage will go even higher. Check the recommended operating conditions for better values. http://www.irf.com/product-info/datasheets/data/ir2110.pdf

The optoisolators are probably not needed and must be fast enough to drive the PWM at the required frequency. It may not be good to rely on the internal pull-down resistors of the IR2110. The rise and fall times are about 20 uSec with a 1k load, which will limit the frequency to about 10kHz. And the 7402 does not have enough positive drive current for the optoisolator (and there are no current limiting resistors).

What I'd really like to see (other than waveforms and specific test data), is the microcontroller and the algorithms you are using to provide the PWM drive during motor run and regenerative braking. You really need current feedback to determine how to modulate the upper MOSFET for regen.

How do you know that you are getting regen?


----------



## joamanya89 (Feb 13, 2012)

PStechPaul said:


> I see at least one problem with your circuit. R1 should be connected to the source of the top MOSFET and Vs, and not ground as you show. It might work as shown on 25V, but since Vs can go as high as 25V it will dissipate 625 mW and much more at higher bus voltage.


Why do you just point on the 1k resistor that I should put between HO and Vs-Sourse? and you dont say anything on the other 1k resistor from LO to gnd? isn't it going to dissipate as much as the otherone?



PStechPaul said:


> You also have Vcc tied to 25V, which is the absolute maximum rating. I assume that is the battery voltage, which is unregulated and could be higher. If you get regen, or during external charging, the voltage will go even higher. Check the recommended operating conditions for better values. http://www.irf.com/product-info/datasheets/data/ir2110.pdf


I have already check on that values, and it doesn't say anything, How could I connect Vcc to a higher voltage than my maximum voltage....??



PStechPaul said:


> The optoisolators are probably not needed and must be fast enough to drive the PWM at the required frequency. It may not be good to rely on the internal pull-down resistors of the IR2110. The rise and fall times are about 20 uSec with a 1k load, which will limit the frequency to about 10kHz. And the 7402 does not have enough positive drive current for the optoisolator (and there are no current limiting resistors).


I need the optoisolator to isolate the uController to the power circuit.

Do you recomend me to use a higher resistor between HO and mosfet gate? and LO and mosfet gate?

About the 7402, I have notice you are right, but, what are my options? I need the oposite wave between HIN LIN


----------



## PStechPaul (May 1, 2012)

joamanya89 said:


> Why do you just point on the 1k resistor that I should put between HO and Vs-Sourse? and you dont say anything on the other 1k resistor from LO to gnd? isn't it going to dissipate as much as the otherone?


 The resistor from LO to GND will only see the gate voltage, which in the case of your design, will be 25V, but that is only because you are using 25VDC for Vcc, and it should be about 12-15V or whatever is optimum for the MOSFET gate drive. You MUST NOT use the 25V bus voltage for the gate drive, unless you add filtering and regulation and even then it should not be that high. I don't know of any MOSFET or IGBT that will be happy with 25V gate drive voltage.



> I have already check on that values, and it doesn't say anything, How could I connect Vcc to a higher voltage than my maximum voltage....??


 The recommended operating conditions on page 2 clearly state that Vcc should be between 10V and 20V. You have it connected to 25V which also appears to be the same as the DC bus voltage for the motor. I am assuming this is or will be a battery which will vary in voltage, rather than a tightly regulated 25VDC source from a laboratory power supply. You really need a totally separate Vcc supply and you should show the main DC bus as a battery, and specify its expected voltage range from fully charged to depletion. You also need a means for monitoring the voltage and current so the microcontroller can handle the charging and PWM for the motor drive and also shut down for undervoltage and other fault conditions.



> I need the optoisolator to isolate the uController to the power circuit.


Isolation is not really necessary. The IR2110 can tolerate up to 5 volts offset between power common and controller ground Vss. And both Hin and Lin are at logic level voltages with respect to Vss, while Vdd can be 5V or whatever your microcontroller uses. And the microcontroller can drive Hin and Lin directly.



> Do you recomend me to use a higher resistor between HO and mosfet gate? and LO and mosfet gate?


The value you have (22 ohms) is about right. You may need to adjust it to change the gate drive transition to reduce transients. For that (and any serious design) you will need a scope.



> About the 7402, I have notice you are right, but, what are my options? I need the oposite wave between HIN LIN


If you must drive an optoisolator with TTL logic, you should use logic low to provide the current through its LED. It may seem like a good idea to use external logic to avoid simultaneous drive of both MOSFETS, but proper design of the microcontroller should take care of that. Otherwise you must carefully analyze the propagation delays through the logic circuit as well as the optos and the IR2110 and make sure there is a deadband long enough to endure the top MOSFET is off before the bottom is ON, and vice versa. Some micros have that built in to their PWM modules. Or you could use a half-bridge driver that has the logic built-in. 

These are all basic fundamental design principles, and need to be fully understood before proceeding to anything using serious power levels. I hope you know what you are doing and take things carefully, and please get the proper equipment and take lots of measurements to prove your low-power circuit before proceeding further. Good luck!


----------

