Marlin vs. GBRL Macros and code

I am in the process of upgrading my lowrider 3 from SKR Pro (Marlin) to a Jackpot CNC Controller. and have a few questions about gcode and whether there is a difference between marlin and GBRL gcode language?

fx, I have some macros I use daily on my SKR Pro, which I would like to continue using on my new Jackpot.

Would you please check if these macros still work in GBRL and if not make better suggestions for doing the same?

It is primarily switching between the Workspace Coordinate System and Machine Coordinates System as well as saving to EEPROM
That way I can resume a job after my lowrider has been switched off or by pressing the emergency stop… Believe me it has saved my job many times, or the ability to continue large jobs the next day.

Zero Workspace

G54 ; Switch to Workspace Coordinate System (Zero Workspace)

G91
G92 X0 Y0 Z0 ; Zero XYZ
G00 Z5.0 F300 ; Raize Z 5mm

M500 ; Store in EEPROM

Recover Zero Workspace

M501 ; Retrieve the stored settings from EEPROM

G53 ; Switch to Machine Coordinates System

G90 ; Absolute positioning

G28 Z F300 ; Home Z
G28 X Y F600 ; Home XY

G54 ; Switch to Workspace Coordinate System (Zero Workspace)
G0 F1000 X0 Y0
G0 F300 Z5

Save Workspace 1

G57 ; Switch to Workspace Coordinate System (Workspace 1)
G92 X0 Y0 ; Save XY Position

M500 ; Store in EEPROM

Load Workspace 1

M501 ; Retrieve the stored settings from EEPROM

G53 ; Switch to Machine Coordinates System

G90 ; Absolute positioning

G28 Z F300 ; Home Z
G28 X Y F600 ; Home XY

G57 ; Switch to Workspace Coordinate System (Workspace 1)
G0 F1000 X0 Y0

Zero Workspace XYZ Probe (3.175mm)

G54 ; Switch to Workspace Coordinate System (Zero Workspace)

; End of router bit needs to be within 20mm of edges and surface
%Diameter=3.175 ; Tool Diameter
%ThickZ=4,95 ; Z plate thickness
%ThickX=10 ; X plate thickness
%ThickY=10 ; Y plate thickness

;Probe Z first
G91 ; relative
G21 ; millimeters
G38.2 F130 Z-20 ;rough and loose
G0 Z1
G38.2 Z-2 F50 ; fine and accurate
G92 Z[ThickZ]; plate thickness ; sets Z height
F600
G0 Z10 F600 ; up
G0 X-30 F600 ; side
G0 Z-20 F600 ; down ready for probe
;Now probe X
G38.2 F130 X50 ;rough and loose
G0 X-1
G38.2 X2 F50 ; fine and accurate
G92 X-[ThickX+Diameter/2] ; Xplate plus half tool diameter 
;Sets X Zero
G0 X-1
G0 Z20 F600 ;up
G0 X30 F600 ;side
G0 Y-30 F600 ;back
G0 Z-20 F600 ; down ready for probe
;Finally probe Y
G38.2 F130 Y50 ;rough and loose
G0 Y-1 
G38.2 Y2 F50 ; fine and accurate
G92 Y-[ThickY+Diameter/2] ; Yplate plus half tool diameter
;sets Y Zero
G0 Y-1
G1 Z20 F600
G1 Y20 F600

M500 ; Store in EEPROM

I have many more, but they resemble these macros.

Thanks in advance

1 Like

I’m going to follow this

I have tried to change it myself, from what I can see it is done differently in GBRL than Marlin.

Does it look right? Haven’t tested it myself yet.

Zero Workspace

G21 ; Set units to millimeters
G90 ; Set to absolute positioning
G10 L20 P1 X0 Y0 Z0 ; Set G54 X and Y offset to zero
G0 Z5 ; Move Z-axis up by 5mm

Z-probe

G21 ; Set units to millimeters
G90 ; Set to absolute positioning
$H Z ; Home the Z-axis
M0 Attach probe ; Pause
G38.2 Z0 F50 ; Probe downwards at a speed of 50 mm/min until contact is made
G10 L20 P1 Z4.95 ; Set the G54 Z offset to compensate for the probe plate height 
G1 Z10.0 F900 ; Raize Z 10mm
M0 Remove probe ;Pause
G1 Z5.0 F900 ; go to Z 5mm

XYZ-Probe (3.175mm)

; End of router bit needs to be within 20mm of edges and surface
$Diameter=3.175 ; Tool Diameter
$ThickZ=4.95 ; Z plate thickness
$ThickX=10 ; X plate thickness
$ThickY=10 ; Y plate thickness

; Probe Z first
G91 ; Set to relative positioning
G21 ; Set units to millimeters
G38.2 Z-20 F130 ; Rough and loose probe in Z-axis
G0 Z1
G38.2 Z-2 F50 ; Fine and accurate probe in Z-axis
G10 L20 P1 Z$ThickZ ; Set Z height to plate thickness
G0 Z10 ; Move Z-axis up
G0 X-30 ; Move to the side
G0 Z-20 ; Move down ready for probe

; Now probe X
G38.2 X50 F130 ; Rough and loose probe in X-axis
G0 X-1
G38.2 X2 F50 ; Fine and accurate probe in X-axis
G10 L20 P1 X[$ThickX+$Diameter/2] ; Set X Zero

G0 X-1
G0 Z20 ; Move up
G0 X30 ; Move to the side
G0 Y-30 ; Move to the back
G0 Z-20 ; Move down ready for probe

; Finally probe Y
G38.2 Y50 F130 ; Rough and loose probe in Y-axis
G0 Y-1
G38.2 Y2 F50 ; Fine and accurate probe in Y-axis
G10 L20 P1 Y[$ThickY+$Diameter/2] ; Set Y Zero

G0 Y-1
G1 Z20 ; Move Z-axis up
G1 Y0 ; Move Y-axis to Zero
G1 X0 ; Move X-axis to Zero

Recover Zero Workspace

G21 ; Set units to millimeters
G90 ; Set to absolute positioning
$H ; Home the machine to hard limit stops
G54 G0 X0 Y0 Z0 ; Move to G54 workspace zero position in absolute coordinates

Save Workspace 1

G21 ; Set units to millimeters
G90 ; Set to absolute positioning
G10 L20 P2 X0 Y0 ; Set G55 XY offset to zero

If your Jackpot still has what it came with from Ryan, then there is a macro on the main dashboard for saving. If you look in the Gcode for the macro, if I’m not mistaken, there is only a single command. It would be easy to copy that command and include it in your macros in place of M500.

you apparently don’t need M500 and M501 as it automatically saves the workspace coordinates.

I have tested some of my own fixes. eg zero xyz and then recovery after power failure. and it seems to work. but I get errors on M0 commands and the job stops

1 Like

@Henrik
Please keep this thread going until you figure it out. I would like to be able to use it. I am just learning about workspace and machine coordinates.

Have you all seen Bart Dring’s YouTube video illustrating these workspace coordinate offsets? It’s very helpful.

The correct syntax for FluidNC is

M0 (MSG Attach probe)

If you want “Attach Probe” to show in the terminal on pause

Full listing of FluidNC supported GCodes are here:
http://wiki.fluidnc.com/en/features/supported_gcodes

2 Likes