Shop OBEX P1 Docs P2 Docs Learn Events
SX for Stepper control — Parallax Forums

SX for Stepper control

bennettdanbennettdan Posts: 614
edited 2007-08-23 12:12 in General Discussion
Hello,

··· I have just purchased a old CNC mill that has stepper motors on all three axis what I want is to use an SX to output step pulses to the stepper drives I have. I also want to keep up with the pulses and convert it to an inch value and display that data on a LCD screen. I want to use the controller to change direction and speed with a switch and a POT also I am to be able to enter a value on a 12 digit keypad and have the SX pulse out the proper amount of pulses to reach that value.

The questions I have is can I pulse out of more than one pin at the same time? The pulses do not have to refresh and certin rate because to stepper drive just moves the motor according to how many pulses they recieve,·They dont have to be refreshed like a servo.

One more question can I use the SX/B to program these functions?
Sorry to ask such basic questions but I want to start working with the SX chips and advance from the·Stamps.·

Comments

  • BeanBean Posts: 8,129
    edited 2007-05-10 18:22
    The easiest way would be to have an interrupt routine generate the pulses to drive the steppers.

    If you run the SX at 50MHz you should have more than enough speed even using SX/B.

    Keep the interrupt code as simple as possible, do all the calculations in the main code.

    Ideally you would just have a counter for each motor. The interrupt routine would check if the counter is greater than zero, if it is it will generate a pulse then decrement the counter.

    To move at different speeds or to move more than one axis at a time is more complecated but should be doable.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Educate your children to self-control, to the habit of holding passion and prejudice and evil tendencies subject to an upright and reasoning will, and you have done much to abolish misery from their future and crimes from society"

    Benjamin Franklin
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • bennettdanbennettdan Posts: 614
    edited 2007-05-10 18:37
    Thanks Bean

    I basically want to be able to zero the position and then enter a distance and then it go to that distance. I also want to be able to jog the table manually. I will order the hardware soon I could use more that one SX and have a main SX tell the other SX chips how far to move then they could execute the travel loop and then send back to the main how far it moved then display it to the LCD. I wont move the two axis together much but would a Propeller be better if I wanted to move say two axis at once?
  • BeanBean Posts: 8,129
    edited 2007-05-10 18:43
    I would stick with one SX. Getting them to communicate would probably be harder than just do it with one SX.
    The Propeller would work great, but you would propably have to use some assembly. I don't think spin would be fast enough to drive the steppers (maybe using the hardware counters ???).

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Educate your children to self-control, to the habit of holding passion and prejudice and evil tendencies subject to an upright and reasoning will, and you have done much to abolish misery from their future and crimes from society"

    Benjamin Franklin
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • JonnyMacJonnyMac Posts: 8,942
    edited 2007-05-10 18:50
    Actually, you can use Spin to drive steppers -- I did it in a N&V project last summer. The code and circuits are on Parallax's web site.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-05-10 19:26
    bennettdan,

    Take a look at the SX48 Proto Board and determine if it is a form factor with which you might like to work. For $10 this is a great way to develop your project. An SX48 should be able to do all that you have described and probably entirely in BASIC no less!

    - Sparks
  • JonnyMacJonnyMac Posts: 8,942
    edited 2007-05-10 21:42
    Good idea, Sparks, I'm doing exactly that with an SX28 Proto Board and L293D so that my board can drive a unipolar or bipolar stepper. I'm going to make it AppMod compatible so that it can be controlled by a BASIC Stamp.
  • bennettdanbennettdan Posts: 614
    edited 2007-05-10 21:49
    Hey guys I like the SX48 Proto board but I only need 6 outputs to run my stepper motor drives I have 3 axis 1 direction pin and 1 pulse pin the drive takes the pulses and turns them into the pulses to the stepper motors.
    Do I have to buy a 50Mhz resonator to use with the protoboard?
    By the way I am using Gecko Stepper drives on my mill they handle the 60vdc 9amps the motors need.
  • JonnyMacJonnyMac Posts: 8,942
    edited 2007-05-10 21:57
    The SX28 Proto Board has the same form factor. If you're not doing serial comms you could probably get away with the internal 4 MHz oscillator.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-05-10 23:24
    True... The SX28 protoboard has the same form factor. It also has the same PRICE!

    The choice between the two protoboards should obviosuly be based upon the device that will be used in the final project. Yet sometimes the protoboard itself can be the final project! Since the SX48 offers twice the program memory of the SX28 in additon to more internal RAM and more I/O pins it seems like an obvious choice for ANY project that can be completed on the protoboard itself.

    Bennettdan, if you can complete your project on a protoboard, I recommend going with the SX48 if only because it has more memory than the SX28 for the same price. To me, the only real advantage the SX28 has over the SX48 is that the DIP packaging of the chip is much easier to work with as hobbiests.

    I hope that helps.

    - Sparks
  • bennettdanbennettdan Posts: 614
    edited 2007-05-10 23:48
    Thanks guys for the help I will post pics and progress as it comes.
  • ProfessorwizProfessorwiz Posts: 153
    edited 2007-08-16 01:24
    Any new updates, or pics? Which old cnc did you pick up?
  • bennettdanbennettdan Posts: 614
    edited 2007-08-18 05:54
    Professorwiz,
    It is a bridgeport series 2 mill it was an old NC machine it used punchcard system it has stepper motors for the table and mill head.
  • ProfessorwizProfessorwiz Posts: 153
    edited 2007-08-23 12:12
    That's a nice piece of iron!· Any updates on it?
Sign In or Register to comment.