Shop OBEX P1 Docs P2 Docs Learn Events
Driving stepper motors — Parallax Forums

Driving stepper motors

StevezilaStevezila Posts: 35
edited 2009-08-24 22:14 in BASIC Stamp
·Does anyone have experience·running stepper drives with a BS2? I have a project·where I want to use a couple of stepper motors. I found a drive module referenced in another post, a Gecodrive. The drive only needs two inputs from a BS2 (I think) which will be way easer than building an H bridge and trying to make it work right. One is a direction signal and the other is the step pulse. The literature for the module says it's rated for up to 200khz and that it triggers on the trailing edge of the step pulse. Does that mean that I send a command frequency·of between 0-200khz·to the step pin and the motor "steps" at·a given·speed?· I assume that the direction pin changes direction by changing it from high to low. This seems just a little too easy. What am I missing? Do I need to ramp the stepper up/down, if so how should I do that. Possibly with PWM?

Thanks

Comments

  • dev/nulldev/null Posts: 381
    edited 2009-08-24 22:01
    Oh man. I just blew a pin on my Stamp today trying to get a M55SP-3NK stepper motor to run. I plukked it from a printer, it's rated at 24 volts, bipolar type. I used the L293D H-Bridge chip. I don't know what went wrong. Pin 8 (V+ supply input) on the chip started burning.

    I noticed the chip got very hot very quickly, so the motor might be drawing more current than the chip can handle. That's my buest guess. I don't have the spec for the motor and I can't find it. I noticed that the motor would jitter a lot, and not really run properly, so I tried changing the coil connections, and BOOM.

    To answer your question. You don't need PWM. Stepper motors work by supplying current to the coils in succesion. The rate at which you do this (frequency) determines the speed of the motor. See attachment.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • T ChapT Chap Posts: 4,223
    edited 2009-08-24 22:14
    The G210 Geckodrive is isolated with opto's. You can drive it easily with the Stamp, two pins required for step and direction. The thing is if you are trying to run the drive at microsteps then the Stamp may be on the slow side depending on the application.

    Depending on the speed you need to operate the motor at, plus the load that will be present on the motor, you may or may not need to ramp it. A stepper cannot start out with you giving it maximum speed (pulses on the step pin). You must ramp to maximum speed, although there may be some smaller motors that are exceptions. Ramping is a function of how closely spaced the pulses are (steps). To ramp or decel, you simply change the rate of the steps incrementally.

    An example of ramping is (generic)

    i = 30000
    loop
    'turn on step pin
    'wait for a short time to set the time ON (fixed pulse width)
    'turn off step pin
    pause = i 'wait for a time to set the speed of the motor
    i = x - rateToIncrease ' the pause gets shorter each pass, causing the motor to speed up due to faster pulses

    To decel, simple start out i as 0, and add to it each time. To set a maximum speeds, you limit how low i will get.
Sign In or Register to comment.