Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: roborg on April 22, 2010, 08:49:04 PM

Title: 2-pin vs 4-pin circuit to drive stepper motor
Post by: roborg on April 22, 2010, 08:49:04 PM
Hi,

I am looking at http://arduino.cc/en/Reference/StepperBipolarCircuit (http://arduino.cc/en/Reference/StepperBipolarCircuit) where it shows two circuits to drive a bi-polar stepper motor. One has 2-pins that go to the controller and the other has 4 pins that go to the controller. I am wondering what is the advantage of one versus the other. The 4-pin circuit seems simpler to build but I end up using 2 extra pins whereas the 2-pin one is (comparatively) harder to build but saves 2-pins, which will be useful if I want to drive multiple steppers.

Thanks,
RO.
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: Cristi_Neagu on April 23, 2010, 04:00:11 AM
Hi

I think it's easier to program the steps for the circuit with 2 pins. But i can't tell how the stepping is actually made.
Have you thought about using an L297? That would take A LOT of programming off your shoulders. It just needs a clock source (could be a simple PWM signal), and a direction input (high or low).

Good luck.
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: waltr on April 23, 2010, 08:06:53 AM
Look up the data sheets for the two ICs in those Stepper schematics.  The definitions of the input pins will tell you what they control in the H-bridge and if the functions are what you need.
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: roborg on April 23, 2010, 10:51:22 AM
Hi

I think it's easier to program the steps for the circuit with 2 pins. But i can't tell how the stepping is actually made.
Have you thought about using an L297? That would take A LOT of programming off your shoulders. It just needs a clock source (could be a simple PWM signal), and a direction input (high or low).

Good luck.

Hi,

How flexible is this to program ? Can I control how fast, how long and/or how many steps to turn, which waveform etc. ? Can you please point me to a circuit ? I have Arduino board, any idea how to input clock source to L297 ?

Thanks,
RO.
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: waltr on April 23, 2010, 11:03:34 AM
Look up the data sheet for the L297. Its all there.
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: billhowl on April 23, 2010, 11:16:59 AM
Here is the code
http://www.tigoe.net/pcomp/code/category/arduinowiring/51 (http://www.tigoe.net/pcomp/code/category/arduinowiring/51)
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: Cristi_Neagu on April 23, 2010, 12:12:32 PM
Hi,

How flexible is this to program ? Can I control how fast, how long and/or how many steps to turn, which waveform etc. ? Can you please point me to a circuit ? I have Arduino board, any idea how to input clock source to L297 ?

Thanks,
RO.

Hello.
Well, since you don't actually program the L297, everything is a s flexible as the controller you are using.
You control how fast the motor is turning with the frequency of the clock source. The motor steps when the clock is on it's rising edge (could be the other way around, can't really remember).
It has an "enable" input. If it's high, the motor turns, if it's low, the coils are unenergized (the motor spindle is not held into place; to do that, you set the enable high, and stop the clock source).
It also has a direction input.

Programming wise, you just need a pwm timer, and one or two pins, depending wether you want the motor to reverse direction.

Also, what do you mean waveform? If you're talking about the clock waveform, it's square wave.
If you're still interested, i could post a circuit design. I built 6 motor drivers with it and none have failed me ;D

Good luck.
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: Soeren on April 23, 2010, 09:21:33 PM
Hi,

I am looking at http://arduino.cc/en/Reference/StepperBipolarCircuit (http://arduino.cc/en/Reference/StepperBipolarCircuit) where it shows two circuits to drive a bi-polar stepper motor. One has 2-pins that go to the controller and the other has 4 pins that go to the controller. I am wondering what is the advantage of one versus the other. The 4-pin circuit seems simpler to build but I end up using 2 extra pins whereas the 2-pin one is (comparatively) harder to build but saves 2-pins, which will be useful if I want to drive multiple steppers.
The "two pin circuit" will only do full steps and will at all times have the coils energized - bad circuit.
Use the other one (the "four pin circuit").

If you wanna use the L297, be prepared for a larger circuit, like adding a L298 or similar as the L297 in itself isn't able to drive your motor.
Title: Re: 2-pin vs 4-pin circuit to drive stepper motor
Post by: Cristi_Neagu on April 24, 2010, 07:47:28 AM

If you wanna use the L297, be prepared for a larger circuit, like adding a L298 or similar as the L297 in itself isn't able to drive your motor.


Indeed. But it's not that complex. Just a few resistors, a couple of capacitors, and 2 trim pots, besides the L297 and L298. Also, 8 flyback (i think that is what they're called) diodes are used, but if you plan on powering any kind of motor, flyback diodes are a must.

It's a question of programing and time vs. circuit construction and a bit more money.