-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing from SD can't be stopped by menu #4042
Comments
You will have to do more diagnostics to help us figure out what the problem is. |
I update mp4 you can watch it know what problem?! Thanks |
Are you printing from SD or from a host ? |
SD card!!! |
From the video, it appears that the buffer is somehow executing the last few moves, in an endless loop. |
This is the same behaviour I talked about when we were doing the keypad mashes thingy. |
@maukcc even with Scott's patch ? |
I am using RC6 now, and have not checked RCbugfix for a bit. I will test when I have the time. |
Ive run into the exact same issue.. shaking after a stop is issued. im using RCBugfix |
As such an active contributor you should definitely be using |
Ok, so it sounds like the buffer – either the SD buffer or the regular command queue, is going into a state out of sync with itself. I will look at the older "Stop SD Print" code and compare to the current code. My guess is that either the ring buffer is getting corrupted, or the SD buffer is being submitted continually. We did patch the Stop routine to try and purge commands left in the buffer. Probably the code to purge is errant. |
happen the same... |
I can confirm with latest RCBugfix I have the same loop behavior and have to power cycle. |
@jbrazio I've looked at the code and still have no clue as to what is looping. All I know is, before I attempted to clear the command buffer, the machine would execute any commands that were still left in the buffer, but only once. So far I can't see where the buffer-handling logic is screwy, but obviously something is amiss! Perhaps you can try putting some beeps and moves alternating in a GCode file, then SD print it, and use "Stop print" to see what happens. If it keeps beeping, then we know the command buffer is in an endless loop. If it keeps moving, but not beeping, then we know it's a planner or stepper buffer problem. G1 Z10 F8000
G1 X0 Y0
M300 S698 P300
G1 X90
M300 S523 P50
G1 X180
M300 S494 P50
G1 X90
M300 S523 P100
G1 Y90
M300 S554 P300
G1 Y180
M300 S523 P300
G1 Y90
M300 S523 P100
G1 X0 Y0 |
The beeper of my board is broken or happen something rare..., i can't test this. Checking the problem a lot times i see than always when i stop do a diagonal in X/Y, never the extruder move. Is like the buffer not is empty???¿? |
It has never worked, or only with the current code?
When you click "Stop print" the printer continues to move diagonally until you turn it off?
We have determined that much, now we're trying to figure out what the cause is. So far no one has added logging code to the command loop to see what's going on. But perhaps one of us will try that soon. |
1º #4127 |
I can also confirm that the issue exists on the current RC Bugfix build as of 7/1/16. Stopping a print from SD results in a "Loop" of a short segment of gcode. My beeper works. ( I like the added beep features ) I'll test the code when my current print finishes. |
I'll be looking at this issue in the next day or so, as soon as I can get over to the workshop to mess with my printer. I'm sure it will turn out to be something very simple and foolish. |
Here's something that I believe will fix the issue in the meantime, while we try to figure out the mistake in static void lcd_sdcard_stop() {
card.stopSDPrint();
- clear_command_queue();
+ // clear_command_queue();
stepper.quick_stop();
print_job_timer.stop();
thermalManager.autotempShutdown();
cancel_heatup = true;
lcd_setstatus(MSG_PRINT_ABORTED, true);
#if DISABLED(DELTA) && DISABLED(SCARA)
set_current_position_from_planner();
#endif // !DELTA && !SCARA
} |
What I also found in the M190 S60 ;set bed temp and wait
M109 T0 S195 ;set nozzle 1 temp and wait
M117 Cleaning .....
G1 X1 F12000 ;go to wipe point
G92 E0 ;set E
G1 Z1.5 F1200 So if I initiate a stop after the M190, it will do the stop sequence and cut of current M190 (bed heating), and then after the stop sequence, it will do the M109, the M117 and the G1 X1 F12000 (3 commands). And then it is properly stopped. |
Please try: static char* current_command, *current_command_args;
- static int cmd_queue_index_r = 0;
- static int cmd_queue_index_w = 0;
- static int commands_in_queue = 0;
+ static volatile int cmd_queue_index_r = 0;
+ static volatile int cmd_queue_index_w = 0;
+ static volatile int commands_in_queue = 0;
static char command_queue[BUFSIZE][MAX_CMD_SIZE]; In case of recursion this may make the difference. |
@AnHardt |
@AnHardt I don't see anyplace in the code where if (commands_in_queue < BUFSIZE) get_available_commands();
. . .
if (commands_in_queue) {
. . .
commands_in_queue--;
} if (commands_in_queue == 0) stop_buffering = false;
. . .
while (commands_in_queue < BUFSIZE && MYSERIAL.available() > 0) {
. . .
_enqueuecommand(serial_line_buffer, true);
. . .
} |
@maukcc Yes, that's the old behavior, and what I had hoped eliminate with the Logging lines in just the right places should make it obvious what's going on. Unfortunately I am not near my printer today, so I cannot test this right now. |
Ok, so I posted a branch with debugging added at https://github.com/thinkyhead/Marlin/tree/rc_debug_stop_print. When you use "Stop print" it sets a flag to start displaying debug information before calling if (canceled_sd_print) {
DEBUG_VAR(card.sdprinting);
DEBUG_VAR(commands_in_queue);
DEBUG_VAR(cmd_queue_index_r);
DEBUG_VAR(cmd_queue_index_w);
} |
Ok. Got it. SDTEST.G
Log
We are in |
That's what I figured, but I couldn't trace where inside of if (commands_in_queue) --commands_in_queue; |
! |
Ok, I think we got it! #4214 is merged. Printing should now stop with no more commands processed! |
Where does this code go? And what is the change? Then I can give it a test. |
@maukcc |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
hi guy i use RCBugFix firmware
when i printing........3min later.........tune print stop
the X-axis is go and back cycle ( go ahead Retreat cycle)
what is problem ???
and i change firmware 1.1.0 RC6 is ok!!!
The text was updated successfully, but these errors were encountered: