Author Topic: Stepper Motor Driver  (Read 5335 times)

0 Members and 1 Guest are viewing this topic.

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Stepper Motor Driver
« on: February 03, 2008, 12:02:24 PM »
I have two unipolar stepper motors that I want to drive using an OOPic (using the oStepper object).

Which is the best way to setup a driving circuit?

Just use an L297 like they show at the bottom of the page: http://www.oopic.com/ostepper.htm

Is there a better way of doing this? Can someone provide a link to a cheap and easy way of driving these two motors?

Offline Rebelgium

  • Supreme Robot
  • *****
  • Posts: 637
  • Helpful? 0
  • It's called the future ... We like it here
    • orgcrime.net
Re: Stepper Motor Driver
« Reply #1 on: February 03, 2008, 01:07:12 PM »
I think using the L297 is a pretty good choice.
To relax after some hard work on robotics: A very fun free online text based MMORPG
orgcrime.net

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #2 on: February 03, 2008, 01:23:14 PM »
I think using the L297 is a pretty good choice.

So I would just get two L297s and wire them exactly as shown in the OOPic site?

Just to be more specific, I have this motor: https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=237535

It says its a four phase unipolar motor.

And in the spec sheet of the 297:

With a suitable power actuator the L297 drives two phase bipolar permanent magnet motors, four phase unipolar permanent magnet motors and four phase variable reluctance motors.

Whats a power actuator? Just a power source?
« Last Edit: February 03, 2008, 01:32:26 PM by vivek9856 »

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #3 on: February 03, 2008, 01:43:16 PM »
I just realized that I have been typing in 297 instead of 298.

What I meant all along was that I use 4 I/O ports per stepper. I would use 8 total ports to control the steppers through two L298 chips. I would then use the oStepper object to control the steppers.

If I were to run a 297, and plug that into a 298, how would I code the OOPic to run the steppers, as the oStepper object uses 4 I/O ports to directly drive the motor, not two to drive the motors through the 297 and then through the 298.

Offline hazzer123

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: Stepper Motor Driver
« Reply #4 on: February 03, 2008, 02:05:56 PM »
You would have to make your own routines if you were you use L297 with L298. Or you could try to find some modified/different ones.

I used a similar approach in my micromouse robot with 4 I/Os per motor. I used two ULN2003 chips, which are arrays of 7 darlington transistors. It worked great.

Imperial College Robotics Society
www.icrobotics.co.uk

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #5 on: February 03, 2008, 05:02:00 PM »
You would have to make your own routines if you were you use L297 with L298. Or you could try to find some modified/different ones.

I used a similar approach in my micromouse robot with 4 I/Os per motor. I used two ULN2003 chips, which are arrays of 7 darlington transistors. It worked great.



The ULN chip maxes at .5 A. I have 1.2 A motors, so I may just go with two L298s. (Should be the same thing)??

Offline hazzer123

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: Stepper Motor Driver
« Reply #6 on: February 03, 2008, 05:26:08 PM »
Yeah it seems to be very similar, i.e. you make input 1 high to make output 1 turn on and so on...
Imperial College Robotics Society
www.icrobotics.co.uk

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #7 on: February 03, 2008, 08:27:29 PM »
I went over the schematics, but I still have a few questions:

1. The two sense pins on the L298 - What do I do with those? Do I just directly plug them into ground?

2. On the OOPic page, where does the +5 V line come from (http://www.oopic.com/ostepper.htm) in the diagram? Where would I plug this into?

3. For the power input into the L298, I am using the same batteries that will be powering the OOPic. So, the battery will have one wire going to the OOPic and one to the L298. Is this okay if I use Lithium batteries that are like 2000 mAh, and I only run the bot for like 10 min?

4. So if I get the 298 chip, I can directly plug in the motor connections to the chip (As in, I don't need to put any caps or resistors inbetween some connections?)

Sorry for the simple questions. This is my first robot build, and actually my first "real" electronics project

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #8 on: February 04, 2008, 03:25:44 PM »
One more thing: The headers on the OOPic are all little pins. Where is a good place to buy connectors that I can plug into those? Or is there a special cable that makes the I/O pins easier to access?

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #9 on: February 08, 2008, 10:15:22 PM »
Alright. I just realized that the L298 was designed for bipolar stepper motors with four wires.

However, I have unipolar stepper motors with 4 wires.

What should I do? Do I just wire the steppers according to the OOPic site, and ignore the center wire of the stepper and drive it like a bipolar? What is the benifit/cons of doing this?

Are there any other ways of driving unipolars with L298's (Because I already have them)

Also, I can directly plug in the motor leads into the L298, right? I don't need the "fast diodes" that are in the 298 data sheet, do I?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Stepper Motor Driver
« Reply #10 on: February 17, 2008, 11:47:32 AM »
hmmmmm vivek9856, a lot of your questions can be answered with just a little thought, reading the datasheet, and some google searching.

Draw us a schematic of exactly how you think it should be, and we will verify it for you.

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #11 on: February 18, 2008, 07:02:10 PM »
hmmmmm vivek9856, a lot of your questions can be answered with just a little thought, reading the datasheet, and some google searching.

Draw us a schematic of exactly how you think it should be, and we will verify it for you.

I did just that, and I figured it out. No problems.

Thanks for the help everyone.

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #12 on: March 08, 2008, 09:48:15 PM »
Okay. I made my stepper controller based on the info found in the L298's datasheet.

If I can find my schematics, I'll post them later, but I will just briefly describe the circuit here:

I have 4 inputs from the OOPic (Pins 8-11) going through some 330 ohm resistors through an LED and into the L298. Then, the 298's outputs have diodes on them that allow current to flow from the signal to ground, but not from Vs to the signal. The four outputs then go to the stepper. The Enable A and Enable B pins are plugged into the +5V supply next to the IO pin row on the OOPic as well as Vss. The EnA, EnB, and Vss are all tied together and plugged into one OOPic pin. The current sensing pins are plugged into the GND next to the power pins on the OOPic. There is one 9V battery supplying both the OOPic and the steppers.

I then programmed the OOPic to just continuously drive the steppers using the oStepper object. When I do not plug GND or Vs from the 298 into the battery, the LED's light up just barely in sequence (1,2,3,4,1,2,...). It keeps on doing this for as long as there is power.

When I plug the GND of the 298 into the negative terminal of my battery, the LED's get very bright and still go in the proper sequence. However, the LED's eventually stop going in the right sequence, and the EAC light on the OOPic goes out.

If I plug the GND of the 298 into the negative terminal, and the Vs of the 298 into the positive terminal of my battery, the OOPic will start for one sec (The EAC light comes on), and then the EAC light starts rapidly blinking for about 2 seconds, then dies. I have to unplug the power and wait for a few seconds before I give power to the OOPic for it to restart.

During all of these variations, the motor does nothing. No movement, jerking, or anything.

What could be wrong? Should I be plugging Enable A and B into the PIC? Is it okay that I tie together EnA, EnB, and Vss? Should I be plugging the current sensing ports into ground? (I don't need the current sensing option to work). What could be the problem? Why does the EAC light blink and then cut out?

I am trying to find my schematics. I'll post them as soon as I can. I would appreciate any help

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Stepper Motor Driver
« Reply #13 on: March 15, 2008, 05:55:12 PM »
It sounds like you have two problems.

First, you aren't keeping all grounds common - obvious because of the LED's becomming brighter when you plug in ground. Make sure your ground on all components are connected.

Second, you want a regulated voltage going to your microcontroller and the enable lines.

However, the power going to the motors must come directly from your battery. btw, which battery are you using?

My theory is that something is overheating and has a thermal shutdown failsafe when it fails, requiring a few seconds to cool off.

Offline vivek9856Topic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Stepper Motor Driver
« Reply #14 on: March 15, 2008, 06:30:14 PM »
Okay. I fixed the problem. It was simply that the batteries I was using were not providing enough power for both the controller and OOPic. Also, I didn't have a common ground as you said.

When plugged into a bench supply, every thing works just perfectly.

 


Get Your Ad Here