Macro - SmartHome
Posted: Wed Sep 13, 2017 9:27 am
This macro makes "smart homing". It homes the axes in the order defined in Configuration/General settings/Homing sequence. The main difference between the default homing and this macro is that you can define backoff for the axes. The other difference is that it handles SoftLimit. When the home position is over the SoftLimit position and SoftLimit is on, then UCCNC will give a SoftLimit error when backing off from the home position, so for the backoff it turns off the SoftLimit.
You have to add to your profile a [SmartHome] section, where you set the parameters. The G28Move<axis>=true/false option enables or disables the backoff move, and the G28Goto<axis>=<coord> value defines the backoff position. Here is a sample:
You can call this macro with or without a Q parameter. If you omit parameter Q, then a field will control the homing (see below). If Q exists, then only one axis is homed, where Q=0..5 as X, Y, Z, A, B, C.
I put a field outside of the screen to be invisible, and a slider to control its value in the range of 0..6. 0..5 is the same as parameter Q and 6 means home all: it homes the axes in the order defined in Configuration/General settings/Homing sequence. (The field and slider number is given in SmartHomeAxisFld.) So I have a button and a slider to control which axis to home.
After homing the status looks like this:
You have to add to your profile a [SmartHome] section, where you set the parameters. The G28Move<axis>=true/false option enables or disables the backoff move, and the G28Goto<axis>=<coord> value defines the backoff position. Here is a sample:
- Code: Select all
[SmartHome]
G28MoveX=true
G28GotoX=0.0
G28MoveY=true
G28GotoY=0.0
G28MoveZ=true
G28GotoZ=45.0
You can call this macro with or without a Q parameter. If you omit parameter Q, then a field will control the homing (see below). If Q exists, then only one axis is homed, where Q=0..5 as X, Y, Z, A, B, C.
I put a field outside of the screen to be invisible, and a slider to control its value in the range of 0..6. 0..5 is the same as parameter Q and 6 means home all: it homes the axes in the order defined in Configuration/General settings/Homing sequence. (The field and slider number is given in SmartHomeAxisFld.) So I have a button and a slider to control which axis to home.
After homing the status looks like this: