I making an Arduino-based X-Y laser cutter. I've built the mechanics for it and accomplished basic motion, but I am having trouble getting it to plot lines and curves. I eventually want to be able to convert SVG or Illustrator files to Gcode or have the Arduino interpret and plot them directly
There are libraries like GRBL and Rstepper that provide 2-wire (step and direction) instructions based on Gcode. The problems is that I'm driving two stepper motors using ULN2003 chips, which use 4 wires to step through the phases of the motor.
Could I make either of these libraries work for 4-wire control?
If not, I will need to find another way to plot my designs.
How I'm currently thinking of making functions for SVG or G-code style instructions.
//given a new position to go to and how we want to get there (i.e. curves)
for (i=0;xposition!==newx;i++) //run until x gets to the right spot
{
//get the values for X, Y, NewX, NewY, and any other parameters (e.g. for curves)
//figure out how many steps (say, +1 or -1) x should take for cycle number i
//figure out how many steps y should move given new x
//make the x stepper step the right number of steps
//make the y stepper step the right number of steps
//delay (control speed for adequate laser burning & don't make the steppers angry)
}
Will that be too slow?