{"id":"gcode-g40","model_id":"G40","name":"LinuxCNC G40 Compensation Off","summary":"G40 is the LinuxCNC G-code that turns cutter compensation off. If cutter compensation was active, the next programmed move must be a linear move longer than the tool diameter. Programming G40 when compensation is already off is accepted.","study_notes":["G40 cancels the cutter compensation started by G41 or G42.","After a G40 that ends an active compensation, the following move must be linear and longer than the tool diameter.","It is an error if a G2/G3 arc move is the next move after G40.","It is an error if the linear move after turning compensation off is less than the tool diameter.","The source example turns off compensation with G40 and then runs G0 X1.6, a linear move longer than the current cutter diameter."],"safety_notes":[],"sources":[{"url":"https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g40","title":"G-Codes","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":3,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"gcode","code":"G40","group":"cutter compensation","syntax":"G40","parameters":[],"dialect":"LinuxCNC","related":["gcode-g02"],"standards":[]},"url":"https://machineschema.com/instruction/gcode-g40","license":"https://creativecommons.org/licenses/by/4.0/"}