Shop OBEX P1 Docs P2 Docs Learn Events
Moving Bipolar NEMA 23 with HomeWork board. — Parallax Forums

Moving Bipolar NEMA 23 with HomeWork board.

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.





Comments

  • kwinnkwinn Posts: 8,697
    edited 2016-12-04 02:57
    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.





    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.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2016-12-04 03:07
    You need to connect DIR-, PUL- and EN- to ground on the Homework Board. You can either control EN+ (enable) and DIR+ (direction) with I/O pins or you can just connect these to 5V on the Homework Board. PUL+ is the pin to pulse to get the stepper motor to turn.

    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.
  • You may need current limiting resistors for the optoisolators.

    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.
  • idbruceidbruce Posts: 6,197
    edited 2016-12-04 12:47
    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.

    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.
  • The industry standard is 10us wide pulse - this should work with even
    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.
  • kwinnkwinn Posts: 8,697
    Mark_T wrote: »
    The industry standard is 10us wide pulse - this should work with even
    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.
  • Hi,

    I have not do the exercise yet.

    Thanks for helping.
  • @Angela_Curti, I program a propeller but maybe I can give you some basics. The main difference between a bipolar and a unipolar stepper is this: With a unipolar you can connect the common wire to battery power and pulse the other wires in order. This can be done with a ULN2803.
    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.
  • Hi,

    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.
    1456 x 2592 - 2M
    2592 x 1456 - 1M
    2592 x 1456 - 2M
    2592 x 1456 - 2M
    2592 x 1456 - 2M
  • PublisonPublison Posts: 12,366
    edited 2017-01-10 16:20
    Just to start with, you need a connect the grounds between the BS2 board and the controller. Go from the black battery terminal on the BS2 board to -DC on the controller, or -V on the power supply.
  • Thanks Publison,

    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.

    .
  • Thanks Publison,

    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.


  • Angela-CurtiAngela-Curti Posts: 44
    edited 2017-01-10 17:26
    But I can not increase the speed.

    The max speed is with this:

    a:
    high 14
    low 14
    goto a

    and it is just about 50 rpm
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Publison wrote: »
    Great! That's a step forward.

    Nice pun! LOL

  • JasonDorieJasonDorie Posts: 1,930
    edited 2017-01-10 19:44
    Try setting the three micro-step switches to OFF, ON, ON. That sets the driver to use full steps, which will give you the highest possible speed.

    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:
    a:
    high 14
    low 14
    high 14
    low 14
    goto a
    
    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.
  • Angela-Curti,

    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?
Sign In or Register to comment.