Shop OBEX P1 Docs P2 Docs Learn Events
Is there a "plug-and-play" object somewhere in the OBEX for running stepper mot — Parallax Forums

Is there a "plug-and-play" object somewhere in the OBEX for running stepper mot

ElectricAyeElectricAye Posts: 4,561
edited 2010-03-05 17:30 in Propeller 1
I've been looking for some SPIN code examples similar to what's provided for the Stamp for driving stepper motors, something that would demonstrate the various types of stepping, microstepping, etc. but much to my disbelief I can't find anything on the OBEX when I search for it. Might an object like that be buried somewhere in some other file or has nobody bothered to post a demo like that?

thanks,
Mark
smile.gif

Comments

  • ManAtWorkManAtWork Posts: 2,178
    edited 2010-03-02 15:48
    Hello Mark,

    sorry, I don't know the stamp examples. Are you looking for a pulse generator that generates the steps and you want to handle the motor driving externally, for examle with a TQ8435 that can do full to microstepping with a single chip? This would take travel distance and maximum pulse rate as input and would generate the desired frequencies including accelleration and decelleration ramps.

    Or are you looking for a driver that takes pulses as input and outputs analogue values for the nominal currents of the two coils (for use with an external chopper driver like the L298), or even PWM to directly drive the power stage transistors?

    Cheers
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2010-03-02 16:05
    Just to clarify, the TA8435 would not be taking the travel distance etc the object would, producing simple step and direction pulse streams for the 8435 (or the other chip mentioned in the other thread).

    Graham
  • RaymanRayman Posts: 14,877
    edited 2010-03-02 16:23
    I've posted some example code, fourth bullet on this page:

    http://www.rayslogic.com/propeller/Programming/Programming.htm

    Ray

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-02 16:24
    Actually, for demonstration purposes, I am looking for something very fundamental. The Parallax stepper motor has the following documentation that provides code for the Stamp and Jav, so I just presumed there would be something similar in SPIN in the OBEX.

    www.parallax.com/Portals/0/Downloads/docs/prod/motors/Stepper_Motor_27964.pdf

    Although I've used stepper motors in the past, I've never tried to control one with the Propeller so, as usual, I like to start at the very bottom and work my way up toward the fancy stuff you gurus do. Right now I'm just converting the aforementioned stuff into SPIN, but I was wondering if there was already something hidden somewhere in the OBEX that I could use as a reference.

    thanks,
    Mark
  • hover1hover1 Posts: 1,929
    edited 2010-03-02 16:25
    Check out Jon's Column #136 in the Nuts and Volts archive. It's called "Stepping Out With Spin"

    Jim
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-02 16:36
    Rayman said...
    I've posted some example code, fourth bullet on this page:

    http://www.rayslogic.com/propeller/Programming/Programming.htm

    Ray

    Hey Ray,
    I just downloaded your code and had a glance at it and it looks like precisely what I was hoping for.
    I bet it would make a good addition to some sort of Propeller education module working with steppers, etc.

    Thanks very much!
    Mark
    smile.gifsmile.gifsmile.gif
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-02 16:41
    hover1 said...
    Check out Jon's Column #136 in the Nuts and Volts archive. It's called "Stepping Out With Spin"

    Jim

    Excellent! Here's the link for it: www.parallax.com/dl/docs/cols/nv/vol7/col/NV136.pdf

    I think you guys have nailed it for me.

    many, many thanks!
    smile.gifsmile.gifsmile.gif
  • lardomlardom Posts: 1,659
    edited 2010-03-05 16:51
    I could post what I have if you still need it. My code does not include microstepping as I don't have a use for it yet. I will post it to obex eventually because it was tough to find and I think it should be available to everybody as basic building block code.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-05 17:30
    Lardom,

    Rayman's code combined with the aforementioned Nuts and Volts article provided what I needed to get started. But certainly I'm sure a lot of beginners would appreciate somebody taking the time to post a very basic code example in the OBEX, especially code that is well commented and explains things step by step. The Nuts and Volts article uses various tricks that beginners might not understand (making reference to a technique in C for example) and Rayman's code also uses a few simple tricks that I had to look up, so I'm sure a basic building block of code would be a welcome addition. Go for it!

    thanks,
    Mark
    smile.gif
Sign In or Register to comment.