MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
15.94k stars 19.08k forks source link

Add the posibility of setting home offset for seperate axis , and upd… #27015

Open Elias-Ta opened 3 weeks ago

Elias-Ta commented 3 weeks ago

This pull request adds two functions to M428:

  1. By sending M428 marlin will set the homing offset in the current position for the mentioned axis, can be one or more axis like X, Y, Z, A, .... or XYABC.

  2. By sending M428 P XYZ for example, marlin will add the last offset value for the mentioned axis to the current position and set it as the new homing offset, this function can be useful to set the physical zero position for the mentioned axis, and without using P marlin will just replace the old home offset value based the current position.

Example:

G1 Z5   ;will move Z axis to position 5
M428 Z   ; will set the position 5 as the new zero and will deduct 5 from the overall length 
G28 Z    ; home Z axis
G1 Z0   ; will move Z axis to what marlin consider as zero which is the physical position that used to be called 5 before.

now here we have two ways to set the homing offset again:

G428 Z   ; will set the offset to 0 therefore the last offset will be just replaced. 
G428 P Z   ; will update the homing offset and make the current position as the physical zero position no matter what is the current offset in the memory.

Description

Requirements

Benefits

Configurations

Related Issues

#27011