Hi,
I am happily using Repetier Host with my STARTT3D (clone of TRONXY XY-100) with repetier 0.92 firmware. I am currently doing a small upgrade to the printer with a custom small drill, mounted on the cursor. This is used to help me in doing PCB prototypes of course. I was able to program the printer to drill all holes (exported from an Excellon file by FlatCAM), and the result was very nice.
Now I would like to try to "Cut" the board with a mill but I need to perform multiple passes for the profile of the PCB, with very small increments of the Z axis. I mean 20 or more passes. So I was interested in a way to implement a "loop" in the code.
Since the g-code is sent line by line from the editor of the host to the controller, it would be possible to implement host-specific codes, like for example @execute command param1 param2 to define a label in the source code, a counter and a conditional statement to perform a loop, something like this:
@setVar 1 0 ; set var "1" equal to "0",
; maybe a small array of variables can be defined.
@label 1 ; set label "1" to this line number of the gcode source
; Profile pass
G1 Z-0.02 F10
G4 P250
G1 X+38.8000 Y0.0000 F1
G1 X0.0000 Y+33.5000 F1
G1 X-38.8000 Y0.0000 F1
G1 X0.0000 Y-33.5000 F1
@incrementVar 1 ; increment var "1" by one.
@checkVarGreaterVal 1 20 ; check if var "1" is greater than value "20" and
; store a flag (0:false 1:true)
@gotoLabelIfTrue 1 ; go to label "1" if the flag is true
; (after that reset the flag)
; otherwise ignore the goto and move on.
...
This is inspired by a typical assembly approach when implementing a controlled loop, but I think it could be possible and not that much difficult to implement. Maybe this could be a start point for more complex workflows. I really hope that this could be done :)
Francesco.