Change work co-ordinate automatically on homing

Hi, To make loading work easier and particularly when using the rotary axis, I want my MPCNC Primo to home to the rear left hand corner but for the work zero to be at the front left-hand corner. I entered the distance of 355mm in the mops line of the config.yaml for the Y axis which sets the machine position to this after homing but it sets the work position to ‘0’. How can I automatically have the Y axis set the work position to mpos after homing? Or, is there a way to automatically run a script when I home the machine but not if I don’t choose to home it?

Here is my yaml file:

board: 6 Pack
name: 6 Pack External XXYYZ Relay
meta: 2023-01-12 B. Dring
stepping:
engine: I2S_STREAM
idle_ms: 250
pulse_us: 4
dir_delay_us: 1
disable_delay_us: 0
axes:
shared_stepper_disable_pin: NO_PIN
x:
steps_per_mm: 100
max_rate_mm_per_min: 6000
acceleration_mm_per_sec2: 500
max_travel_mm: 500
soft_limits: false
homing:
cycle: 2
positive_direction: false
mpos_mm: 0
feed_mm_per_min: 300
seek_mm_per_min: 1800
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limit_neg_pin: GPIO.33:low:pu
limit_pos_pin: NO_PIN
limit_all_pin: NO_PIN
hard_limits: false
pulloff_mm: 5
standard_stepper:
step_pin: i2so.2
direction_pin: i2so.1
disable_pin: i2so.0
motor1:
limit_neg_pin: GPIO.32:low:pu
limit_pos_pin: NO_PIN
limit_all_pin: NO_PIN
hard_limits: false
pulloff_mm: 5
standard_stepper:
step_pin: i2so.5
direction_pin: i2so.4
disable_pin: i2so.7
y:
steps_per_mm: 100
max_rate_mm_per_min: 6000
acceleration_mm_per_sec2: 500
max_travel_mm: 500
soft_limits: false
homing:
cycle: 2
positive_direction: true
mpos_mm: 355
feed_mm_per_min: 300
seek_mm_per_min: 1800
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limit_neg_pin: NO_PIN
limit_pos_pin: GPIO.35:low
limit_all_pin: NO_PIN
hard_limits: false
pulloff_mm: 5
standard_stepper:
step_pin: i2so.10
direction_pin: i2so.9
disable_pin: i2so.8
motor1:
limit_neg_pin: NO_PIN
limit_pos_pin: GPIO.34:low
limit_all_pin: NO_PIN
hard_limits: false
pulloff_mm: 5
standard_stepper:
step_pin: i2so.13
direction_pin: i2so.12
disable_pin: i2so.15
z:
steps_per_mm: 400
max_rate_mm_per_min: 10000
acceleration_mm_per_sec2: 200
max_travel_mm: 250
soft_limits: false
homing:
cycle: 1
positive_direction: true
mpos_mm: 0
feed_mm_per_min: 300
seek_mm_per_min: 800
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limit_neg_pin: NO_PIN
limit_pos_pin: GPIO.39:low
limit_all_pin: NO_PIN
hard_limits: true
pulloff_mm: 5
standard_stepper:
step_pin: i2so.18
direction_pin: i2so.17
disable_pin: i2so.16
a:
steps_per_mm: 444.44444444
max_rate_mm_per_min: 8000
acceleration_mm_per_sec2: 500
max_travel_mm: 50000
soft_limits: false
homing:
cycle: 0
positive_direction: true
mpos_mm: 300
feed_mm_per_min: 100
seek_mm_per_min: 200
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limit_neg_pin: NO_PIN
limit_pos_pin: NO_PIN
limit_all_pin: NO_PIN
hard_limits: false
pulloff_mm: 1
standard_stepper:
step_pin: i2so.21
direction_pin: i2so.20
disable_pin: i2so.23
probe:
pin: gpio.36:low
check_mode_start: true
toolsetter_pin: NO_PIN
i2so:
bck_pin: gpio.22
data_pin: gpio.21
ws_pin: gpio.17

Begin OLED

i2c0:
sda_pin: gpio.27
scl_pin: gpio.25
spi:
miso_pin: gpio.19
mosi_pin: gpio.23
sck_pin: gpio.18

sdcard:
card_detect_pin: NO_PIN
cs_pin: gpio.5
oled:
i2c_num: 0
i2c_address: 60
width: 128
height: 64
radio_delay_ms: 1000
start:
must_home: false
relay:
direction_pin: NO_PIN
output_pin: gpio.26
enable_pin: NO_PIN
disable_with_s0: false
s0_with_disable: true
spinup_ms: 0
spindown_ms: 0
tool_num: 0
speed_map: 0=0.000% 0=100.000% 1=100.000%
off_on_alarm: false
Laser:
output_pin: gpio.4
off_on_alarm: true
speed_map: 0=0.000% 255=100.000%
enable_pin: NO_PIN

1 Like

That is the pull off to clear the endstop switches.

Use the default yaml and just make a macro instead. The macro should home, and them move to XY max. $H, then G0 X355 Y355 F2000.

Thanks Ryan, I’ll try that. I assume it is instead of using the homing function on the web UI and I should move the Y limit switches to the negative end..

Thanks