Basic Stamp 2 Stepper Motor Experiment


We may attempt this.

Like they say 'good for quick prototyping'.The Stamp that is.

It's so we can flow chart a PIC project.

Any pointers?


Comments

  • 24 Comments sorted by Date Added Votes
  • You haven't said what you intend to do.

    Keep in mind that neither the PIC nor the Stamp can directly drive more than about a 20mA load so you'll need some kind of driver chip if you intend to control more than that. There are plenty of examples in the Stamp's documentation on the use of a stepper motor and the hardware would be essentially the same for a PIC.

  • 'You haven't said what you intend to do.'

    1 Board of Education or Homework board.

    2 Parallax Standard Stepper motor.

    3 Sample program from Parallax.

    Get it working.



  • 'There are plenty of examples in the Stamp's documentation'

    I'm thinking of the one in 'What's a microcontroller?'.

    It's probably the simplest.

    One from Stampworks manual for example might be pretty complicated.


  • Parallax doesn't carry a "Standard Stepper Motor." Did you mean the Parallax Standard Servo Motor?

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery

  • ' Did you mean the Parallax Standard Servo Motor?'

    No.Better stick with steppers.

    Will use one of these.

    http://www.futurlec.com/Mini_SMCC.shtml

    May do the Parallax servo lesson. Probably can't hurt .


  • @microcontrolleruser, the stepper pictured in your link is a six-wire, unipolar stepper. There also is a four-wire or 'bipolar' stepper.
    You'll probably need something like this
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  • Thanks!

    We do have loose stepper motors that would be good for.

    Right now we will get the 'all in one' Futurlec board and get this done.



  • 'Keep in mind that neither the PIC nor the Stamp can directly drive more than about a 20mA load so you'll need some kind of driver chip'

    Here's the stepper driver circuit.

    http://www.futurlec.com/StepperMotorController.shtml

    Forgot we already knew about it.

    We have about 4 stepper motors in the lab including the little Parallax one.


  • A couple of things to keep in mind: A dedicated motor driver PCB is designed to handle the current and the inductive spikes generated by the motor. Think of your microcontroller as the 'brain' and your motor driver as the 'muscle'.
    One other thing to note: The stepper in your first link is 'unipolar'. The driver in your second link is for 'bipolar' steppers. They require different IC's to drive them. If you already have the L298 driver PCB then order a bipolar stepper.
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  • 'One other thing to note: The stepper in your first link is 'unipolar'.'

    I got it. While we work with the unipolar motor keep in mind the 298 driver circuit/bipolar loose motors will be different.

    Will post PBasic and assembler code when we get it done.

    There's your PBasic to assembler conversion. Migrate it by hand! Both will match the flow chart.

    Thanks!



  • Remember where we left off with this before.

    https://www.parallax.com/sites/default/files/downloads/27964-Stepper-Motor-Documentation.pdf

    What is this stepper motor we have?

    Two part numbers.

    PM4222

    20120726

    7.5 degree 100 ohm

    Is this the parallax stepper motor?


  • msrobotsmsrobots Posts: 2,001
    edited April 4 Vote Up0Vote Down
    Parallax usually does not sell Stepper Motors. Parallax does sell RC-Servo Motors. Complete different animals.

    A RC-Servo Motor like Parallax sells is usually used for RC-Models or MC controlled robots. I has 3 pins, Power, Ground and Pulse. The power for the Motor is provided by Power and Ground, the Step pulse can come directly from a MC pin, it needs not much current.

    You apply power and Ground constantly and send a PWM signal on the pulse pin. Depending on the frequency of the pulse you are sending the Servo will move to a certain angle.

    Stepper motors on the other hand do NOT react to RC-Servo pulses, but need to be driven by engaging different wires in a certain order to step thru a cycle, usually 4 or 6 wires. In their case the power and current needed for the motor is provided thru the switched/engaged wires.

    You can NOT drive a Stepper Motor directly from MC-Pins. To much current. You will need a stepper driver or build one by yourself with transistor's, Darlington's or Mosfet's, depending on the needed Voltage and Current of the used Stepper Motor.

    And then there are Industrial Servo Motors, again a different animal with different needs, they are mostly not affordable for hobbyist money.

    You seem to be pretty ignorant of basic knowledge and throw around words without understanding their meaning.

    If you ever want to be a engineer you need to learn to be very precise with the meaning of words.

    Enjoy!

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • microcontrollerusermicrocontrolleruser Posts: 958
    edited April 4 Vote Up0Vote Down

    Sorry about that!

    Put the question in wrong post.

    Thanks for the advice.
    '


  • microcontrolleruser,

    I think that's the model my StampWorks kit came with.

    20120726 looks like a date code (7-26-2012)

    7.5 degrees per step and 100 Ohms per coil sound like the correct specifications.


    I also doubled checked some notes I have on Steppers and for a Unipolar you connect ground to Common (middle of the coil) and then apply power to one of the coil ends.

    A 7.5 degrees per step motor would require 48 steps per revolution. (360 degrees per revolution / 7.5 degrees per step)

    Yellow
    Brown
    Orange
    Red
    Black
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 21,990
    edited April 4 Vote Up0Vote Down
    To drive that motor, you should obtain a ULN2003 IC. Connect the IC's COM pin and the motor's two common leads to the positive drive voltage, and the motor's other leads, each to one of the IC's outputs. (I thought Parallax carried these, but I couldn't find them on their website. DigiKey carries them.)

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery

  • Thanks Phil

    I picked up one from Parallax before they ran out.

    They are readily available from Arrow Electronics and others.

    Yes. The Mini Board and Driver Board from are more complex but I think there is a reason for it.

    Anyhow. Doing LED and Servo experiments before tackling stepper.



  • Just to pull things together.

    The stepper experiment is the primary goal.

    Just need to sort out these little stumbling blocks.

    LED output board and pushbutton board.


  • microcontrolleruser,

    Experiment #27 of StampWorks (p. 150) shows how to connect and program a Stepper Motor.
    The motor driver chip is built onto the Professional Development Board that the kit uses but you can always wire it up on a breadboard.
    It uses the L293D which you can buy separately or as a module.

    The program uses Full Stepping.
    Notice how it always changes 2 of the coils pins at a time.

    In the Challenge at the end of the experiment it has the steps for Half-Stepping the motor.
    It uses the Full-Stepping cycles and then adds the positions between steps.
    Notice how each added step only uses one pin.
    A stepper can be driven by changing only 1 pin at a time but this doesn't produce much torque compared to Full-Stepping.
    Half-Stepping the motor doubles the number of steps per revolution.

    Experiment #26 (p. 146) uses a servo.
  • microcontrolleruser,

    The manual is fine and you can use the schematic and code in it for that stepper, which is unipolar.

    StampWorks has a circuit and code that works for both unipolar and bipolar stepper motors along with an explanation of what the code does.

    Since it's a unipolar stepper it can also be driven using 4 switches instead of a chip.
    The sequence is what moves it around, which appears to be Black, Orange, Brown, and Yellow.
    Looking at the diagram, Red is the common, which connect to Ground.
    Then connecting 12V to BLK, ORN, BRN, and YEL in order should move the stepper Clockwise.
    Using Yellow, Brown, Orange, and Black will move Counter-Clockwise.

  • 'Since it's a unipolar stepper it can also be driven using 4 switches instead of a chip.'

    Why that is pretty handy!

    That is going to be first experiment.

    Wait a minute.You say 'switches'. What about Stamp signals?

    Is that the catch here? Switches w/12v. The Stamp cannot power or 'drive' the stepper because it is 5v and not much amps?

    I will look at 2003 ic again.Is it 12 v and 5v circuits?



  • Okay.See the 12 volts in document schematic.

    So yes ULN 2003 powers stepper with 12 volts yet it takes 5v signals from PIC/Stamp.

    Got it!


  • microcontrolleruser,

    I double-checked and my StampWorks kit came with a PM4222-09 Stepping Motor.

  • Thank you.

    Matched up one stepper motor here as Parallax stepper.

    Document is for their motor so should work.

    Will look up that part # of yours.


Sign In or Register to comment.