Moving Bipolar NEMA 23 with HomeWork board.
Angela-Curti
Posts: 44
Hi,
I need to move a big bipolar stepper motor (3.5 Amp) using this driver:
http://artofcircuits.com/product/hy-div268n-5a-cnc-single-axis-tb6600-0-2a-5a-two-phase-hybrid-stepper-motor-driver-controller
But I don't understand if I have to use just one pin to send the speed to the driver or if I have to use more pins.
Some years ago I used a Unipollar stepper from parallax and the code was like to turn on and off four leds using a chip called ULN.
But this time there are other inputs like DIR- DIR+ , PUL- PUL+ , EN- EN+
I Think that a code like this could move the bipolar stepper:
ini:
High 1
pause 5
Low 1
Pause 5
Goto ini
But I don't understand if I need to use six pins to move the stepper using
DIR- DIR+ , PUL- PUL+ , EN- EN+ ( one for each input)
Do you know where I can see an example to use this driver with a Homework board?
It is very extrange or rare for me.
I need to move a big bipolar stepper motor (3.5 Amp) using this driver:
http://artofcircuits.com/product/hy-div268n-5a-cnc-single-axis-tb6600-0-2a-5a-two-phase-hybrid-stepper-motor-driver-controller
But I don't understand if I have to use just one pin to send the speed to the driver or if I have to use more pins.
Some years ago I used a Unipollar stepper from parallax and the code was like to turn on and off four leds using a chip called ULN.
But this time there are other inputs like DIR- DIR+ , PUL- PUL+ , EN- EN+
I Think that a code like this could move the bipolar stepper:
ini:
High 1
pause 5
Low 1
Pause 5
Goto ini
But I don't understand if I need to use six pins to move the stepper using
DIR- DIR+ , PUL- PUL+ , EN- EN+ ( one for each input)
Do you know where I can see an example to use this driver with a Homework board?
It is very extrange or rare for me.
Comments
Those inputs go to optical isolators so typically the DIR- PUL- and EN- would be connected to gnd and the DIR+ PUL+ and EN+ would be connected to the I/O pins of the microcontroller that is controlling the motor.
When DIR+ is set to 5V the motor will turn one direction and when DIR+ is connected to ground the motor will turn the other direction.
Stepper motors generally need to be accelerated to reach their top speeds. I have no idea how slow your stepper motor needs to turn at startup. I'm guessing your code should work okay once you make all the needed connections. If the motor just buzzes with your code, you can try increasing the pause duration for each pulse.
If you're not worried about moving the motor quickly, you should be able to ignore the acceleration concern. To get the motor to turn its fastest speeds, you'll need to decrease the pause duration in a controlled manner.
I just checked the manual and you don't need to add external resistors if you're driving the inputs with 5V. The control board has internal 270 ohm resistors in series with the optoisolators. The manual shows an example control circuit using PNP transistors but I think the Basic Stamp can safely directly drive the optoisolators.
Duane
First off, the driver should have a minimum step pulse width which should be maintained throughout operation. The speed of the stepper motor is controlled by the duration in between those minimum pulse widths. For startup, you could have a delay duration of one minute, one hour, or even one year between step pulses, but that would be pretty boring and useless at getting any real work accomplished.
Alter your thinking a bit... Try to achieve the fastest start up speed.
The fastest (maximum) start up speed would be the shortest delay between step pulses in which the moment of inertia of the motor and other components can be overcome. (EDIT ADDED) without losing steps.
quite sluggish opto-isolators. I'd suggest setting the direction output at least 5us before
sending a step pulse to make sure it will be read (this only matters when changing
direction of course). For an interpreted language its probably fine to set and then
reset the step pin immediately, it probably takes 10us to interpret the instructions.
The enable input may or may not need to be activated to enable the driver - thats
for experiment - you can leave it permanently enabled (hard wired) unless you want
a hardware emergency-stop function.
More modern opto's may be fine with 10uS pulses but the oldies will not. I had a very intermittent problem on a medical imager using 40-50uS command pulses. Increasing to 100uS eliminated the problem.
I have not do the exercise yet.
Thanks for helping.
A bipolar stepper needs two H-bridges such as an L293D because it has two separate coils and you have to alternate voltage polarity to get it to turn properly.
The absolute basics of a bipolar are:
1) You have two pairs of wires. You can use your meter to find which pairs of wires have the lowest resistance between them.
2) With a 9 volt battery touch the first pair. If it turns in the correct direction you can call those wires 1 and 2. If it turns in the wrong direction flip the battery and do it again.
3) Touch the second pair of wires the same way you touched the battery to the first pair. This means if the battery was facing (-) (+) then you touch the second pair (-) (+). If the motor now turns in the 'opposite' direction then you reverse the wires. If the motor turns in the same direction as the first pair you can call those wires 3 and 4.
4) If the wires are now in the correct order you can touch the battery to the first pair then the second pair 'flip' the battery and repeat the process.
The basic 'nothing fancy' bipolar step pattern is '1, 3, 2, 4'
I hope this helps.
2 weeks ago arrived the new HY-DIV268N-5A CNC Single Axis TB6600 .
I am using this code with the Homework:
a:
high 14
pause 200
low 14
pause 200
goto a
I am using this code. The PIN 14 to the PUL+ to turn the motor with this code.
I am following all your suggestions and the stepper does not move.
Your suggestion:
DIR-, PUL- and EN- to ground on the Homework Board. EN+ (enable) and DIR+ (direction) connected to 5V on the Homework Board.
Even , I can see two leds at the HY-DIV268N-5A driver. One led is ON and the other led is blinking at the same speed of the Homework code ( High 14, pause 200 , Low 14, pause 200)
Please help.
I have done that. And the black battery terminal was not the problem.
But I solved the problem 30 minutes ago. The EN+ and EN- must be free ( not connected). And the micro Stepping does not be all the 3 switch ON or all the 3 switch OFF . OFF OFF OFF or ON ON ON do not produce the movement.
But the speed is not high , It is just about 50 rpm.
Perhaps the Stamps is not fast. Perhpas I need to test with an other command like PULSOUT but I do not know.
.
Great! That's a step forward.
The max speed is with this:
a:
high 14
low 14
goto a
and it is just about 50 rpm
Nice pun! LOL
The BS2 on the Homework board claims approximately 4000 PBasic instructions per second. Steppers are generally 200 steps per rotation, and your loop uses 3 PBasic instructions, so, doing the math:
4000 / 3 = 1333.333 of your loops should be able to run per second (steps per second)
1333 steps / 200 steps per rotation = 6.666 rotations per second
6.666 x 60 seconds in a minute = 400 rotations per minute (RPM)
With single stepping, assuming the numbers are close, you should be able to get 400rpm.
1/2 micro-stepping would give you 200rpm, 1/4 micro-stepping = 100rpm, 1/8 micro stepping would be 50rpm. Again, this is assuming that your loop runs at 4000 instructions/sec, which is an approximate number, not an exact one. Your actual code might run a little faster or slower.
You could make it a little faster by unrolling the loop, like this: That makes it so that the goto is 1/5 of the code, instead of 1/3, meaning you can now do 1600 toggles per second, instead of 1333, or a 20% improvement. Not huge, but that bumps your case up to 60rpm.
The Black (B-) wire from your Stepper doesn't seem to be fully inserted into the driver connector.
It also looks like you have the Current Limit set to 0.6A (Off On On).
What stepper motor are you using?