Inverting Z Stop Switch



  • Hey everyone. I'm working with the Duet Maestro board and had to replace the Z switch on my printer. My new switch is inverted from the stock one and I need to swap that in the firmware...but I'm not really sure how to go about that. I've done it in Marlin on another printer but am stuck here.

    From what I can see it is something to do with this section, but I don't know what I would need to change, or if I even have the right line. If anyone could point me in the right direction that would be amazing!

    // Endstops
    // RepRapFirmware only has a single endstop per axis.
    // Gcode defines if it is a max ("high end") or min ("low end") endstop and sets if it is active HIGH or LOW.
    constexpr Pin END_STOP_PINS[NumEndstops] = { 24, 32, 46, 25, 43 };



  • Where exactly are you getting that from? The source code? That's unnecessary, you can change the function of the endstops with normal gcode commands in the config.g.

    https://duet3d.dozuki.com/Wiki/Connecting_endstop_switches

    https://duet3d.dozuki.com/Wiki/GCode#Section_M574_Set_endstop_configuration



  • What @Phaedrux said.

    Coming from other firmwares wherein you change the source and recompile/upload... Duet-RepRap doesn't work that way. EVERYTHING is configurable in real time. Just issue the appropriate command, and/or change your config.g and reboot. It is extremely rare, if ever, that an "end user" would re-build (compile) the source.

    In fact, just to cement the concept: There is nothing special about config.g except that it gets "run" at boot time. You can issue any of those commands at any time. (Of course, there is a tiny bit of sequencing. For example, you really can't set the limit of heater before you define that heater. All common sense.)

    In your specific case, you might need to change:

    M574 X1 Y1 Z1 S1  
    

    to

    M574 X1 Y1 S1  
    M574 Z1 S0  
    

    Or vice versa... see: https://duet3d.dozuki.com/Wiki/Gcode#Section_M574_Set_endstop_configuration



  • Thank you!

    I was looking through the config.g file but wasn't sure what I might need in there. I was hoping there was a GCode command I could use, that makes life much easier 🙂

    Thanks again, have an awesome holidays!


Log in to reply