SX for Stepper control
bennettdan
Posts: 614
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.·
··· 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
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
·
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?
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
·
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
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.
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
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.