Cancel movement with trigger
-
@phaedrux so basically I call M669 S10 or so in config.g and it will split the move command into segments that each take 0.1s to print? The documentation on it is a little short
Sounds like an idea. I‘ll probably try on Monday. -
@benecito what if you configure alsa a max travel mobe for that axis like M208 S0 A100.
Not sure what your axis declaration is but would try this -
@philipp-r If i extrude the A.axis position does not change. So this does not work I‘m afraid.
-
@benecito can you post your config.g file?
-
@philipp-r I don’t know if I’ll manage over the weekend, but I will on Monday or so.
-
I shortened it a little to make things easier, but the relevant parts should be there.
; General preferences M111 S0 ; Debug off G90 ; send absolute coordinates... M82 ; ...and absolute extruder moves G21 ; Work in millimetres ; Display preferences ; Drives M569 P0 S0 ; physical drive 0 (Z) goes backwards M569 P1 S0 ; physical drive 1 (X) goes forwards M569 P2 S1 ; physical drive 2 (Y) goes backwards M569 P3 S0 ; physical drive 3 (Extruder) goes backwards M584 Z0 X1 Y2 A3 E3 ; set drive mapping ;M350 A16 E16 I0 ; configure microstepping without interpolation M350 X16 Y16 Z16 A16 E16 I1 ; configure microstepping with interpolation M92 X76.19 Y76.19 Z1066.66 A4031.496 E4031.496 ; set steps per mm M566 X900.00 Y900.00 Z120.00 A120.00 E120.00 ; set maximum instantaneous speed changes (mm/min) M203 X12000.00 Y12000.00 Z300.00 A180.00 E180.00 ; set maximum speeds (mm/min) M201 X800.00 Y800.00 Z200.00 A50.00 E50.00 ; set accelerations (mm/s^2) M906 X800 Y800 Z700 A1400 E1400 I50 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 A-0.1 S1 ; set axis minima M208 X340 Y232 Z165 A40 S0 ; set axis maxima ;;; Endstops M574 X2 S1 P"io6.in" ; set active high endstops M574 Y2 S1 P"io5.in" ; set active high endstops M574 A1 S1 P"!^io0.in" ; set active high endstops M574 Z1 S1 P"!^io4.in" ; set active high endstops ;;; Z-Probe M558 K0 P1 C"io3.in" H2 F180 T6000 ; set Z probe type to IR Probe and the dive height + speeds invert signal G31 K0 P500 X0 Y27.5 Z2 ; set Z probe trigger value, offset and trigger height M557 X15:240 Y15:195 S50 ; define mesh grid ;;; Tools M563 P0 S"Nozzle" D0 H1 F0 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active temperatures and standby temperatures to 0C M563 P1 S"Tube" D0 H2 F0 ; define tool 1 G10 P1 X0 Y0 Z0 ; set tool 1 axis offsets G10 P1 R0 S0 ; set initial tool 1 active temperatures and standby temperatures to 0C ;;; External triggers M950 J1 C"^!io1.in" M581 T3 P1 S1 R0 ;configure external Trigger (Extruder lower endstop) M584 P3 ; hide extruder axis
-
@benecito you have defined M208 A40 S0... so the axis should stop after 40mm extruding right?
Did you tested it with a dry run? -
@benecito in your M584 comment you have defined Driver3 to control your A and E axis, looks also kind of wierd to me, but i'm no sure about that.
Would also be interested to have an insight to your Gcode, do you have a A instead of an E Value for the extruding part?
Like: G1 X12 Y32 A24 -
@philipp-r
No it does not stop after 40mm as I am using regular G-Code (and doing that for a reason) wit Exxx movements.
Thats why I was looking for a solution to map E movements to an axis or treat E as an axis. -
@phaedrux said in Cancel movement with trigger:
Perhaps if you use the segmentation options in M669 to break up the longer moves into a series of smaller moves the trigger could be read sooner.
just tried it, and sadly it does not work.
-
@benecito one way to go is to set up a trigger#.g file and try to disable Motormovements/currents of the E-Motor in this file when hitting your physical switch. See: https://duet3d.dozuki.com/Wiki/Gcode#Section_M18_Disable_all_stepper_motors
Also there are alot of possibilities with object model
-
@philipp-r I have this set up, but the trigger only gets executed after the last move is finished. This is a problem if this move for example is a longer manual move which goes beyond the endstop.
-
@benecito I had the same problem for a syringe extruder. After having followed the recommendations of the forum, I changed the trigger M581 for the filament sensor M591, in addition to increasing the segmentation of the print buffer.
M669 K0 S100 ;increase fragmentation to 100 segments for second. M591 D1 P1 C"21.io0.in" S1 ;Trigger pause when "filament" is empty.
With this setting I have been able to make printing pause when the syringe runs out. In a file "filament-error.g" that is executed upon reaching pause, I execute the functions that I need at the time of trigger that endstop.