Shop OBEX P1 Docs P2 Docs Learn Events
BS2 Control of Bipolar Stepper Motor — Parallax Forums

BS2 Control of Bipolar Stepper Motor

Two of my students would like to control a bipolar stepper motor with a BASIC Stamp 2. The motor is an Anaheim Automation 17Y302S-LW4 high torque stepper motor: http://www.anaheimautomation.com/manuals/stepper/L010174 - 17Y Series Spec Sheet.pdf. We found information about BASIC Stamp control of a stepper motor at http://smashingrobotics.com/controlling-a-stepper-motor/ and information about driving a bipolar stepper motor through an H-bridge IC at http://www.jasonbabcock.com/computing/breadboard/bipolar/index.html. We have wired up the SN754410 dual H-bridge with an external 12V battery supply as shown in the jasonbabcock reference. The motor hums but does not turn. Can anyone help us figure out what to do next?

Many thanks, as always, for being a lifeline of support.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Do you have a photo showing your setup and connections? Can you post the code you're using? Buzzing can happen when there isn't sufficient power to move the servo or when the phases are being stepped out of order.
  • Thank you, Chris. I'm attaching a copy of the code (taken from the Smashing Robotics reference) and a couple of pictures. I can send more detailed pics of a specific part of the set-up if you need them. The pictures do not show the 12V supply that attaches to the blue wire coming out of the H-bridge. The buttons on the BOE were originally included per the Smashing Robotics reference but have been omitted in the simplified code that I've attached.

    Thanks again for your help!
    3264 x 2448 - 2M
    3264 x 2448 - 951K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2016-05-02 20:56
    First thing that stands out is (unless I am missing something), I don't see a ground connection between the Board of Education and the Breadboard. Without a common ground there is no reference for the level of the signals. What is that bundle of black wires sticking up from around the chip? It looks like they may be loosely twisted together. If so that isn't a stable connection, but if it is the ground pins then they also need to connect to the BoE ground (Vss).

    Also, what is that blue wire doing that seems to go from the breadboard and stick onto the stepper motor?
  • Thanks again, Chris. The bundle of black wires held the 4 ground connections and the blue wire connected to the 12V supply. I reconnected everything and took another picture. The motor is doing more than hum; I am getting a distinct vibration.

    Can't thank you enough for your help!
    3264 x 2448 - 1M
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    It looks good now as far as I can tell. Other than loose connections and phases out of order I can't explain the issue you're having. For the phases just make sure the wires from the I/O pins go to the right connections on the driver IC and that the wires from the stepper motor also connect to the corresponding outputs. Check for loose connections.

    The code from that website isn't very efficient. This could be done much more elegantly and easier. If I had a bipolar stepper motor I'd hook one up and show an example, but alas I have only unipolar stepper motors.
  • Thanks, Chris. I will check the phase order when I'm at school in the morning. Do you know how the PAUSE length in the program would affect the motor behavior? Could that account for the fact that the motor vibrates but doesn't turn? If you have suggestions for more efficient code, that would be great.

    Thanks again for your help.
  • Chris,

    Just don't use the center "COMMON" connection on the unipolar and treat it like a bipolar instead. It should be enough for proof of concept. (See Below)


    sjenny,

    As far as the motor humming and not turning ...

    1) It may not be getting enough power. Double check your circuit and make sure that your power supply(batteries) is(are) providing adequate power. Do you have a meter you can measure voltages with?

    2) You might be giving it a pulse that is too fast. Start out slow and then ramp the speed up.

    Can you place your fingers on the shaft and feel it vibrate? .. or is it just audible?




    STEPPER.jpg




  • I believe the students checked the batteries and they are giving close to 12V. I will check them again in the morning. We can slow down the pulse rate by increasing the length of the pause in the program. Is there a range of pulse rate that is typical for a stepper motor? In answer to your question about the vibration - yes, with my fingers on the shaft of the motor, I can feel a distinct vibration.

    Thanks for your help!
  • Put a piece of tape on the shaft or tape a straw so that you extend the moment arm to visually inspect the motion.... slow the pulses WAY down and check if the straw moves back and forth.... it sounds like you are just bouncing from two different phases without changing polarity entering into the next two phases.
  • Thanks for your suggestion, Beau. I attached a straw to the motor shaft and I can see the oscillations more plainly. (I snapped a video but cannot attach a video file to the discussion board.) The code we are running successively enables 1 of the 4 inputs to the H-bridge while disabling the other 3. I have tried changing the order in which the inputs are enabled (say from 1000, 0100, 0010, 0001 to 1000, 0010, 0100, 0001) and I can't see any change in the oscillations. When I increased the length of time between successive inputs, the amplitude of the motor oscillations appeared to decrease.

    If the problem is that we are bouncing from 2 different phases without changing polarity, can you suggest what we need to change?

    Many thanks again for your help. Didn't think a stepper motor would be as difficult to control as it is.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    For Bi-Polar operation you don't want to disable the other phases. The outputs should all be driven with the correct phases shifting between high-low properly.
  • We aren't sure how to do that with the BASIC Stamp. We have wired 4 output pins from the BS2 to the I/O pins of a dual H-bridge IC in similar fashion to what is shown here: http://www.jasonbabcock.com/computing/breadboard/bipolar/index.html. What signal pattern should we send from the BS2 to ensure that the phases shift properly between high and low?

    Thanks again for the help.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Check out the following link: https://www.parallax.com/product/27297

    Under Downloads & Documentation is the StampWorks manual and the code files. In the StampWorks manual there is a section on driving a Stepper Motor. It is specifically for a Unipolar Stepper Motor, however the phase outputs could also control a Bi-Polar if the phases are properly wired to an H-Bridge chip. I've used the L293D myself.

    As far as the outputs, you can disable the outputs of many H-Bridge chips and those outputs float. But in this case you don't want to disable them. Allow the outputs to be either high or low, which drives the corresponding driver output high/low.
  • The motor you are using, 17Y302S-LW4, per the spec sheet draws .85A at 5.6V which is within the specs for the driver chip you are using. However, with an applied motor voltage of 12 Volts the current draw for each coil increases to 1.84A, below the chip's pulse rating but far above the chip's continuous rating of 1.1A, not to mention 1 Amp over the motor rating. Are your batteries up to the task or are they browning out? Does the motor and driver get hot when running?

    The pictures you provide make it almost impossible to see the connections between the Stamp and the driver. Most of the wires obscure other wires where they actually connect. I always make it a habit to include connection lists in the program comments. Be sure the list reflects how you ACTUALLY have the connections, not copied from an online circuit diagram. Makes troubleshooting a little easier, especially when asking for help from others.

    As a troubleshooting aid, connect 4 leds with suitable series resistors to the driver outputs and run the program with longer pauses to actually be able to see what the outputs are doing. Connect the anode to the driver output, and the cathode through a 3K or more resistor to ground.
  • sjenny wrote: »
    We aren't sure how to do that with the BASIC Stamp. We have wired 4 output pins from the BS2 to the I/O pins of a dual H-bridge IC in similar fashion to what is shown here: http://www.jasonbabcock.com/computing/breadboard/bipolar/index.html. What signal pattern should we send from the BS2 to ensure that the phases shift properly between high and low?

    Thanks again for the help.

    You might try reversing the connections to one of the coils, such as Orange to where Black is and Black to where Orange was.

  • Just wanted to thank all of you again for your advice. This morning we switched to an L239D motor driver and we are now able to control the bipolar stepper motor as we had anticipated. We appreciate all of your help!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2016-05-05 17:10
    Excellent! The 293D is what I use and we included it on our Professional Development Boards because it is equally useful for controlling both unipolar and bipolar stepper motors as well as brushed DC motors or pretty much any high-current device within its specifications.

    Also, thanks for following up. :nerd:
Sign In or Register to comment.