Shop OBEX P1 Docs P2 Docs Learn Events
Bipolar Stepper motor — Parallax Forums

Bipolar Stepper motor

Bzmicro7Bzmicro7 Posts: 12
edited 2013-01-14 11:17 in BASIC Stamp
I have Boe-Bot educational kit. I need to drive 2 bipolar stepper motor. I need help with picking up the right stepper motor driver for this project. Additional wiring diagram and code would be greatly appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-10 09:23
    Look at the StampWorks Manual starting on page 150. There is a wiring diagram and sample code.

    Note that the example is for a single stepper. It would be easy to modify the program to control one of the two motors at a time, but simultaneously running two motors would be difficult and you might consider using some kind of external stepper motor controller. Pololu makes a variety of stepper drivers and controllers. Here's one used with bipolar motors.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-01-10 10:09
    Mike Green wrote: »
    Look at the StampWorks Manual starting on page 150. There is a wiring diagram and sample code.

    Mike, out of curiosity I looked at that manual and that example looks like it is for a unipolar stepper motor. Wouldn't a bipolar motor require something like an L298 and alternating the current through the coils? When I looked into that I decided it would be easier to use a Pololu module which only requires two spins for step and direction.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-10 11:16
    The description in the StampWorks Manual says that the code should work equally well with unipolar or bipolar motors using the L293D driver on the PDB. Personally, I would use a Pololu module instead since it handles some of the power issues and simplifies the control of the motor(s).
  • Bzmicro7Bzmicro7 Posts: 12
    edited 2013-01-10 11:17
    Thanks for the reply Martin, you are right, unipolar stepper motors are driven by darlington trnsistors vs bipolar driven by H-Bridge thats what L298 is. I have seen lots of bipolar stepper motor controllers online, I just wanted to make sure pick the right one and less expensive one that still would do the job.
  • Bzmicro7Bzmicro7 Posts: 12
    edited 2013-01-10 11:17
    Thank you mike. I will check it out.
  • ercoerco Posts: 20,256
    edited 2013-01-11 08:36
    @Bz: If you can afford to wait 10 days for shipping from China, you can buy these premade L298N modules for $4-5: http://forums.parallax.com/showthread.php/144881-3.40-Motor-Driver-Board-(Must-Try-to-not-Buy...)
  • Bzmicro7Bzmicro7 Posts: 12
    edited 2013-01-11 13:05
    Thanks erco for the info. I have a L298N H-Bridge Module purchased from Radioshack (Seeedstudio Motor Shioled), I looked up in StamoWorks Manual, I don't see any info on wiring diagram of L298N to BS2 Board of education. I went ahead and with limited info that I had did this hook up. Used some sample code to run one of my bipolar stepper motors. I've gotten as far as the motor humms periodically (according to the time given in the code) but does not move. I don't know if the problm is with my wiring connection to L298N Module or the code. Any help out there would be greatly appreciated.
  • ercoerco Posts: 20,256
    edited 2013-01-11 14:26
    I haven't used a bipolar stepper (unipolar only for me) but this shows how to connect a bipolar to an L298: http://www.hqew.net/circuit-diagram/Two-Phase-Bipolar-Stepper-Motor-Control-Circuit-Diagram_5637.html Basically the two stepper motor coils A & B are connected in place of two dc motors, and will be controlled by L298 inputs in1, in2, in3 and in4. There's no dynamic braking or coasting like a brushed DC motor, so I'd just tie ENable A and ENable B to +5V (default jumper setting on some boards).

    Then you sort through your driver code, using the ULN2x03 code as a model: http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/Stepper_Motor_27964.pdf Instead of switching the 4 different coils of a unipolar, you will alternate driving your A & B coils "positive and negative" using the L298 inputs in1, in2, in3 and in4. You could use either high/low commands or OUTL/OUTH with DIRS.

    My unipolar stepper experiments have used "full step", which is energizing two (of 4) coils at a time in a pattern like: 12 23 34 41 (repeat).

    I would assume yours would be A+B+, A+B-, A-B-, A-B+ (repeat) but check on that.

    I did learn that you want to switch everything off after you stop your motor. If you leave coils energized, it's drawing the maximum current when the motor is stopped and your motor can overheat (maybe even melt wiring insulation) just sitting there. So code carefully and have fun!
  • Bzmicro7Bzmicro7 Posts: 12
    edited 2013-01-11 15:52
    Thank you very much erco for all the infos. I will try and let you know the results.

    Best regards.
  • Bzmicro7Bzmicro7 Posts: 12
    edited 2013-01-13 19:21
    Hi erco, this weekend I made some progress. First I got rid of Motor Shield (from Seeedstudio). Used ULN2803 Darlington Array, connected to BS2, used this URL to get help with wiring diagram and code: http://www.seas.upenn.edu/~robo2005/. I got my motors working, still need to do some more work to have more control over the motor's rotation. One thing I still need help with is how to increase torque on the shaft. I know that setting full step or half step will take care of this. How is this done in the code? I thank you for your direction and help.

    Best regards
  • ercoerco Posts: 20,256
    edited 2013-01-14 08:46
    Too much material there. Please show how you got your bipolar stepper hooked up to a 2803. Is it working properly, just not enough torque?

    Why did you give up on the 298 h-bridge?
  • ercoerco Posts: 20,256
    edited 2013-01-14 10:51
    Useful info on motor controllers, dc and bipolar/unipolar steppers at http://www.societyofrobots.com/member_tutorials/book/export/html/159

    See if the L297 stepper controller interests you. Nothing that a Stamp can't do, but it handles low-level motor management, leaving your Stamp free to do other things (make coffee, do the laundry, etc).
  • Bzmicro7Bzmicro7 Posts: 12
    edited 2013-01-14 11:17
    Hi erco, I used drawing from URL http://www.seas.upenn.edu/~robo2005/ under LabIII, I beleive from Penn state Univ, Lab experiment(the code is in this experiment as well) I gave up on L298N because it was part of a Motor Shield for Ardino, there were so many mods I had to make to work with BS2. Now I want to know how to increase the speed and Torque on this motor (I tried two motors, one was Vexta Model PX245-003a and the other I had in batch of junk that I had collected over time and had come out of an old 5 1/4" Floppy drive with no spec on it) On both, when they are running I can slightly hold the shaft with my finger tips and will stop. In the same lab experiment, if you were able to see, I added a 10K Var pot between P0 and P1 on the BS2 .This pot when you rotate cw and ccw at one point make rotation stop and change direction. I think that I have to make some changes in the code in order to controll speed or torque, I have not done this before and I need some help to do this. If you were not able to find the info at URL above let me know, I have printed out a copy, tell me the easy way to send this tou you. Thanks again for your reply.

    Best regards.
Sign In or Register to comment.