M581 External trigger doesn't execute immediately
-
Hello, I have a question about M581 external triggers. In the documentation it says that the firmware will not wait for queued moves to be completed before executing the macro.
In my config.g, I have the following external triggers defined :
M581 T2 U S1
M581 T3 V S1
M582 T2
M582 T3Below is the macro trigger2.g
M25
G91
G1 E90 F1500Below is the macro trigger3.g
M25
G91
G1 E-90 F1500If I send a G1 E200 F1500 and press the trigger while the extruder is running the command (manually triggering the V axis endstop), the extruder doesn't immediately do the trigger3 which should reverse the extruder (E-90 move). The trigger is executed after the G1 E200 F1500 move is completed.
I tried replacing the M581 definition for T0 (emergency stop) and it acts immediately.
See below my complete config.g file (firmware 3.4b7)
; Configuration file for Duet 3 (firmware version 3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.2.3 on Fri Jun 25 2021 11:47:43 GMT-0400 (heure d’été de l’Est) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"MEAM-HP V01" ; set printer name M665 R119.3 L195 B55 H362.5 ; Set delta radius, diagonal rod length, printable radius and homed height ***Bras ball and socket*** ;M665 R119.25 L215.87 B50 H328 ; Set delta radius, diagonal rod length, printable radius and homed height ***Bras double magnétique, tooling ball*** ;M665 R109.57 L215 B50 H305 ; Set delta radius, diagonal rod length, printable radius and homed height ***Bras Igus, effector v4*** ;M665 R132.07 L215.87 B50 H312 ; Set delta radius, diagonal rod length, printable radius and homed height ***Bras double magnétique*** ;M665 R129.65 L215 B50 H319 ; Set delta radius, diagonal rod length, printable radius and homed height ***Bras Igus, effector v5*** ;M665 R120.45 L190 B50 H323 ; Set delta radius, diagonal rod length, printable radius and homed height ***Bras rotule rouge*** M666 X0 Y0 Z0 ; put your endstop adjustments here, or let auto calibration find them ; Network M540 PBE:EF:DE:AD:FE:ED ; set custom MAC address M552 P192.168.11.17 S1 ; enable network and set IP address M553 P255.255.255.0 ; set netmask M554 P192.168.1.14 ; set gateway M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M584 X0 Y1 Z2 E3:4 M584 U3 M584 V3 M569 P0.0 S1 ; physical drive 0.0 goes forwards M569 P0.1 S1 ; physical drive 0.1 goes forwards M569 P0.2 S1 ; physical drive 0.2 goes forwards M569 P121.0 S1 R0 T2.7:2.7:2.7:2.7 ; change enable polarity, active = disable driv M569 P0.3 S1 ; physical drive 0.3 goes forwards M584 X0.0 Y0.1 Z0.2 E121.0:0.3 ; set drive mapping M584 U121.0 ; for piston extruder limit switch M584 V121.0 ; for piston extruder limit switch ;M584 P4 ;show 4 axis M584 P3 ;show 3 axis M350 E1 I0 ; configure microstepping without interpolation M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X200 Y200 Z200 U3192 V3192 E3192:60.00 ; set steps per mm M566 X1200.00 Y1200.00 Z1200.00 U100 V100 E100.00:1200.00 ; set maximum instantaneous speed changes (mm/min) M203 X18000.00 Y18000.00 Z18000.00 U6000 V6000 E6000.00:20000.00 ; set maximum speeds (mm/min) M201 X2000.00 Y2000.00 Z2000.00 U200 V200 E200.00:1000.00 ; set accelerations (mm/s^2) M906 X2000 Y2000 Z2000 U800 V800 E800:1680 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 Z-0.1 S1 ; set minimum Z M208 U7475 ; Endstops M574 X2 S1 P"^io1.in" ; configure active-high endstop for high end on X via pin ^io1.in M574 Y2 S1 P"^io2.in" ; configure active-high endstop for high end on Y via pin ^io2.in M574 Z2 S1 P"^io0.in" ; configure active-high endstop for high end on Z via pin ^io0.in M574 U1 S1 P"^io4.in" ; configure active-high endstop for high end on Z via pin ^io0.in M574 V2 S1 P"^io3.in" ; configure active-high endstop for high end on Z via pin ^io0.in ; Z-Probe M558 P0 H10 F120 T2400 ; disable Z probe but set dive height, probe speed and travel speed M557 R50 S20 ; define mesh grid ; Heaters M308 S0 P"temp1" Y"thermistor" T109900 B4217 H0.0 ; Plateau chauffant___configure sensor 0 as thermistor via CS pin temp1 M950 H0 C"out1" T0 ; create chamber heater output on out1 and map it to sensor 0 M307 H0 B0 R0.598 C398.3 D0.66 S1.00 V23.4 ; enable bang-bang mode for the chamber heater and set PWM limit M141 H0 ; map chamber to heater 0 M143 H0 S100 ; set temperature limit for heater 0 to 100C M308 S1 P"spi.cs0" Y"thermocouple-max31856" ; configure sensor 1 as thermocouple via CS pin spi.cs0 M950 H1 C"out2" T1 ; create nozzle heater output on out2 and map it to sensor 1 M307 H1 B0 R0.466 C354.7 D23.13 S1.00 V23.4 ; disable bang-bang mode for heater and set PWM limit M143 H1 S100 ; set temperature limit for heater 1 to 100C M308 S2 P"spi.cs1" Y"thermocouple-max31856" ; configure sensor 2 as thermocouple via CS pin spi.cs1 M950 H2 C"out3" T2 ; create nozzle heater output on out3 and map it to sensor 2 M307 H2 B0 R2.044 C129.7 D5.81 S1.00 V23.4 ; disable bang-bang mode for heater and set PWM limit M143 H2 S100 ; set temperature limit for heater 2 to 100C M308 S3 P"temp0" Y"thermistor" T109900 B3800 H0.0 ; Extrudeur___configure sensor 3 as thermistor on pin temp0 M950 H3 C"out0" T3 ; create bed heater output on out0 and map it to sensor 3 M307 H3 B0 R1.359 C207.4 D4.75 S1.00 ; enable PID mode for the bed heater and set PWM limit M140 H3 ; map heated bed to heater 3 M143 H3 S100 ; set temperature limit for heater 3 to 100C M308 S4 P"spi.cs2" Y"thermocouple-max31856" ; configure sensor 2 as thermocouple via CS pin spi.cs1 M950 H4 C"out0" T4 ; create nozzle heater output on out2 and map it to sensor 1 ; Fans M950 F0 C"out4" Q500 ; create fan 0 on pin out4 and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off ; Tools M563 P0 S"Piston" D0 H1:2 F0 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C M563 P1 S"Melangeur" D1 H1:2 ; define tool 1 G10 P1 X0 Y0 Z0 ; set tool 1 axis offsets G10 P1 R0 S0 ; set initial tool 1 active and standby temperatures to 0C ; Custom settings are not defined M581 T2 U S1 M581 T3 V S1 M582 T2 M582 T3 ;M581 T0 U S1 ;M581 T0 V S1 ;M582 T0 ;M582 T0 ; Miscellaneous T0 ; select first tool
-
@omiclette Most probably it's the M25 which according to the docs, does this quote ....
"
M25 attempts to execute as quickly as possible and follows the following logic:When RRF receives M25 it will look for a move in the current queue after which it can stop without violating the configured jerk limits.
If it finds one it stops after that move without decelerating (because the jerk limits allow that)
If it can't find one it will plan and execute a deceleration. in this case the pause will occur 1 move+2 seconds after M25 is sent.That means the longest it will take to pause is 1 move+2 seconds. In most situations pause occurs much quicker than that.
" ... end of quote.The way I read that is that it will pause after the current move. What happens if you comment out the M25?
-
@deckingman I have just removed the M25 and it still waits for the G1 E200 F1500 to finish before executing the trigger G1 E-90 F1500.
-
@omiclette said in M581 External trigger doesn't execute immediately:
@deckingman I have just removed the M25 and it still waits for the G1 E200 F1500 to finish before executing the trigger G1 E-90 F1500.
It's because it's a long move. You could try segmentation but I'm not sure whether it's applied to extruder moves too.
E.g.M669 S1 T1
-
@jay_s_uk I've just tried putting M669 S1 T1 in my config.g file and the trigger was still not executed until the G1 E200 F1500 was finished. Segmentation doesn't seem to apply to the extruder command.
Still, in the documentation it says that the firmware doesn't wait for queued moves to be completed before executing the macro so I don't understand why it waits...
-
@omiclette because it's not in the queue. It's being executed
-
@jay_s_uk Ahhhh that's true. So if I understand, the feature that allow pausing immediately still doesn't exist (this 2020 thread seems to mention that it was on the wish list : https://forum.duet3d.com/topic/18289/emergency-stop-without-m112/5)
-
@omiclette yep, must still be ok the list. Maybe @Phaedrux can comment whether it is
-
Still on the list.