@Gerry
Hi Gerry,
thanks for your interest in my GRBL solution for the SC mills!
Of course I like to share the code, see the attached files. "GRBL_SC" is the modified GRBL 0.8c as AVR Studio 6.1 project, "GRBL Ctrl" is the controller software which is a VB2ß10 project.
The modifications I made to GRBL was primarily the homing cycle, to accomodate the fact, that all reference switches are connected in series.
As GCode differs from WINPC-NC in moving the Z-axis (as I understand in GCode the lowest position is 0 in opposite to WinPC-NC where the highest position is 0), the position of a SC420 is X = 0, Y = 418, and Z = 81 when the homing cycle is completed. To tell GRBL were the absolute coordinates of the machine are after homing (because they are not simply X=0, Y=0, Z=0) I used the G28 position, which is read after homing. The G28 position is permanently saved in the EEPROM of the AVR.
To set it, simply move "virtually" (GRBL WITHOUT the mill connected) to that position by typing
G0 X0 Y418 Z81
for the SC420 in your favourite terminal program (PuTTY), check if the position is reached with some "?" commands, and type
G28.1
to store that position. Done. For the other models change the Y coordinate appropriately.
The second modification I did was to implement jogging in the hit & hold button -> move, realease button -> stop manner. The start command is a move in machine coordinates either to max or minimum position i.e. "G53 G1 F1800 Y0" to move fast to Y0 (to the front). The movement is stopped by sending "*" as a runtime command to GRBL. It works like feed hold ("!") but clears the buffer to cancel the command, wich is of course not completed. After "*" the machine is idle and ready for the next command. G53, which GRBL luckily supports, moves in machine coordinates so that it not depends on the current work-coordinate system. This way jogging is very easy. Another benefit is, that jogging moves do not exceed the physical machine limits, they are "automatically" stopped at the far ends.
Oh, I nearly forgot to mention that I've modified the pinout to accomodate my perfboard layout!
A warning for my GRBL_SC controller: it is far from being finished yet! So all of the parameters are set in the source code, even the com port number. But hey, try it out and of course you are welcome to give a lot of feedback.
Some hints to use it:
- Most of the controls are locked before homing. Homing and having the correct absolute coordinate is essential for my jogging mechanism.
- In the "File" menu there is "Show Log" which is more or less the communication log with GRBL.
- After loading a GCode file it is checked for errors. If there are any, "Play" or "Go" ist blocked.
- Goto "X0", "Y0" and "Z0" are blocked as long as you diddn't have set them.
- There is security feature which moves the Z-axis to the maximum height prior moving to X0 or Y0.
Have fun testing and let me know how it works for you!
@Thomas:
Hallo Thomas,
GRBL und die Fräse passen prima zusammen! Natürlich hätte ich gerne eine Platine, natürlich gegen Unkosten etc.! Die galvanische Trennung über die Optokoppler finde ich super. Geht zwar auch ohne, ist aber ein echtes Sicherheitsfeature.
Ich hoffe, Du bist aus den Erläuterungen für Gerry schlau geworden, genau, mindestens das Homing musste angepaßt werden, ist aber erledigt!
Allerdings werde ich mich wahrscheinlich eher um TinyG kümmern, weil GRBL ja die 4. Achse fehlt. Das ist für den 3D wichtig, an dem ich ja auch dran bin. Vielleicht schaust Du Dir das mal an und machst dafür auch eine Platine?! Da ist ein AT Xmega verbaut.
@Hans:
Hallo Hans,
der Teensy ist ja wirklich süß! Ich hatte die Teile schon rumliegen, so ist es der etwas gröbere Lochrasteraufbau geworden. Aber Thomas hat ja eine Platine gemacht...
@Alle:
Viele Grüße,
Jörg
Sorry, but I can't attach the ZIP files with the aource code, please send a PM!
@Thomas (Dbg):
Kann man keine ZIPs anhängen? Die sind weit unter 1MB!?