Question: Endstop for Extruder (E1) to pause print



  • Hello,

    I am building a clay printer and everything is working fine so far (with your help).

    Now I would like the printer to pause a print when the printer is running out of clay using an mechanical endstop.

    The endstop is connected and is working, the wiring is fine.

    When I start the extruder (E1) and trigger the endstop, it won't stop. I have used different configurations, but I am clearly missing something.

    Any idea what could be going on?

    ; General preferences
    G90                                                                 ; send absolute coordinates...
    M83                                                                 ; ...but relative extruder moves
    M550 P"Clayster"                                                    ; set printer name
    M302 P1																; enable cold extrusion for clay printing
    
    ; Network
    M552 S1                                                             ; enable network
    M586 P0 S1                                                          ; enable HTTP
    M586 P1 S0                                                          ; disable FTP
    M586 P2 S0                                                          ; disable Telnet
    
    ; Drives 
    M569 P0 S1                                                          ; X1
    M569 P1 S0                                                          ; Y
    M569 P2 S0                                                          ; Z1
    M569 P3 S0                                                          ; E0 (Extruder)
    M569 P4 S1                                                          ; E1 (Ram, reversed)
    M569 P5 S0                                                          ; Z2
    M569 P6 S0                                                          ; Z3
    M569 P7 S0                                                          ; X2
    M569 P8 S0                                                          ; Z4
    
    M584 X0:7 Y1 Z2:5:6:8 E3:4                                          ; remap motors 
    
    M350 X16 Y16 Z16 E16:16 I1			                       			; configure microstepping with interpolation
    
    M92 X100.00 Y100.00 Z1600.00 E100.00:2000.00						; set steps per mm
    M566 X500.00 Y500.00 Z20.00 E500.00:500.00					   		; set maximum instantaneous speed changes (mm/min)
    M203 X6000.00 Y6000.00 Z750.00 E5000.00:250.00					 	; set maximum speeds (mm/min)
    M201 X500.00 Y500.00 Z500.00 E500.00:500.00				        	; set accelerations (mm/s^2)
    
    M906 X1200 Y1200 Z1200 E1000:1400 I30  			          			; set motor currents (mA) and motor idle factor in per cent
    M84 S30                                                				; set idle timeout
    
    ; Axis Limits
    M208 X0:390 Y0:365 Z0:350 S1                                        ; 390mm x 365mm x 350mm
    
    ; Bed leveling geometry & leveling
    M671 X470:470:-70:-70 Y400:-40:400:-40 S5						    ; position leadscrews 
    
    ; Endstops
    M574 X1 S1 P"!xstop+!duex.e4stop"                                   ; configure active-low endstop for 2 X-motors
    M574 Y1 S1 P"ystop"                                                 ; configure active-low endstop for low end on Y via pin ystop
    
    ; Filament sensor for Ram
    M591 P1 C"e1stop" S0 D1												; extruder (Ram) endstop
    
    ; Z-Probe
    M558 P5 C"^!zprobe.in" I1
    G31 P1000 X0 Y0 Z0.25                                               ; Z = offset (greater value = closer to bed)
    
    ; Miscellaneous
    M575 P1 S1 B57600                                                   ; enable support for PanelDue
    
    ; Extruder I + II (parallel)
    M563 P0 D0:1 	 													; enable tool 0 and extruder E0 (D0) & E1 (D1)
    M567 P0 E1.00:0.00575 												; mixing ratio(!)
    G10 P0 S0 R0 X0 Y0 													; axis offsets for extruder
    G10 P0 R0 S0														; set extruders active and standby temperature to 0 Celsius
    


  • Your S value is wrong in the M591.
    From the wiki

    Sn 0 = disable filament monitoring (default), 1 = enable filament monitoring when printing from SD card. Supported for all filament sensor types in firmwares 1.21.1 and in 2.0 and later. In firmware 1.21 this parameter is not supported for sensor types 1 and 2. Filament monitors accumulate calibration data (where applicable) even when filament monitoring is disabled.
    

    It also is only active when printing.
    Triggering at any other time won't do anything



  • @wieman01

    I did the same thing , e0 as a filament run sensor and e1 a pause print and resume print.
    But one thing I forgot about is the pause print adds a 10mm retraction , so you change the filament and push until to get filament out of the nozzle , clean than off and start the print you will get a 10mm blob on your print.
    So retract 10mm before starting your print .

    ; External Triggers
    M950 J0 C"!^e0stop"
    M950 J1 C"!^e1stop"
    M581 P0 T1 S1 R1 ;
    M581 P1 T3 S1 R0 ;
    

    trigger3.g

    M300 S300 P1000
    echo "state.status" , state.status
    
    if state.status = "paused"
    	M24
    elif state.status = "processing"
    	M25
    


  • Thank you, @jay_s_uk and @peter247!

    I had S0 set because I was probably confused by the comment concerning S1 which only works when printing from SD. Is that so? I only use the web interface.

    I will take a closer look at your script, @peter247. I am not 100% certain what it does exactly, but I'll a bit of reading on it.



  • @wieman01 printing from the SD means loading gcode via the web interface and printing from there. i.e. loading the file on to the duet itself

    Not printing via the SD card would involve streaming the gcode via the USB port using programs such as pronterface or octoprint.



  • @wieman01

    M300 S300 P1000
    echo "state.status" , state.status
     
    if state.status = "paused"
    	M24
    elif state.status = "processing"
    	M25
    

    (1) beep 1 second 300hz
    (2) show me state.state , just used for testing
    (3) if state.status varable says "pause" resume printing
    (4) resume printing from paused
    (6) if state.status varable says "processing" you must be printing , so pause print
    (7) pause print



  • Thank you, both. Now I got it.

    I just tested this during a live print and it worked perfectly thanks to you. The print stopped when I triggered the endstop and paused until I hit "resume".

    M591 P1 C"e1stop" S0 D1	
    

Log in to reply