Welcome! Log In Create A New Profile

Advanced

Programmatically stop print

Posted by warpster 
Programmatically stop print
November 07, 2022 03:54PM
This is an unusual use of Marlin, I am using it to control a filament re-winder so I am only using the X and E axis. The only job that will ever get sent to it consists of a repeating pattern of
"G1 X56 E280 G1 X1 E280 G1 X56 E280 G1 X1 E280 G1 X56 E280 G1 X1 E280 G1 X56 E280 G1 X1 E280 G1 X56 E280 G1 X1 E280 etc" the only thing that changes is the X position and the length of filament to extrude (wind).
This just moves the X axis from position 1 to 56 and back while extruding (winding the spool.) to control how orderly the filament winds onto the spool. The E length controls how many revolutions of the spool wind.The Y-Min endstop is used as a filament out sensor and I am monitoring it's state during the MarlinCore.cpp loop and when it triggers I need to stop all movement, cancel the job whatever it takes to stop the winding.

During testing I had decreased the length of the string I sent , the G1 X1 E280 etc from above, so I didn't need to wait for a long print job during testing. Well when that command string was only 5 or so loops my cancel routine worked fine but then I noticed after I changed the command string back to the long version when I try to stop it, it will stop and then a short bit later (seconds) it will start back up.

I am using a MarlinCore.cpp function quickstop_stepper to stop it and like I said if the original print command was only 10-15 GCODES long it worked but now it stops and then seconds later restarts. Could anyone clue me in on a routine I can call to end the print job without it restarting on me? Remember this is a down and dirty implementation and this machine will do nothing but wind filament, it will never "print" anything so it doesn't have to follow all the rules.....whatever those are? Sorry but I am new to Marlin code and not that great with C++ so I need help from someone more knowledgeable than me.

Worst case I can call the MarlinCore.cpp function, minkill(), but that will restart Marlin and I'd like to avoid that if possible. I was thinking maybe the Watchdog was starting it back up but I disabled that in configuration_adv but that did not change it so not sure what is starting it back up. Thanks in advance.

I have no debugging/tracing tools so my investigating is limited to serial coms to send info on what is going on, I'm getting so close I would like to tie this last thing up.
Sorry, only registered users may post in this forum.

Click here to login