NXT - Simple X-Y Router coding
Well, as you can see this is my first post here, so hello to all!
I've been kicking around the idea of building a simple NXT router for a while now, and now that I've learned a bit about robotC the project seems much more feasible. I have a good basic working knowledge of robotC and C in general, but some aspects of this particular project are a little beyond me. I do, however, have a good idea of how the program _should_ work. Here are my goals for the finished machine:
- X and Y movement only (no Z-axis)
- Minimal program size (no sensors, manual calibration, etc)
- Flexible (tool path data to be read from text file - simplified g-code)
- Machine will cut straight lines only, no curves
As I mentioned, this program would read raw coordinate data from a text file, in a simplified g-code format. here's an example:
"G1" indicates the transit speed, and then there are the obvious x and y. The idea is, that once I build the machine itself, I'd need to find out how many actual motor rotations it would take to move the tool 1", which would then be stored as a variable, something like Xratio Yratio. Using the ratios, the program would be able to translate the file data to mechanical output. As far as writing the code goes, there are two things I haven't figured out how to do:
1. Read lines (individual values?) from a separate file, in order (ex. x1y1 - NEXT - x2y2 - NEXT - etc)
2. Keep the X and Y axis drive motors synched up to reach the destination point at the same time, or in other words linear point-to-point transitions. The best way to do this that I can think of is using the motor encoder sync function with a modifier ratio based on x2-x1/y2-y1.
I welcome any insight anyone can offer. I figured this project would be right up someone's alley! I plan to use the machine (target size is 10" x 10") to cut parts for micro indoor RC planes from light and/or soft foam.