Now that I have a SCARA machine (okay its made of MDF and wobbles like a clock spring), I can actually test the code.
Based on today's hack getting the SCARA working there are a few things I need to do:
- Set the UV space for degrees rather than steps (let GRBL handle the conversion).
- Speed up the serial code (its okay for 9600 baud but not 115200 Baud).
- Finish off the speed control code.
- Give the user the opportunity to save the SCARA gCode.
- Define a Home position (currently in XY space it is (0,0)).
- The "Print" button should change its label to "Pause" when printing to show the option.
This is the GUI at the moment:
The Motor 1 and Motor 2 parameters are now only used for the SCARA graphics. In general use (of the GUI) it is probably not of interest. You can always create a custom program for this.
The code at the moment turns the Spindle On and Off (i.e. M3 and M5) as if it is the Laser. But GRBL uses PWM (as does my Laser module) which is controlled by Spindle Speed (i.e S####). GRBL assumes a S0 is off and S1000 (or higher) is maximum power. So the initialisation code should set the Spindle Speed if the gCode does not set it.
GRBL also complains if the Feed Rate is not set in the initialisation Code.
At the moment my initialisation code is "G17S1000F600".
Serial speed is based on the xForms' idle call back. If the GUI is not busy then the idle call back is called at least once every 10 ms. While this is not slow with regard to gCode movements, it does look like its is slow when (say) checking GRBL's settings with "$$".
Perhaps a separate thread would be a better approach.
So still quite a lot of coding work to do.