E3D toolchanger upgrade: X-and Y- axis homing switches installing and configuring

My E3D toolchanger appeared to have some small inconsistencies in homing X and Y.

This became apparant after I tried to tune the exact positions of the tools pickup, after having homed.

Every time it was tuned, it worked well and the next day it was just a bit off. Then I retuned it again, and after a day it was off again.  Not a lot, but just 0.1 mm or a bit more.  But it did cause problems with the toolchanges.

So- after reading a bit I found that others had this problem as well and produced a solution: Just put in a couple of good X- and Y homing switches!

I even found the to be printed 3d-parts for mounting these switches. Thanx for this, folks!

The switches are the same type as for the Z-switch.

X-axis end switch
Y-axis end switch

I printed the mounts in PETG carbon on my Prusa mini and mounted  both switches on the E3D toolchanger.

After this, I amended config. g and the homing files, please see the rest of my post for this:

CONFIG.G CHANGES

; Endstops
M574 X1 S1 P”xstop” ; X min active high endstop switch
M574 Y1 S1 P”ystop” ; Y min active high endstop switch
M574 C0 ; no C endstop
M574 Z0 P”nil” ; no Z endstop switch, free up Z endstop input as Z endstop switch. (I changed  this part for correct working with RRF3.3+)

NEW HOMING FILES:

; homex.g
; called to home the x axis

M98 P”homey.g” ; Home Y always before homing X

G91 ; use relative positioning

G1 H2 Z3 F5000 ; lift Z 3mm
G1 H1 X-400 F15000 ; move left 400mm, stopping at the endstop
G1 X5 F15000 ; move away from end
G1 H1 X-400 F2000 ; move left 400mm, stopping at the endstop
G1 X2 F2000 ; move away from end
G1 H2 Z-3 F1200 ; lower Z

G90 ; back to absolute positioning

; homeall.g
; called to home all axes;

M98 P”homec.g” ; Home C (ToolHead)

M98 P”homex.g” ; Home X

M98 P”homez.g” ; Home Z

G1 X150 Y-49 Z20 F15000 ; Park

; homey.g
; called to home the Y axis

G91 ; use relative positioning

G1 H2 Z3 F5000 ; lift Z 3mm BED DOWN
G1 H1 Y-400 F15000 ; move to the front 400mm, stopping at the endstop
G1 Y5 F15000 ; move away from end
G1 H1 Y-400 F2000 ; move to the front 400mm, stopping at the endstop
G1 Y2 F2000 ; move away from end
G1 H2 Z-3 F1200 ; move Z BED UP

G90 ; back to absolute positioning

Z homing did not change and remains as is:

; homez.g
; called to home the Z axis
M98 P”Coupler – Unlock.g” ; Open Coupler
G91 ; Relative mode
G1 H2 Z5 F5000 ; Lower the bed
G90 ; back to absolute positioning
G1 X150 Y100 F50000 ; Position the endstop above the bed centre
M558 F1000 ; speed to 1000
G30 ; probe x 1
M558 F300 ; speed to 300
G30 ; probe x 1