toolboard buttons -> trigger



  • I have a coreXY printer controlled by a Duet3, pi3 and a single toolboard. I am trying to configure the toolboard buttons to trigger filament load and unload macros (or trigger(n).g). I also have a button and switch wired to io2.in and io3.in which I would like to activate other trigger files. I have trigger(n).g files in the same folder as config.g containing M117 messages. Nothing happens when I activate any of the buttons or the switch.

    RepRapFirmware for Duet 3 MB6HC version 3.01-RC9 running on Duet 3 MB6HC v1.01 or later

    Here is the configuration in my config.g file:
    ; Toolboard Buttons
    M950 J0 C"^!121.button0"
    M950 J1 C"^!121.button1"
    M581 P0 S0 T2 R0
    M581 P1 S0 T3 R0

    ; Front panel button & switch
    M950 J2 C"!^io2.in" ; Input 2 uses ?, inverted, pullup enabled - red button
    M950 J3 C"^io3.in" ; Input 3 uses ?, pullup enabled - front panel switch
    M581 P2 S0 T4 R0
    M581 P2 S0 T5 R0


  • Moderator

    @wifibeagle said in toolboard buttons -> trigger:

    RepRapFirmware for Duet 3 MB6HC version 3.01-RC9 running on Duet 3 MB6HC v1.01 or later

    First, please update your mainboard and tool board firmwares.

    https://github.com/Duet3D/RepRapFirmware/releases/tag/3.1.1



  • I have run apt update/upgrade but it does not update the Duet files. I am using a copy of the SD card that came with the Duet3 so I still have the untouched original Duetpi card.

    my /etc/apt/sources.list.d/duet3d.list file contains
    deb https://pkg.duet3d.com/ stable armv7

    When I run sudo apt update it shows

    Hit:3 https://pkg.duet3d.com stable InRelease

    so it is looking for Duet updates but none are found when I run apt update. I realize there are other update methods but I really want this method to work going forward.

    A potentially related question: Where are the sys and macro folders that I see in DWC physically located?


  • Moderator

    In that case I suggest you create a new Pi SD card with a fresh image.

    Download your prefered version (headless or desktop) from here: https://duet3d.dozuki.com/Wiki/Getting_Started_With_Duet_3#Section_DuetPi

    Once it's up and running again, do a sudo apt update etc again.

    If the Duet is still not updating the firmware I suggest you follow these steps which should get you back in sync:

    https://duet3d.dozuki.com/Wiki/Getting_Started_With_Duet_3#Section_Updating_Duet_3_from_RRF3_0_Beta_12_to_3_0_Final_via_DWC

    With those two steps done, you should be on 3.1.1 which may resolve your issue. If not, we can pick up from there.

    Also check the toolboard firmware version with M122 B1

    If it's not updated to 3.1 after the first two steps, send M997 B1 to update it.


  • Moderator

    @wifibeagle said in toolboard buttons -> trigger:

    Where are the sys and macro folders that I see in DWC physically located?

    https://duet3d.dozuki.com/Wiki/Getting_Started_With_Duet_3#Section_Virtual_SD_card

    The first SD card (0:/) is emulated by DCS and its default directory is /opt/dsf/sd. It may changed by editing the BaseDirectory value in /etc/dsf/config.json.



  • Progress! Thanks for the help. I was able to create a new SD card and update to the latest stable release.

    RepRapFirmware for Duet 3 MB6HC version 3.1.1 running on Duet 3 MB6HC v1.01 or later (SBC mode)

    If the status is idle all of the button and switch triggers work as expected. Each causes a momentary idle to busy status transition when activated. However, if the status is busy none of the triggers work. After my config.g file executes the status is (sometimes?) busy and the triggers don't work. M502 resets the status to idle and the triggers then work as expected. One of my goals with these triggers is to have a button that stops all XYZ movement during a print without resetting the machine. It appears the triggers will not work for that purpose. Is this the expected behavior or do I have something configured incorrectly?

    M98 P"config.g" does not return any errors.

    I have attached my config file for reference.

    ; Configuration file for Duet 3 (firmware version 3)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.4 on Thu Sep 03 2020 12:19:13 GMT-0400 (Eastern Daylight Time)

    ; General preferences
    G90 ; send absolute coordinates...
    M83 ; ...but relative extruder moves
    M550 P"duet3" ; set printer name
    M667 S1 ; select CoreXY mode
    M669 K1 ; switch to CoreXY mode
    M80 ; enable the powersupply before relay time expires

    ; Network
    M552 P0.0.0.0 S1 ; enable network and acquire dynamic address via DHCP
    M586 P0 S1 ; enable HTTP
    M586 P1 S0 ; disable FTP
    M586 P2 S1 ; enable Telnet

    ; Drives
    M584 X0.1 Y0.0 Z0.4:0.3:0.2 E121.0 ; set drive mapping
    M569 P0.0 S1 ; left XY drive 0.0 goes forwards
    M569 P0.1 S1 ; right XY drive 0.1 goes forwards
    M569 P0.2 S0 ; Z1 drive 0.2 goes backwards
    M569 P0.3 S0 ; Z2 drive 0.2 goes backwards
    M569 P0.4 S0 ; Z3 drive 0.2 goes backwards
    M569 P121.0 S1 ; extruder drive 1.0 goes forwards
    ;M584 X0.0 Y0.1 Z0.2 E1.0 ; set drive mapping
    ;M584 X0.0 Y0.1 Z0.2:0.3:0.4 E1.0 ; set drive mapping
    ;M584 X0.1 Y0.0 Z0.2:0.3:0.4 E121.0 ; set drive mapping
    M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
    M92 X100.00 Y100.00 Z800.00 E420.00 ; set steps per mm Z*1.22
    M203 X18000.00 Y18000.00 Z1500.00 E1200.00 ; set maximum speeds (mm/min)
    M201 X1000.00 Y1000.00 Z20.00 E250.00 ; set accelerations (mm/s^2)
    M566 X900.00 Y900.00 Z120.00 E80.00 ; set maximum instantaneous speed changes (jerk) (mm/min)
    M906 X1000 Y1000 Z800 E600 I30 ; set motor currents (mA) and motor idle factor in per cent
    M84 S30 ; Set idle timeout

    ; Axis Limits
    M208 X-22 Y-10 Z-0.2 S1 ; set axis minima
    M208 X326 Y317 Z300 S0 ; set axis maxima
    M671 X-64:373:373 Y155:6:308 S3.0 ; leadscrews at left middle, right front and right rear

    ; Endstops
    M574 Y1 S1 P"!io0.in" ; configure active-low endstop for low end on Y via pin io0.in
    M574 Z1 S1 P"!io1.in" ; configure active-low endstop for low end on Z via pin io1.in
    M574 X1 S1 P"!121.io2.in" ; configure active-low endstop for low end on X via toolboard pin io2.in

    ; Z-Probe
    M558 P8 C"^!121.io0.in" H5 F100 T6000 ; set Z probe type to switch and the dive height + speeds
    G31 X0 Y0 Z0 ; set Z probe trigger value, offset and trigger height
    M557 X10:300 Y10:300 S58 ; define mesh grid

    ; Heaters
    ;Heater 0 model: gain 157.2, time constant 209.1, dead time 1.7, max PWM 1.00, calibration voltage 23.9, mode PID
    M308 S0 P"temp0" Y"thermistor" T100000 B3950 ; configure sensor 0 as thermistor on pin temp0
    M950 H0 C"out0" T0 Q1 ; create bed heater output on out0 and map it to sensor 0
    M307 H0 B0 A157.2 C400 D4 S1.0 ; disable bang-bang mode for the bed heater and set PWM limit
    M140 H0 ; map heated bed to heater 0
    M143 H0 S120 ; set temperature limit for heater 0 to 120C
    M308 S1 P"121.temp0" Y"thermistor" T100000 B3950 ; configure sensor 1 as thermistor on toolboard temp0
    M950 H1 C"121.out0" T1 ; nozzle heater output on toolboard out0 and map it to sensor 1
    M307 H1 A796 C220 D5 V23.9 B0 S0.50 ; disable bang-bang mode for heater and set PWM limit

    ; Fans
    M950 F0 C"!121.out1" Q25000 ; create fan 0 (hot end) on toolboard out1 and set its frequency0
    M106 P0 S0 H1 L0.5 T45:120 C"HotEnd" ; set fan 0 value. Thermostatic control is turned on
    M950 F1 C"121.out2" Q100 ; create fan 1 (part cooling) on toolboard out2 and set its frequency
    M106 P1 S0 H-1 C"PartFan" B0.5 L0.4 ; set fan 1 value. Thermostatic control is turned off
    M950 F3 C"!out4" Q25000 ; Power supply Aux Fan
    M106 P3 S0.55 H-1 C"PSfan" L0.2 ; set fan 3 value. Thermostatic control is turned off

    ; Tools
    M563 P0 D0 H1 F0 S"1LC" ; define tool 0
    ;M565 X0 Y0 Z0 ; define tool offset
    G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets
    G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C

    ; Lighting
    M950 F2 C"out1" Q500
    M106 P2 S0.2 C"LEDs"

    ; Toolboard Buttons
    M950 J0 C"^!121.button0"
    M950 J1 C"^!121.button1"
    M581 T2 P0 S0 R0
    M581 T3 P1 S0 R0

    ; Front panel button & switch
    M950 J2 C"^io2.in" ; Input 2 pullup enabled - front panel switch
    M950 J3 C"^!io3.in" ; Input 3 inverted, pullup enabled - red button
    M581 T4 P2 S0 R0
    M581 T5 P2 S1 R0
    M581 T6 P3 S0 R0

    ; Custom settings are not defined

    ; Miscellaneous
    M501 ; load saved parameters from non-volatile memory
    M911 S10 R11 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss

    T0


  • Moderator

    @wifibeagle said in toolboard buttons -> trigger:

    One of my goals with these triggers is to have a button that stops all XYZ movement during a print without resetting the machine.

    I think this has been requested and discussed before and is on the list. But I don't think it's currently available.

    https://forum.duet3d.com/topic/18289/emergency-stop-without-m112?_=1605130821735


  • administrators

    @wifibeagle said in toolboard buttons -> trigger:

    After my config.g file executes the status is (sometimes?) busy and the triggers don't work.

    The status should go to Idle when config.g has finished running. If this is a bug in DCS/RRF 3.1.1 then it's quite likely fixed in 3.2beta3.

    We plan to release and update to 3.2beta3 tomorrow.



  • Thanks for the link and the heads up on the new release.

    I have had a LinuxCNC router much longer than I've been 3D printing. I was surprised to learn Duet does not include the CNC limit switch philosophy. Not a real issue for a 3D printer but a major concern for the energy involved with a typical CNC machine.



  • @wifibeagle that can easily be incorporated though as endstops can be changed to triggers at the beginning of a job.
    Or you can permanently have them set up as triggers and change them to endstops at the start of the homing sequence and then put them back as triggers