Different configurations based on switch/input setting

  • I’m setting up a printer with multiple tool heads and would like to be able to have connecting a cable change the configuration of the Duet.

    Something like having a command which specifies one ore more input lines (e.g. GPIO 1-3, with pull-up option) which then specify the folder for the system commands (like M505).

    Each tool head’s cable would set the binary values of the specified input lines to different states to indicate which configuration to use. Something like:

    Tool 1 - GPIO1=gnd, GPIO2=gnd, GPIO3=gnd - config is in folder “Config-0”
    Tool 2 - GPIO1=open, GPIO2=gnd, GPIO3=gnd - config is in folder “Config-1”
    Tool 3 - GPIO1=gnd, GPIO2=open, GPIO3=gnd - config is in folder “Config 2”

  • administrators

    That will be easier to do when I have implemented conditional GCode. But I think it's possible now using firmware 2.03beta. You would need to set up your default configuration in config.g, then at the end of config.g set up M281 triggers for endstop inputs that define the machine configuration. Then M282 commands to poll them, because there won't be any edges. Then in your trigger files, use M505 to set the folder, followed by M98 P"config.g".

  • @dc42 That sounds like it will do exactly what I want, thanks!

    (Assuming you meant M581 and M582? Those are listed in the current docs; is 2.03beta required, or will they work in the current release build?)

Log in to reply