Shop OBEX P1 Docs P2 Docs Learn Events
Stepper controlled by RC receiver — Parallax Forums

Stepper controlled by RC receiver

mordraidmordraid Posts: 5
edited 2011-06-22 15:28 in BASIC Stamp
I realize I am new and this has probably been beat to death, but even after searching feverishly I still have found only one project that relates to what I am trying to accomplish.

My RC truck has a steering system which is turned by a lead screw. I cannot use a servo to turn it because they are far too slow. The stepper can rotate much more quickly and I would like it to move proportionally just as an RC servo. Of course, I have not been able to make this work yet. Here is a link to a video I found in which an Arduino was used to interface the receiver to the stepper:

http://www.youtube.com/watch?v=8FNHrC7CIak

This is the type of motion I need, and once it works I can simply modify the code of my Stamp to move the motor many more steps with regard to the input so it turns faster. I have worked with experiment #26 and 27 in the StampWorks manual but instead of turning a pot to move the stepper I would like to connect to the stepper controller directly from the Stamp (I need a controller because the stepper is fairly powerful and the Stamp will not sink that much current).

So, if anyone can point me in some direction I would greatly appreciate it. I am a total amateur when it comes to code but willing to learn. I basically have the stamp, stepper and controller, but no know-how to make the two speak to one another. I have been trying to work this out for a long time.

Thanks.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-06-22 11:21
    Here's an interface and the steps (output sequences) required:

    attachment.php?attachmentid=81352&d=1305915650
  • mordraidmordraid Posts: 5
    edited 2011-06-22 11:34
    Thank you so much for your reply. The sequence above is already over my head, however (as much as it should not be). I do wish to operate the motor at half-steps in order to keep it as smooth as possible while swinging the steering components, so that much I can follow. Also, the stepper controller is already set up for receiving pulses from the Stamp.

    To be honest, I need the code. As much as I have attempted to make it work, so far nada. And I'm quite certain this is the last thing anyone wants to hear... 'I need the code'.

    Sorry to be such a dimwit ;-)
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-22 11:39
    The details of how to do this depend significantly on how the stepper controller works. Please post a link to a manual or datasheet.
  • mordraidmordraid Posts: 5
    edited 2011-06-22 11:52
    The controller is an SMCC-V2 which uses the L298N:

    http://www.obsidianwraith.com/L298N.pdf

    I cannot find a datasheet on the board itself, but I purchased it from here:

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

    Four inputs, four coil outputs.
  • mordraidmordraid Posts: 5
    edited 2011-06-22 11:54
    I can also post a high-res image of the board itself if that helps.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-22 12:08
    Can't help you much without more information about the stepper controller.

    R/C receivers produce a control pulse about 50 times a second with the width of the pulse specifying the servo position (typically 1ms to 2ms). The Stamp's PULSIN statement would be used to measure this. Essentially, you'd have a loop with a PULSIN that has to repeat more often than once every 20ms. You'd then have about 15ms to compare the position of the stepper (based on the number of steps or half-steps moved) with what's expected, then issue some number of steps (whatever would be possible in the time left), then repeat. Frankly, I don't think you'll be able to get a lot of steps done in the time available. You may be very disappointed in the speed.

    You may be happier with a Propeller. There's existing code (objects) for reading R/C receiver output and for controlling steppers. The Propeller is much faster than a Stamp and can do several things at once (like read the R/C receiver output and control a stepper).
  • mordraidmordraid Posts: 5
    edited 2011-06-22 12:32
    Thank you very much for the help.

    I have searched for more documentation on the controller board but can't find anything. I will look into the Propeller and see what I can learn.
  • ercoerco Posts: 20,256
    edited 2011-06-22 15:28
    Steppers add lots of complications and they can still miss pulses, so you need an encoder for reference.

    You might consider using a continuous rotation servo to drive your leadscrew. No electronics mod necessary to do this, and you can get any size servo you need to provide sufficient torque. But in either case, (this or the stepper) you'll need to add some feedback to know where you are, either a rotary or linear encoder.

    PS: PJ, I love your hand-drawn sketches. For real. Don't ever stop.
Sign In or Register to comment.