Jump to content
Electronics-Lab.com Community

motor driver L298 help


Recommended Posts


The L293 and L298 are just high current electronic switches. You need to drive them with a PWM circuit for speed control.

PWM is Pulse-Width-Modulation and it pulses the the electronic switches at a high frequency. Wide pulses make full power and narrow pulses make low power. The PWM circuit can make pulses of any width so can adjust the power or speed of DC motors to anything in their range.

Link to comment
Share on other sites

MP.
You can vary the width of TTL or Cmos pulses, or keep the "on" time of the pulses the same and vary the speed of the pulse stream as you say, to change their duty-cycle for PWM.

I hope you don't mean to change the speed of the oscillator as in our project that doesn't work: http://www.electronics-lab.com/projects/motor_light/033/index.html

post-1706-14279143088844_thumb.png

Link to comment
Share on other sites

No, You don't even need to change the width of the pulse to change speed. No, I am not talking about anything that has to do with "Pulse WIDTH Modulation", including any of the projects. I am talking about basic TTL clock signals that have been around for years. Simple. Change the clock speed and you change the speed of the motor. The signal is a 50% duty cycle and the pulse width is never intentionally modified. PWM or 'Pulse Width Modulation' works on the principle of changing the ON time vs OFF time of the individual pulse. This is not needed. A simple clock pulse stream of 50% duty cycle will vary the speed of this chip easily when you change the speed of the clock. When you change the speed of the clock, this is not PWM. Thus, PWM does not even come into play. I hope this explains it in a way that you now understand.

MP

Link to comment
Share on other sites


No, You don't even need to change the width of the pulse to change speed. No, I am not talking about anything that has to do with "Pulse WIDTH Modulation", including any of the projects. I am talking about basic TTL clock signals that have been around for years. Simple. Change the clock speed and you change the speed of the motor. The signal is a 50% duty cycle and the pulse width is never intentionally modified. PWM or 'Pulse Width Modulation' works on the principle of changing the ON time vs OFF time of the individual pulse. This is not needed. A simple clock pulse stream of 50% duty cycle will vary the speed of this chip easily when you change the speed of the clock. When you change the speed of the clock, this is not PWM. Thus, PWM does not even come into play. I hope this explains it in a way that you now understand.

MP


No it doesn't!
If you change the frequency of a square-wave that feeds a DC motor, the motor receives an average of half the supply voltage at every frequency until the frequency becomes so high that the inductance of the motor reduces its average current and slows it down.
With a 50% duty-cycle, the motor receives full voltage for half the time and no voltage for the other half of the time. The motor's speed doesn't change when the frequency is changed.
Link to comment
Share on other sites

Hi AG,

That’s correct but; the torque does change long before this point (and thus the rpm under load) due to the inductance of the motor winding. When constructing a PWM controller for a motor there is some consideration regarding the frequency vs the inductance. This means that you need to know in which rpm range you are using the maximum torque when deciding the frequency.
If you need to change the rpm without changing the pulse length it’s done by the amplitude.

Link to comment
Share on other sites


Hi AG,

That’s correct ...

Thanks, Ante.
A tutorial about DC motor speed controllers by a major golf cart speed controller manufacturer says that when a free-wheeling diode is added across the motor to make it more efficient, then the frequency doesn't matter. The motor's inductance doesn't reduce the speed or torque, it just smooths the pulses. They say that frequencies below 20kHz are avoided due to the whining noise from the motor, and frequencies above 1MHz are avoided due to heating and radio interference. Of course they use PWM to control the speed like everyone else.
Link to comment
Share on other sites


No it doesn't!
If you change the frequency of a square-wave that feeds a DC motor, the motor receives an average of half the supply voltage at every frequency until the frequency becomes so high that the inductance of the motor reduces its average current and slows it down.
With a 50% duty-cycle, the motor receives full voltage for half the time and no voltage for the other half of the time. The motor's speed doesn't change when the frequency is changed.


Oh, yes it does.....I think you have once again become argumentive on a device you have never used....Your statements would be true if you were feeding the signal directly to a motor. I think both of you have missed this detail. We are discussing the input of the L298. Not a motor.

In our discussion, we are feeding a clock signal directly to a L298, which runs on TTL clock signals. We are not feeding a direct voltage to a motor. If you are going to use PWM, you would have no need for the L298. It is all in the data sheet. There is no mention in the data sheet about changing amplitudes of signals or PWM. I have designed a good share of automated equipment with the L298. I'm not guessing, here....oops!, I mean this is not "Theory"  ;D

MP
Link to comment
Share on other sites

No MP,
The "enable" inputs of the L298 are used to turn it on and off with PWM pulses to control the speed of a DC motor. The inputs need very low current so work with TTL or microcontroller logic levels.

Of course the L298 is needed if you are using PWM to control the speed of a DC motor. The L298 is a dual full bridge with 2A output to feed a motor. It has inputs for forward, reverse and stop and the enable input for PWM.

Here is a DC motor speed control tutorial about using a microcontroller to apply PWM to an L298:
http://www.robotbuilder.co.uk/Resources/Articles/152.aspx

Link to comment
Share on other sites

The guy in the tutorial had a hell of a time making this work. You go ahead and make it any way you want, audioguru. Could you please explain the code in the link you have cited as the reason you disagree with me? oops. Sorry. I forgot. You do not know how to program a micro.

But going back to the original comments: Rod.Rahul was told that PWM was required. As I posted above, Rod, you do not require PWM for speed control on your L298. You can go ahead and use the PC control that you want to use with simple pulses. This can be through serial or parallel ports. My automated drill uses this principle. I use the up and down arrow on my pc keyboard to control speed of the feed. No PWM.

MP

Link to comment
Share on other sites

MP.
You don't control the speed of a DC motor by the frequency of square-wave pulses that are fed to it. The speed is controlled by the duty-cycle of the pulses which is PWM.

The guy in the tutorial showed how a cheap motor created huge current spikes. It looks like its brushes short together segments on its commutator. He shows how a good motor works fine with PWM.

oops. Sorry. I forgot. You do not know that we are talking about a DC motor with brushes and a commutator, or a brushless motor with an electronic commutator. You must be thinking about a stepper motor.

Link to comment
Share on other sites

Both of these chips are nothing more than CURRENT drivers for inductive loads. I have to go with Audioguru on this one, in that speed, of a DC motor is controlled by PWM or voltage change (resulting in a current change). Just about every "driver", at least the ones I've seen in DC-DC's are TTL compatible, so that don't mean much in terms of control method. A fixed duty cycle, change the frequency approach, I would speculate only works for the very reason Ante stated... your basically starving the inductance of current (L*di/dt ... the applied V is so short, the "i" can't ramp to a high enough level to develop any torque), so it slows down. If this is wrong, I'd love to see the math that supports the "change the frequency approach", as it might be fun to try and apply it somehow to DC-DC's over a limited range.

Link to comment
Share on other sites

Indulis,
You are correct, the fixed frequency method works because of the inductance, or more correctly, the impedance, of the whole motor.  At a low frequency, Lets say 0hz – DC,  the motor sees the full power as current through the windings and thus produces a magnetic field resulting in motion.
As the frequency rises the coils begin to interact with the power in the current and some of that current is blocked resulting is losses through heating.  As the frequency changes there are nodes (harmonics) that will produce better or worse power but they are not wide enough to use for accurate control. 
While Frequency COULD be used to control the power the motor generates it is not efficient as the full power of the supply is tapped and depending on the frequency, much of it could be lost to heating the coils.

Now on AC systems there is a whole different system.  When the motor is an inductive armature frequency IS the best way to control it.  PWM switching is very noisy on AC circuits as the switching usually takes place using an SCR and the resulting RF noise from the sudden switch on in the middle of a cycle causing energy loss and other issues.  While IGBTs and BJT’s can be used to switch more slowly, they tend to heat up and can not carry as much load as an equal SCR.

The devices used are called VFD’ (Variable Frequency Drives) these drives manipulate the AC signal of 1,2, and 3 phase power to control AC motors.  The phased outputs are changes in frequency and thus the magnetic fields on the armature rotate faster.  Most drives range from 0 – 400hz.  I have several of these drives that control 30 to 50 hp 3 phase motors.  To watch one of those things speed up and slow down like a servo motor is quite impressive.  In fact, given the right motor design and VFD, you can even drive them backwards by flipping 2 out of  3 phases.

Stepper motors are also frequency dependant.  The chips we are talking about are mostly used to drive stepper motors.  Of course stepper motors do not use PWM to control speed, but rather a series of on and off signals on 3-6 channels that are repeated at a regular interval.  If you had a chip that generated the drive signals for the steeper with each pulse, it could be said that the speed of the motor is frequency driven but not the power.

In general, for Brushed, Perm Magnet, DC motors. PWM is the best method for both power control.

-Mike


post-21534-1427914311276_thumb.jpg

Link to comment
Share on other sites

Hi AG,

I couldn’t care less about the way a golf carts drive system is constructed! I know from experience how torque changes and how it’s possible to optimize it by changing the frequency of the PWM. There are even times when there is a substantial gain in changing the frequency within a certain range in proportion to the rpm to have maximum torque over a wider rpm range. But as far as I know only changing the pulse width is a proper way to control the rpm.

Link to comment
Share on other sites

Thanks AG,

I’ll brows through it!

Just a short comment at this stage;
This is a local UK manufacturer unknown to me. I am familiar with some of the stuff manufactured by for ex. Zapi, Sevcon, General Electric, Cable Form, Curtis, Linde and Sigma to name a few.
I did not expect to find any deep going presentation on how to construct a PWM circuit and this was immediately underlined, quote: “4QD manufacture PWM speed controllers for electric motors so you will hardly expect us to give you all our own unique circuitry and technical know-how”  ;)

Link to comment
Share on other sites

Where in Rod's post did he say he was specifically refering to a DC motor with brushes and a commutator, or a brushless motor with an electronic commutator?
Seems you have hijacked another thread to discuss your own subject....

In fact, it seems that you have scared Rod away. He hasn't posted since you started digging on him.

MP

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...