Can't get my z endstop to stop the steppers.

been trying to upgrade my cr-10s with Duet 2 WIFI + Duet 5, i got most of it working(eventually) except for the Z endstop.
i've got both drive 2 plugs populated(2 z steppers) and z endstop plugged where it should be, when i try and home the z axis, the endstop is hit but the stepper keeps going until i switch the printer off.
the endstops LEDs are lit when they are not pressed(guessing active high), when i try home the z axis, it makes a funny sound for few seconds then drops past the switch. this is my config.g, please can someone help? ive been working on this upgrade for over a week. GRRRR

Can you also verify the max rated current for the z motor? Try to set the current at 70-85% of it's max.

You may also want to reduce your maximum allowed speed. Keep in mind that reprapfirmware specifies speeds in mm/min, which is different from Marlin which uses mm/sec. 1.2 million mm/min is a little crazy, and if the feed rate is ever set too high for a move you may have some issues. 300mm/s is 18000mm/min and is far more reasonable. Your Z axis probably isn't going to move much faster than 5mm/s anyway.

There have been some cases where the z axis being configured incorrectly can cause the motor to go in the opposite direction it thinks it is.

@phaedrux the max rated current on the 2 extra extruders are 2amp, the original creality steppers are cr-10 42-34 and i couldn't find current ratings for it. when i move the axis it was easier to move it down,

why is it that when i turn the printer off then on again, the settings have been saved but the endstop doesnt work and the z axis moves up when homing z, my endstop switch is at the bottom.

Have you by any chance got a config-overide.g file in your sys directory? If so does that have anything in it that looks like it might change the end stop behaviour? What happens when you first turn on the machine is that it will load config.g, then config-overide.g. So anything in config-overide.g will do what it says - i.e over ride the config.g settings.

If that is the case, then you need to save the changes in config-overide.g (or delete the file).

This is a bit of a long shot but would explain why settings change when doing a power cycle.

@rbtdata I'm not familiar with the CR10 but I've had a look at your config.g and your Z homing files and there seem to be some inconsistencies. Can you let us know where the end stops are physically connected. The most usual arrangement is to have them at the low end of all axes but it's not obligatory. Oh, and do you move the gantry up and down in Z, or the bed?

So the most common arrangement would be the X switch located on the left of the X axis, the Y switch located at the front, and the Z switch located at the top of the bed travel or at the bottom of the gantry if the bed is static in Z.