Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
Asked — Edited

Using And H-Bridge 2.5 Amp Motor Controller To Control Stepper Motors?

Ok...I am trying this again - hopefully someone can help me figure it out...

I have a few of these little stepper motors and was wondering if anyone could shed some light on compatibility with the 2.5 amp motor controller...or any other controller. Here is the data sheet;

http://www.nmbtc.com/pm-step-motors/engineering/pdf/Drive-Circuitry-and-Wiring.pdf

The motors are Pm355-048-snc9 versions - they are housed in an older polycom/sony pan/tilt camera mount. I was hoping that I might be able to use a single h-bridge to control them, but I am thinking thinking that I might need two h-bridges (if that is possible on one EZ-B board)- one for pan and one for tilt.

Please help me figure this out....I am stumped!

Thanks,
Wayne


ARC Pro

Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

#1  
Hi Wayne,

I too was hoping to find some way to control stepper motors with the EZ-B.
#2  
Bret,


I am going to start testing this weekend...I am using the following items;

Standard L298 series H-Bridge
Pm355-048-snc9 - pancake style (low profile) stepper motors - these are 4 wire uni/bi polar steppers.

I am pretty sure that I can make it work, but I think that it will take 1 H-Bridge board for 1 motor (was hoping to control 2 motors)

I will try and report back with my findings when I finish.

Thanks,
Wayne
#3  
I do not know anything about stepper motors, but I have often seen motor controllers that say that they will control either one stepper motor, or two brushed motors. It is my assumption that they need two sets of inputs. I realize this is not much help, but it is just an observation.
#4  
Looking forward to seeing what you come up with. I was thinking about using one of these motors at one time. Thanks for threading where angels fear to tread. :)
PRO
Canada
#5  
Hello @wboyd

To control a stepper motor with an L298 2.5 amp motor driver (which is a Dual H-bridge chip) you'll indeed need one Motor driver board per stepper. You see steppers have two coils in them (Unipolar stepper have center taps on each coil that can be ignored and used like bi-polar steppers) and each coil needs to be driven by an H-bridge. As @Danger! mentioned, the nice thing about the L298 is that it has two H-bridges inside (2 channels) so you can drive 1 stepper motor (2 coils) or 2 DC motors (1 coil each).

Once you have each output of the L298 connected to a coil on the stepper motor, you'll then need to energize each coil in a proper sequence to make the motor "step". This link has a some good info on making that happen.

For example your EZ-Script would look like this:

Code:

 :Start
Set(D1, OFF)
Set(D2, ON)
Set(D3, ON)
Set(D4, OFF)
Sleep(10)
Set(D1, OFF)
Set(D2, ON)
Set(D3, OFF)
Set(D4, ON)
Sleep(10)
Set(D1, ON)
Set(D2, OFF)
Set(D3, OFF)
Set(D4, ON)
Sleep(10)
Set(D1, ON)
Set(D2, OFF)
Set(D3, ON)
Set(D4, OFF)
Sleep(10)
Goto(Start)


*Edit: To figure out which stepper motor wires to connect to the outputs of the 2.5amp motor driver use an ohmmeter and find which wires seem to be shorted together (low resistance), there should be two pairs. Hook up each pair to one of the motor driver outputs, and don't worry it doesn't matter which pair goes to which output since the stepping sequence is a loop. Oh and I forgot to mention that the reason why you can use the 2.5amp motor driver with steppers is that they can handle the current requirements of each coil of the stepper which is usually 1amp.

Please note: that steppers like to have higher voltages (12-24VDC) for them to have stronger cogging effect and even though the L298 can drive more than the 1amp per coil needed, the heatsink will still get quite hot on the board so be careful not to touch it.
#6  
@skater, Thanks so much for explaining this topic so clearly ...and....providing some script!
United Kingdom
#7  
Oooh new info for me to learn:) I always wondered about stepper motors and now I know:D
#8  
I thought as much...but was not exactly sure. I have used steppers with arduino projects, but was not sure about the EZ-B. But thanks - like I said, I am going to play with it this weekend. The project is controlling a pan/tilt device in an old Polycom ViewStation device. It uses 2 "pancake" (flat) stepper motors. What I really like about it is that the gearing makes the pan/tilt motion very fluid, plus it just looks cool...could make a nice "head" for a bot. I was able to get a few of these for free...(check link). I am actually just using the camera portion - it detaches from the base. I will try and post some pics when I get a chance.

Thanks,
Wayne
www.google.com/search?q=polycom+viewstation&rlz=1C1CHFX_enUS531US535&espv=210&es_sm=93&tbm=vid&source=lnms&sa=X&ei=dI3ZUpGGLMKVygG5rYH4AQ&ved=0CAwQ_AUoAA&biw=1920&bih=1085&dpr=1
#10  
Just to let everyone know...my little experiment was a success! But...and there is a caveat here - the motors that I was working with are 24v, and drained the power supply fairly quick. So, I am going to try and mod the pan/tilt unit on the sony/polycom unit to use some continuous rotation servos and reduction gears. I am sure that there are better stepper motor controllers for this particular application, but I was able to cobble things together...and it was super cool looking while it had power!

Thanks to all,

Wayne
#11  
I posted about this subject a couple of days ago also. My project will be using an linear actuating stepper motor. (screw through middle of motor). I will be using a "chopper" drive that will then require pulses be sent to it. I am waiting on the ezb4 to see if there is some way of generating pulses. The only other input the drive needs is "direction", in my case up or down. I'm really hoping to get some things together soon so I can start posting some pics. I am creating a large "bot". Wheelchair motors for the tracks, wheelchair motors for the shoulder joints,2 orion H bridges 1 for the shoulders 1 for the tracks. And a linear stepper to raise and lower the main body from the track base approximately 12 inches. Cant wait for the ezb4.

Chris
#12  
I know this is an old subject but I am trying anew... On my Sainsmart L293d motor shield I have figured out how to connect it to the motor - how to connect to the EZB V4? There are two 3pin connectors called servo 1 and 2 - maybe there? But where on the EZB?
User-inserted image
#13  
No, the servo connectors are cor driving two servos from an Arduino. Being an arduino shield, it is controlled through some number of the gpio pins (the long row of pins labeled 0 - 14) but which ones, and what signal they need you'll either need to find a data sheet or interpret an arduino sketch that is written for it to figure out what it is doing.

Also, at only 600ma per channel, this is not going to drive very powerful motors.

You need to match your controller to your motors, and steppers are not plug and play. You will need to do some scripting to make them work with most (all?) h-bridges.

Alan
#14  
Very interesting - the board was very inexpensive and suggested when I bought the stepper motor. The motor is a Kollmorgen P22NRXB so I will have to do more study of motor controller boards.
I am building a telescoping arm with a rack and pinion andxas thinking that driving the pinion with a stepper motor would be a simple command like clockwise 4000 counts.
Any recommendation on this telescopic control?
Thank you!
#15  
Check Jeremie's answer on the previous page of this thread. Describes how to use the ln298 with steppers (2.5 amp, which I think is a good choice for your motors - didn't read the spec sheet, just a description, but I think they are 2 amp).

Alan
#16  
Thank you! I have read Jeremie's thread on this and am motivated. Unfortunately, his link to myrobotlab doesn't work. I will order the l298 board but in the mean time where do I connect it to the EZB ?
Is there anyway to contact Jeremie for more specifics on how he did this?
#17  
This tutorial shows how to use the ln298 with brushed or brushless motors. It, together with the info from Jeremie should be enough information to pull it together for you. https://www.ez-robot.com/Tutorials/UserTutorials/130/1

More likely than not Jeremie will see this thread after the weekend and provide additional input.

Alan
#18  
@castlephelps "his link to myrobotlab doesn't work" You can always google it.....
PRO
Canada
#19  
Hi @Castlephelps,

First off, nice to meet to you!:)

The sainsmart L293 shield is a clone of adafruit's motor shield design and uses a 74HC595 shift register to control the L293 H-bridges. This cuts down on the amount of control signal pins needed but does complicate the process of sending the signals if you aren't familiar with shift registers.

While the sainsmart shield can drive some smaller steppers and DC gear motors, as Alan mentioned, the L298 is a better choice. It can handle higher voltages and current.

Feel free to ask questions on here @Castlephelps I'm always browsing the forums whenever I have a spare moment
#20  
Hi Jeremie!

I am very excited to make your acquaintance! My robot project started last Christmas when I received an EZ-B development kit / but I soon discovered that the components weren't beefy enough so now I have finalized my design and am now welding arms and wanting to drive a telescoping arm with large stepper motors and be able to control how rad and how fast the stepper drives a rack and pinion!
I ordered an l298 and can start playing with it after Thanksgiving! I'm sure I will have lots of questions!

Thanks again,
Castle
#21  
Hi Jeremie,
Ok I got my L298d and have it wired exactly as you recommend right down to the wire colors. I have a separate 5vdc power supply for the 298 as you can see in the photo. I connected to the EZ-B, opened an HBridge PWM Movement window but when I click on the arrows nothing happens - the motor does not turn any. What am I missing?

User-inserted image


User-inserted image
PRO
Canada
#22  
Welcome back @castlephelps!

So the H-bridge Movement Panel won't be able to control a stepper motor as it doesn't send stepping signals to the stepper motor. To make it "step" you will need to write a script.

Since you have the H-bridge enable pins connected to the ez-b you'll have to add those. Maybe just make them high for the moment.

Code:


Set(D5, ON) #enable pin 100% PWM
Set(D6, ON) #enable pin 100% PWM

:Start
Set(D1, OFF)
Set(D2, ON)
Set(D3, ON)
Set(D4, OFF)
Sleep(10)
Set(D1, OFF)
Set(D2, ON)
Set(D3, OFF)
Set(D4, ON)
Sleep(10)
Set(D1, ON)
Set(D2, OFF)
Set(D3, OFF)
Set(D4, ON)
Sleep(10)
Set(D1, ON)
Set(D2, OFF)
Set(D3, ON)
Set(D4, OFF)
Sleep(10)
Goto(Start)


Obviously the pins I have here may not match what you have hooked up, change the digital pin in the code accordingly:)
#23  
Way cool! Now to find the tutorial on adding code...

Thank you!
#24  

Quote:

Way cool! Now to find the tutorial on adding code...

Look for "Script" not "code" and you will find what you need.

Alan
PRO
Canada
#25  
Just uploaded a video example of driving a stepper motor with ARC, and ez-bv4, and a dual H-bridge.

#26  
And to make it reverse direction would you set the PWM pins as a negative speed or set the 1-4 pins the opposite sequence?

Also if you wanted the motor to move plus or minus 45 degrees and stop how would you tell the script that?

Thanks
PRO
Canada
#27  
Well I'll do you one better and attach my stepper project file for you. The project includes scripts for Fullstepping in the clockwise & counter clockwise directions and Half stepping in the clockwise & counter clockwise directions.

Stepper.EZB

The degrees in which you would like to move depends on the steps/degrees that your particular stepper moves. Hypothetically, say it's 1 step per degree, then 45 steps would be 45 degrees. Here would be an example of 45 degrees of movement:

Code:


REPEAT($y, 0, 44, 1)
$x = 10
Set(D1, ON)
Set(D3, OFF)
Set(D2, OFF)
Set(D4, ON)
Sleep($x)
Set(D1, OFF)
Set(D3, OFF)
Set(D2, ON)
Set(D4, ON)
Sleep($x)
Set(D1, OFF)
Set(D3, ON)
Set(D2, ON)
Set(D4, OFF)
Sleep($x)
Set(D1, ON)
Set(D3, ON)
Set(D2, OFF)
Set(D4, OFF)
Sleep($x)
ENDREPEAT


So this code sample will Repeat a fullstep sequence 45 times, here are what the values in the repeat loop represent:

0 = start value
44 = end value
1 = increment by 1

If the stepper seems to be skipping steps our moving backward at times you may have to change either the code or the stepper wires to be in the proper sequence or it might be moving too fast. If speed is the issue, just increase the $x value to slow the stepper down.