External trigger doesn't call trigger#.g after software reset



  • Hi,

    I configured an external trigger calling the macro trigger2.g when the Z-endstop is hit (M581 PZ S1 T2 R0).
    When I turn on the machine, the external trigger works properly and call trigger2.g. But as soon as I do a software reset (M112), the external trigger doesn't call trigger2.g anymore. However, the status of the machine switch from "Idle" to "Busy".
    If I reload the config.g with a M502, then the external trigger works again properly.
    If the external trigger is configured to provide an emergency stop (T0) or a pause (T1), everything works as expected.
    I don't understant this behaviour. Is it unexpected or do I miss something?

    Thank you.


  • administrators

    Which Duet and firmware version?

    Please post your config.g file.

    Are you doing the software reset when the external trigger is already triggered, or when it is not triggered?



  • The board is a Duet 3 MB6HC and the firmware version is 3.1.1 (2020-05-19b2).
    I am doing the software reset before the external trigger is triggered.
    Please find below my config.g file:
    ; Configuration file for Duet 3 (firmware version 3)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.4 on Wed Sep 16 2020 17:20:35 GMT+0200 (heure d’été d’Europe centrale)

    ; General preferences
    G90 ; send absolute coordinates...
    M83 ; ...but relative extruder moves
    M550 P"Duet 3" ; set printer name

    ; Drives
    M569 P0.0 S1 ; physical drive 0.0 goes forwards
    M569 P0.1 S0 ; physical drive 0.1 goes backwards
    M569 P0.2 S0 ; physical drive 0.2 goes backwards
    M569 P0.3 S1 ; physical drive 0.3 goes forwards
    M569 P0.4 S0 ; physical drive 0.4 goes backwards
    M584 X0.0 Y0.1 Z0.2 E0.3:0.4 ; set drive mapping
    M350 X16 Y16 Z16 E16:16 I1 ; configure microstepping with interpolation
    M92 X53.33 Y53.33 Z1280.00 E420.00:420.00 ; set steps per mm
    M566 X900.00 Y900.00 Z12.00 E120.00:120.00 ; set maximum instantaneous speed changes (mm/min)
    M203 X6000.00 Y6000.00 Z1200.00 E1200.00:1200.00 ; set maximum speeds (mm/min)
    M201 X500.00 Y500.00 Z20.00 E250.00:250.00 ; set accelerations (mm/s^2)
    M906 X800 Y800 Z800 E800:800 I30 ; set motor currents (mA) and motor idle factor in per cent
    M84 S30 ; Set idle timeout

    ; Motor stall detection
    ;M915 X Y S0 F0 R3 ; stall detection on X and Y axis, threshold at 5 and pause, rehome, resume if triggered

    ; Axis Limits
    M208 X0 Y0 Z0 S1 ; set axis minima
    M208 X650 Y420 Z500 S0 ; set axis maxima

    ; Endstops
    M574 X1 S1 P"!^io0.in" ; configure active-high endstop for low end on X via pin !io0.in
    M574 Y2 S1 P"!^io1.in" ; configure active-high endstop for high end on Y via pin !io1.in
    M574 Z2 S1 P"!^io2.in" ; configure active-high endstop for high end on Z via pin !io2.in

    ; Z-Probe
    M558 P5 C"!^io7.in" H10 F120 T6000 ; set Z probe type to switch and the dive height + speeds
    G31 P500 X-25.5 Y0 Z9.5 ; set Z probe trigger value, offset and trigger height
    M556 S250 X0 Y0 Z0 ; set orthogonal axis compensation parameters
    M557 X0:650 Y0:420 S100 ; define mesh grid

    ; Heaters
    M308 S0 P"temp1" Y"thermistor" T100000 B4138 ; configure sensor 0 as thermistor on pin temp1
    M950 H0 C"out1" T0 ; create bed heater output on out1 and map it to sensor 0
    M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit
    M140 H0 ; map heated bed to heater 0
    M143 H0 S250 ; set temperature limit for heater 0 to 120C
    M308 S1 P"temp2" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin temp2
    M950 H1 C"out2" T1 ; create chamber heater output on out2 and map it to sensor 1
    M307 H1 B0 S1.00 ; disable bang-bang mode for the chamber heater and set PWM limit
    M141 H1 ; map chamber to heater 1
    M143 H1 S250
    M308 S2 P"temp0" Y"thermistor" T100000 B4138 ; configure sensor 2 as thermistor on pin temp0
    M950 H2 C"out3" T2 ; create nozzle heater output on out0 and map it to sensor 2
    M307 H2 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit

    ; Fans
    M950 F0 C"out7" Q500 ; create fan 0 on pin out7 and set its frequency
    M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off
    M950 F1 C"out8" Q500 ; create fan 1 on pin out8 and set its frequency
    M106 P1 S0 H-1 ; set fan 1 value. Thermostatic control is turned off
    M950 F2 C"out9" Q500 ; create fan 2 on pin out9 and set its frequency
    M106 P2 S1 H-1 ; set fan 2 value. Thermostatic control is turned off

    ; Other temperatures
    M308 S3 P"temp3" Y"thermistor" T100000 B4138 ; configure sensor 3 as thermistor on pin temp3 for structure temperature
    ;M308 S2 P"temp0" Y"thermistor" T100000 B4138 ; configure sensor 2 as thermistor on pin temp0 for drawer temperature

    ; Filament run-out
    M591 D0 P2 C"^io3.in" S1 ; end of filament of the right spool
    M591 D1 P2 C"^io4.in" S1 ; end of filament of the left spool

    ; Doors opening
    M950 J3 C"!io5.in" ; map the open-door sensor to the input 3
    M950 J4 C"!io6.in" ; map the open-hood sensor to the input 4
    M581 P3:4 S0 T2 R0 ; call trigger2.g when a falling edge is detected on input 3 and/or 4

    ; Out of boundaries Z axis
    M581 PZ S1 T3 R0 ; call trigger3.g when a rising edge is detected on Z-endstop

    ; Tools
    M563 P0 S"Outil Droit" D0 H2
    G10 P0 X0 Y0 Z0
    G10 P0 R0 S0

    ; Custom settings are not defined

    ; Miscellaneous
    M911 S20 R22 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss


  • Moderator

    @MathV said in External trigger doesn't call trigger#.g after software reset:

    M581 PZ S1 T3 R0 ; call trigger3.g when a rising edge is detected on Z-endstop

    The P value needs to be a pin defined by a M950 J value as you've done for the other two triggers.

    If you send M98 P"config.g" what errors do you get?


  • administrators

    @MathV said in External trigger doesn't call trigger#.g after software reset:

    M581 PZ S1 T3 R0 ; call trigger3.g when a rising edge is detected on Z-endstop

    That will be parsed as:

    M581 P0 Z S1 T3 R0

    Change it to:

    M581 Z S1 T3 R0



  • @Phaedrux said in External trigger doesn't call trigger#.g after software reset:

    If you send M98 P"config.g" what errors do you get?

    No errors after M98 P"config.g".

    @dc42 said in External trigger doesn't call trigger#.g after software reset:

    Change it to:

    M581 Z S1 T3 R0

    I observe the same behaviour as with "M581 PZ S1 T3 R0"
    By the way, the same behaviour is observed with both triggers T2 and T3:

    • before any software reset --> triggers T2 and T3 can be activated as much as wanted.
    • after a software reset --> triggering T2 or T3 switch the board status from idle to busy but doesn't execute any macro (trigger2.g or trigger3.g).

  • administrators

    If the status is changing to busy, it sounds to me that it has started executing the trigger macro file. What commands do you have in that file?



  • @dc42 I have:

    • trigger2.g: "M119" (for the proof of concept)
    • trigger3.g: "M112"

  • administrators

    Are you running the Duet 3 in standalone mode, or with an attached single board computer?



  • @dc42 The duet is attached to an SBC (Pi 3B) with a ribbon.



  • Further information:

    • M98 P"trigger3.g" works
    • even when the status is "busy", M98 P"trigger3.g" works

Log in to reply