Author Topic: Motor Drivers Tutorial  (Read 11614 times)

0 Members and 1 Guest are viewing this topic.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Motor Drivers Tutorial
« on: July 14, 2008, 08:24:09 PM »
Hi All,

I've just completed a new tutorial on Motor Driver circuits at http://www.societyofrobots.com/member_tutorials/node/159

This covers various DC motor H-bridge circuits, as well as bipolar and unipolar stepper motor drivers using current choppers.

Each of the drivers is the same as far as the micro-controller is concerned and only requires 2 I/O pins per motor allowing it to control: speed, direction, coasting and braking. This is done via a 'tri-state switch' and there is a section that describes how this input element works.

I've tried to give examples of costs and have also tried to stick with ICs rather than using transistors/heat sinks etc. I believe the circuits will be suitable for most small robots - of course if you are building a 'life size tank' then you may need something more beefy.

I've tested these circuits out via breadboarding etc but can't guarantee I haven't introduced some errors when transposing to circuit diagrams.

If you find any 'whoopsies' then let me know.

Cheers and enjoy !

Webbot

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: Motor Drivers Tutorial
« Reply #1 on: July 15, 2008, 06:45:03 AM »
Looks pretty cool. I assumed it talks about hardware choppers, though.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #2 on: July 19, 2008, 11:00:25 AM »
Quote
I assumed it talks about hardware choppers, though.

It does talk about hardware choppers in the stepper motors section http://www.societyofrobots.com/member_tutorials/node/168

Is this what you meant by 'chopper' ?
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: Motor Drivers Tutorial
« Reply #3 on: July 19, 2008, 02:36:30 PM »
Well, yes, but we want pictures and schematics :D I've been trying to make an usable chopper circuit for ages.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #4 on: July 19, 2008, 06:32:26 PM »
You obviously haven't bothered to drill down into the pages - as there are schematics (both in line and as downloadable PDFs) !
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: Motor Drivers Tutorial
« Reply #5 on: July 20, 2008, 04:15:06 AM »
Actually, I did. I'm really hoping someone who knows about chopper stages would explain the analog stuff one day. I could have missed it though, although I took the tutorial page by page. Now, we might be talking about different things, you know. The tutorial is pretty good, I thought I knew everything about power driving, apparently not :) But I am talking about schematics on choppers
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #6 on: July 20, 2008, 11:57:49 AM »
I agree - we may be talking at cross purposes.

In the stepper motor part of my tutorial we use a 'chopper' to minimise the amount of current required to make the motors perform a 'step' and don't waste current once the motor has done it. This is done via hardware - ie resistors monitor the current in the motor coils, this generates a voltage across a resistor, which is compared against a reference voltage to decide when the motor has received 'enough' current to do a step, so that we can stop wasting further current through the coils to no additional effect.

With DC motors there is an implied 'chop' by using PWM - ie by switching the power on/off the 'average' or 'root mean squared RMS' voltage applied to the motor is dictated by the ratio of ON to OFF time in the PWM. The whole point of using PWM is that it uses the full voltage to the motor but by continuously turning this on and off then we simulate produce a voltage between 0v and the maximum.

The tutorial has the schematics, but I'm not sure how a photo of a 'chip' will help you to understand the principal ?

What do 'you' mean/require re 'chopper' ?

Want to help - but need more info from you as to what you think a 'chopper' is.



Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: Motor Drivers Tutorial
« Reply #7 on: July 20, 2008, 12:08:59 PM »
Nope, we're talking about the same chopper, although, i was asking for chopper schematics, while you were talking about overall schematics.
I am reffering to a more specific type implementation. Don't get me wrong, the tutorial is great, but I was actually expecting more info on choppers. For example, choppers are used on high end stepper controlers to limit current. You control a microstep via pwm (20-30khz) and this pwm is actually an enable signal for a very high speed (self-oscillating - over 100khz) chopper. Changing the pwm would alter the microstep, while changing the reference voltage would limit the current through the windings.

I'm actually trying to build such a device, with the implied simulations for some time, but everything that resulted was too expensive or using inexistent devices (transistors with very small gate capacitance and internal resistance, f.i.).

But this is exactly the same chopper you were talking about, albeit, in a more specialised context. A public schematic for the community would do lots of good, since everyone would be able to make flexible stepper controllers with microstep capability. If you do have more info on this topic, do let us know, or publish it in the tutorial! It's interesting to say that you make a step and use the detent torque afterwards since this is very inefficient, but the tutorials talks about a completly different concept. I might just be wrong, anyway.

This is one of the best info I found on the topic, btw.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #8 on: July 20, 2008, 05:52:25 PM »
Ok - so we ARE talking the same thing. And my schematic does exactly what you say:- PWM for speed, and a trimmer to control current.

The reason I haven't given the schematic for the chopper circuitry itself is that it is all bundled within the L297 chip that I have used - except for the high wattage current sense resistors and the trimmer that is used to adjust the reference voltage that the L297 chopper then uses to control the current. The L297 datasheet gives some explanation as to how the chopper works internally so there's no point me re-iterating it.

It sounds as if you are wanting to build the whole chopper circuitry yourself? The L297 is specifically designed as a stepper motor controller so I don't see why anyone would want to replace it with their own design made up of other discrete chips/resistors/caps etc. After all: the $50 robot doesn't give you a schematic of how to build your own ATMega8  ;)

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: Motor Drivers Tutorial
« Reply #9 on: July 20, 2008, 06:34:52 PM »
L297 does not have a chopper circuit, it simply has logic gates on inputs, which adds an enable/pwm channel. That's not a chopper.
A chopper is usually controlled by an external reference voltage, which controls the duty cycle of a very high frequency pwm (>100khz)
This pwm is then anded with another, medium frequency pwm (usually audio, 20khz or 25khz) which controls the microstep position.

Changing the reference voltage will change the torque, changing the duty cycle of the lower speed pwm will change the microstep position (so you can do several substeps in a single step, thus making the stepper move smoothly and reduce oscillations). Now, you can do this, of course, with two pwms, although you'll lose resolution, and you must generate the both. Or, you can let a chopper oscillate and do the high speed pwm for you.
The problem is, you can't do both with L297. So you'll either have current control or microstepping.

You seem to know a lot about stepper control, so I assumed you know about this control mechanism, too. I'm simply asking you, if you know about this, tell us more. Draw some pictures, make a simulation or something, explain it :P
Here's another reason to make your own discrete stages: L297 is a power waster, and only goes up to 2 amps. I've been trying to make a good one for ages :P
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #10 on: July 21, 2008, 05:20:02 PM »
When you say
Quote
L297 is a power waster, and only goes up to 2 amps
- you've just shot yourself in the foot !! The L297 is purely a TTL level chip - it is not an output stage. It only works at 5v and a few milliamps. So I think you are confusing it with some other output stage like an L293 or L298. So PLEASE PLEASE PLEASE go to google and type in 'L297 datasheet'. Whilst you are in the PDF you can read about its 'chopper circuit'.

If you still have questions then perhaps you could quote a page number and text from the datasheet?

RTFM  ;)

Webbot

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #11 on: August 07, 2008, 05:59:32 PM »
izua - did this help?
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline KRGrindley

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Motor Drivers Tutorial
« Reply #12 on: May 07, 2009, 05:04:55 PM »
Just a note, I had to put a pull down resistor (1Mohm) between the enable/disable pin and ground to get it to work properly.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #13 on: May 08, 2009, 06:52:03 AM »
Thats interesting - I didn't have the problem.

Which of the 3 boards did you have this problem with?

Silly question I know but I presume the enable/disable pin was connected to something and not just left floating?

Thanks for the feedback
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Motor Drivers Tutorial
« Reply #14 on: May 08, 2009, 08:32:11 AM »
if the enable/disable pin was left floating wouldn't it just "stutter" to say?
Howdy

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Motor Drivers Tutorial
« Reply #15 on: May 08, 2009, 08:59:27 AM »
if the enable/disable pin was left floating wouldn't it just "stutter" to say?
Exactly - hence my question re adding a pullup/down resistor.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Motor Drivers Tutorial
« Reply #16 on: May 08, 2009, 03:36:16 PM »
ahh ok, its pullup for enable and pulldown for disable right?
Howdy

 


Get Your Ad Here