EmbeddedRelated.com
Forums

motor driver circuit

Started by Vecheslav Silagadze March 29, 2004
If you want a nice clean square wave, drive a resistor. Theoretically
the inductive kick back is infinite. I don't think that 20 khz is fast
enough to need external diodes. I have found transzorbs at 1.5X the
operating voltage and 2X the motor power to be fairly bullet proof
protection for everything.

Chad
--- Vecheslav Silagadze <> wrote:
> Thank for the replys,
>
> I'm not using discrete FET's for the circuit - I bought a few L298's,
> which
> are an integrated package with 2 H-bridges - 2A each. Takes up
> *a-lot* less
> space on the board than 8 MOSFETs.
> Regarding using caps on the motors - interestingly enough I tried
> this and
> found that the motor with the caps runs much slower at the same
> voltage/current. I guess this is to be expected since you're bound to
> have a
> lot of losses through the cap at 20kHz PWM. So I just decided to
> avoid
> putting them in at all.
> Regarding the diodes, I am using 1N5819 diodes - they are 1A and
> looks like
> they are just the lower current counterpart for the 1N5822's (which
> the H
> bridge.)
>
> I had a MOSFET bridge a while ago as well, before I decided to switch
> to the
> L298, and I found that it was giving the same kind of kickback as
> it's
> giving me now - even though the FETs had built in zeners. I don't
> know if
> this is just something standard, or what, but have anyone looked at
> the
> output of their bridge with a scope and confirmed a nice clean square
> wave?
>
> Mine seems to have a lot of kickback on the on-off switch, and
> virtually
> none on the off-on. I checked the diodes a 1000 times and I'm sure
> the
> circuit is fine.
>
> Vecheslav Silagadze >
<<< snip >>>

=====
My software has no bugs. Only undocumented features.

__________________________________



The spikes are really only a problem if the driver is failing. Even the simple 1N4000 should easily
clamp the spikes.
But if the main problem is lack of torque I suggest you look elsewhere...the spikes most likely
has nothing to do with it.
Do expect 100% torque at 100% PW.
Do NOT expect 50% torque at 50% PW. Depending on frequency and motor inductance
the PW and current is not linear....
To get 50% torque it is not uncommon to need 80-90% PW.
Steppers are basically 'current driven', so as RPM goes up so does the voltage....
to get good speed and torque from a common '5V' stepper you may need 20-40V !
 

Vecheslav Silagadze wrote:

 "A much better choice is the National LMD18201 MOSFET H-bridge. It can
handle 3A and does not get hot with a reasonable sized heat sink and
has very little voltage drop."

Oh great... now you tell me :)
I'll keep that in mind for my next project.

I am getting a voltage spike way over my Vcc actually - nearly 2xVcc
in fact. The motor still runs, but it gives pretty much zero torque
at around 30% duty cycle.
I will assume it is the clamping diodes that are causing the problem
and look for faster recovery ones (even though at 20kHz I can't
imagine any kind of diode won't switch fast enough... the 1N5819 I'm
using should be more than adequate.) I've checked the circuit many
times over and I'm certain that the topology is fine.

Vecheslav Silagadze

--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Best Regards
Eirik Karlsen
 


On Tue, 30 Mar 2004, Dave Mucha wrote:

> --- In , Eirik Karlsen <eikarlse@o...> wrote:
> > Well....I'm not sure what you mean with 'kick-back', but if it is
> only a small spike observed on the scope
> > then I'd say 'don't worry'. If you've made a sensible choise of
> output diodes then the spikes will be
> > limited to VCC and GND. > A motor coil is an inductor and will act just like one.
>
> Put power on it and it will resist the current by storing it in a
> magnetic field. Remove power and as the magnetic field breaks down,
> it will release the stored power.
>
> Depending on the size of the coils in the motors, you would probably
> get about 30% more voltage than you were supplying and could easily
> get a few amps.
>
> I'd expect way more than a blip on a scope.
>
> In fact, when using stepper motors, the back EMF offsets a drop in
> the power supply when switching from one coil to another.
>
> I like to select the diodes by a factor of 2 regarding both voltage
> and current as to what is supplied to the coil.
>
> This is similar to relays, the colapse of the coil will deliver a
> spike back into the device driving it.
>
> Dave
>

More than that, a real problem with steppers is not the voltage
amplitude on the coils, or the "self-induction" which can be suppressed,
even for high frequency driving (supplying the coils under constant
current from a potential much higher then the nominal voltage of the
motor, and switching very fast that current into the coils) but the
natural resonance frequency of the motor, which could kill your driver
stage, (or just shock your ears...) only when the command pulse match with
the motor resonance.

best regards,
Vasile


On Tue, 30 Mar 2004, Eirik Karlsen wrote:

> Dave,
> yes I'm aware of all this, infact I once exploited the back EMF to make a simple HV generator.
> It ran on 12VDC and had a transistor switch a simple inductor (not a transformer).
> Then rectified the spike on the CMOS drain and got about 2KV.
> It was a 1200V transistor so I think the voltage were limited by the transistor's breakdown voltage!
>
> But if you look at the L298 application note you'll se that each of the 4 outputs is clamped
> by two diodes, one to VCC and the other to GND.
> So if suitable diodes are selected, they are mounted in the correct direction, and the PSU
> has some minimal capacitance across it, then the EMF-spikes will be limited to the
> PSU rails (+/-0.7V or so).

There is no necessary connection between PSU output capacitance and EMF
here.
Any PSU have a small output impedance which will "eat" the switching
pulses through that diodes you are talking about. The output capacitor of
a regulated PSU is just for stability and does not affect
significatively the output impedance. Usualy it has a much larger value
that it's required.

best regards,
Vasile


Not necessary, but possible......
If he'd used 6ft of thin wires  from the PSU and and no decoupling cap. across the bridge
then spikes is only to be expecte...diodes or no diodes.

Vasile Surducan wrote:

 
 

On Tue, 30 Mar 2004, Eirik Karlsen wrote:

> Dave,
> yes I'm aware of all this, infact I once exploited the back EMF to make a simple HV generator.
> It ran on 12VDC and had a transistor switch a simple inductor (not a transformer).
> Then rectified the spike on the CMOS drain and got about 2KV.
> It was a 1200V transistor so I think the voltage were limited by the transistor's breakdown voltage!
>
> But if you look at the L298 application note you'll se that each of the 4 outputs is clamped
> by two diodes, one to VCC and the other to GND.
> So if suitable diodes are selected, they are mounted in the correct direction, and the PSU
> has some minimal capacitance across it, then the EMF-spikes will be limited to the
> PSU rails (+/-0.7V or so).

  There is no necessary connection between PSU output capacitance and EMF
here.
  Any PSU have a small output impedance which will "eat" the switching
pulses through that diodes you are talking about. The output capacitor of
a regulated PSU  is just for stability and does not affect
significatively the output impedance. Usualy it has a much larger value
that it's required.

best regards,
Vasile
 


--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Best Regards
Eirik Karlsen
 

--- In , Eirik Karlsen <eikarlse@o...> wrote:
> The spikes are really only a problem if the driver is failing. Even
the simple 1N4000 should easily
> clamp the spikes.
> But if the main problem is lack of torque I suggest you look
elsewhere...the spikes most likely
> has nothing to do with it.
> Do expect 100% torque at 100% PW.
> Do NOT expect 50% torque at 50% PW. Depending on frequency and
motor inductance
> the PW and current is not linear....
> To get 50% torque it is not uncommon to need 80-90% PW.
> Steppers are basically 'current driven', so as RPM goes up so does
the voltage....
> to get good speed and torque from a common '5V' stepper you may
need 20-40V !
>

If you up the voltage, you need to limit the current.

Also, I'm not sure if this is a stepper motor as I missed the
beginning of the thread, but a stepper motor is a constant power
device and will deliver all it's power in one step, but the torque
will be spred over the number of steps.

That means a motor at 1 RPM is delivering the same power as a motor
running 1,000 rpm. The difference is that the torge per step is huge
at 1 rpm, and you only get 1,000th of that when running at 1,000 rpm
and at some point, the motor will not have enough torque to spin
itself and it will stall.

Dave



OK. I can see from this and some other post that there is a
misunderstanding about what a fast recovery diode is. The "fast
recovery" refers to the diode's ability to switch from reverse bias
(which is what it is in when the PWM output to the motor is high) and
forward bias (which is what it is in when the inductive kick-back is
being absorbed by the power supply). This must happen very fast in a
PWM motor driver, regardless of the PWM frequency. The time between
when you are driving current through your motor coil and when you
shut off that current is very short indeed. The diode must switch
between reverse bias and forward bias very fast so that it can pass
the current that suppresses the inductive kick-back voltage. If the
diode is too slow to recover, you will get a voltage spike before the
diode switches to forward bias.

Sorry for the long narrative. I hope it helps the group understand
PWM circuitry a little better.

On your other zero torque issue - it is common to see almost no
torque down around 30% duty cycle. The last gearmotor that I used did
not even start to rotate until about 50% duty cycle. When it did
start rotating, it had a high torque. > I am getting a voltage spike way over my Vcc actually - nearly 2xVcc

If your circuit is correct, you can see that this voltage will never
exceed a diode forward drop voltage above Vcc IF your diode recovers
fast enough.

> in fact. The motor still runs, but it gives pretty much zero torque
> at around 30% duty cycle.
> I will assume it is the clamping diodes that are causing the
problem
> and look for faster recovery ones (even though at 20kHz I can't
> imagine any kind of diode won't switch fast enough... the 1N5819
I'm
> using should be more than adequate.)

Yes it should. If you try new diodes, try the 1N5822. I've used these
with great success (basically the same as the 1N5819 but with more
forward current and fwd surge current - this might make the
difference).

I've checked the circuit many
> times over and I'm certain that the topology is fine.
>
> Vecheslav Silagadze
>



> On your other zero torque issue - it is common to see almost no
> torque down around 30% duty cycle. The last gearmotor that I used
did
> not even start to rotate until about 50% duty cycle. When it did
> start rotating, it had a high torque.

That's interesting. Why is the power being eaten up like that?
Conceptually it would seem that at 30% duty cycle I should be getting
100% torque with 30% speed because I'm delivering 30% of the power I
would be delivering at 100% duty cylce. But I guess this is one more
of these places where theory meets reality :)

I will try a fast recovery diode, but I'm basically limited to what
the local Sayal Electronics carries - from what I remember the "best"
diodes they had were the 1N5819s. It's unfortunate, but it seems that
the datasheet on the 1N5819 doesn't specify the recovery time (the
L298 driver I'm using asks for <200ns...)

Vecheslav Silagadze