I am not getting many replies, so I stripped down all the wiring and started again.
This time I only wired the stepper motors and the limit switches.
I turned off homing in the configuration to do the first test. The X and Y motors needed reversing, so instead of changing the configuration file, I physically changed the wiring so that the motors moved in the right directions. I made sure that $3=0
The test showed that the machine can move in all correct directions if I move the laser head to the "wanted" home position first by hand.
All working well so far.
Next I turned on the homing and set it as default of $23=0. The test showed that the machine was trying to home in the top right-hand corner, which is not where the limit switches are, so I stopped everything and changed $23=3 which should be the bottom left-hand corner.
I rebooted everything and did another test. The homing went correctly, Z lifted up, double bounced and then the X an Y proceeded to the lower left-hand corner, The Y stopped first and waited until the X reached the limit, stopped and both did a double bounce. All seems normal, no warnings from LaserGRBL.
I then tried making a movement, and I could move both X and Y in the positive directions, but when I tried to go negative again, that is returning to home, the movements were both in the positive directions again.
This has got me really beat, I feel I have checked everything and just can't work out what is going on.