Another (simple) 3-axis controller for SX28
Now that Polywogs has released his source for a--quite extensive--3-axis controller (see this thread), I thought it would be time for me to publish mine as well ![smile.gif](http://forums.parallax.com/images/smilies/smile.gif)
The code attached is a relatively simple controller for 3 stepper motors. It implements linear movements only (straight lines). The SX code listens to an RS232 line for commands of the form
and acts accordingly. While idle, the controller will scan a keyboard matrix, so that the motors can be manually controlled as well. While moving, three keys/switches (say 'start position detection', 'end position detection' and 'emergency stop') will be scanned continuously.
A more elaborate explanation is here
Electronics-wise, with a lot of help, I have this working with three attached steppers. Only, I very much lack the mechanics skills to create an actual CNC device out of this, so this project is currently 'paused'.
Please feel free to use this source-code any way you like.
Post Edited (spiff) : 11/13/2007 12:06:43 AM GMT
![smile.gif](http://forums.parallax.com/images/smilies/smile.gif)
The code attached is a relatively simple controller for 3 stepper motors. It implements linear movements only (straight lines). The SX code listens to an RS232 line for commands of the form
m <hex_x>, <hex_y>, <hex_z>
and acts accordingly. While idle, the controller will scan a keyboard matrix, so that the motors can be manually controlled as well. While moving, three keys/switches (say 'start position detection', 'end position detection' and 'emergency stop') will be scanned continuously.
A more elaborate explanation is here
Electronics-wise, with a lot of help, I have this working with three attached steppers. Only, I very much lack the mechanics skills to create an actual CNC device out of this, so this project is currently 'paused'.
Please feel free to use this source-code any way you like.
Post Edited (spiff) : 11/13/2007 12:06:43 AM GMT
SRC
![](/plugins/FileUpload/images/file.png)
31K
Comments
Nice code. If I had time I would like to convert it to SX/B. Have you tried the SX/B compiler ?
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
Thanks for the feedback. I started this as pure assembly because I had big plans with the ram/program space and wanted total control over the available bytes. The intention was to cram other VPs in the same space and I wasn't sure it would all fit if I moved to SX/B. Additionally I'm not sure I could have fitted the bresenham line drawing algorithm in an ISR at 4Mhz if it were written in SX/B.
But since SX/B may not be as heavy-weight as other Basic variants, there is a good chance that it still fits...
Is it the Bresenham algorithm that you would like an SX/B variant of, or just the main (non-ISR) code?
··· Nothing like the first time·for a·rush! Right?