Here is the code:
I tried to add a custom command button from the LCD of the machine for the corner finder.G38.2 Z-15 F100; Probe Z
G92 Z3.15; Set Z work to 0 (with the thickness of the plate)
G91 G0 Z3; Move Z up by 3mm
G91 G0 X-40; Move X by -40mm
G91 G0 Z-6; Move Z down by 6mm
G38.2 X15 F100; Probe X
G92 X-10.9; Set X work to 0
G91 G0 X-3; Pull bit away from the plate by 3mm
G91 G0 Y-35; Move Y by -40mm
G91 G0 X30; Move X by 30mm
G38.2 Y15 F100; Probe Y
G92 Y-10.9; Set Y work to 0
G91 G0 Y-3; Pull bit away from the plate by 3mm
G91 G0 Z6; Raise by 6mm
I noticed that the LCD restarts itself when I try to run this command. Here is a video:
I tried to debug this by adding one line after line of the code to see which one is making trouble.
I found that after the command "G92 X-10.9; Set X work to 0" - the machine won't accept any commands after it.