Web Control switches from mm to inches

My g-code when I read it in text has line 10 G20 but when I push play the units switch from mm to inches. Is there a way to move step by step through the code to see how I’m messing up? Here’s the code, The z axis needless to say hits the stops.

;Exported by FreeCAD
;Post Processor: centroid_post
;CAM file: /home/erik/CAD Files/Side Chair/Chair Back.FCStd
;Output Time: 2021-01-29 11:32:10.117371
G90 G80 G40 G49
;T1=T1__Default_tool
;begin preamble
G53 G00 G17
G20
;begin operation
;T1: Default tool
M6 T1
M3 S0
;end operation: T1: Default tool
;begin operation
G0 Z23.0000

I figured out through another post how to step through the code one step at a time and it looks like it is working correctly, but, today I’m noticing that when I push play it still changes from mm to inches but it converts the dimensions I have from mm to inches so my z axis doesn’t crash. I’m not out of the woods but I’m moving with my eyes open.

As I step through the code I expect the Maslow to step through with me , but it just sits there and figuratively thumbs it’s nose at me. What do I do to get the machine to follow so I can find the code creating the problem? As I step through nothing seems amiss but as soon as I press play the units change and now 23 mm is 2.37 inches so unless I stop the z axis crashes. Any clues?

change G20 to G21 . G20 = inches, G21 = mm. Your gcode is telling Maslow that “this file is in inches.” with G20

1 Like

That makes all the difference. I don’t know what the source of my g-code to English translation was that made me think G20 was metric but you are right replacing the G20 with G21 solves the problem.
Thanks for your help

2 Likes

one thing to note: when stepping through the file with webcontrol using the arrow buttons, it does so in preparation to start, not during the run, so if you halt unexpectely, you can go to that spot and then restart, but it won’t allow you to walk it up to that point while also moving the sled. I am not aware of any explanation of why it was done that way, but that is how it works. The Z > or <Z will move the gcode position to the next z move and that is generally a considered a safe way to start so you don’t cut directly from where the system sits.

1 Like

Yes indeed that is how it appears to work, Thanks again for your help.