"endstop setup is ...x endstop RH side of carriage. Y endstop at rear of carriage, z endstop left hand side and at bottom."
so x is a max endstop, y is a min endstop and z is a min endstop
so
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR 1
#define Y_HOME_DIR 1
#define Z_HOME_DIR 1
should be
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR 1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1
now if it homes in the wrong direction you have to invert the axis direction, not the homeing direction.
ie play with the following as needed
#define INVERT_X_DIR true
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false
NB you haven’t mentioned your controller, some controllers, like ramps for eg, have different pins for min and max endstops, make sure this is also correct or the axis will not stop when it hits the endstop.
so x is a max endstop, y is a min endstop and z is a min endstop
so
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR 1
#define Y_HOME_DIR 1
#define Z_HOME_DIR 1
should be
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR 1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1
now if it homes in the wrong direction you have to invert the axis direction, not the homeing direction.
ie play with the following as needed
#define INVERT_X_DIR true
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false
NB you haven’t mentioned your controller, some controllers, like ramps for eg, have different pins for min and max endstops, make sure this is also correct or the axis will not stop when it hits the endstop.