repetier / Repetier-Host-Mac

Host programm for RepRap like 3d printer.
69 stars 35 forks source link

"endstop hit" message from printer causes problems in sending future commands #20

Open MaikStohn opened 12 years ago

MaikStohn commented 12 years ago

Details:

==> turning off the heaters, setting the fan, ... is not executed ==> also the print job is still marked as "active" and the only solution is to "disconnect" / "reconnect" to the printer.

The same end-gcode sequence worked in previous versions.


BTW: Thanks for this great software. I use it for some time now and it never caused a bad print.

repetier commented 12 years ago

Hi,

could you please provide a copy of the logfile around that section (not the complete file). You find the switch in Preferences->Colors->logging. You can open the directory with the log with cmd+F. I need to see the communication that happens around the error for an analysis, what goes wrong.

MaikStohn commented 12 years ago

I completed a new print and caught the log this time:

GCODE:

...
G1 X64.423 Y66.816 E4.16367
G1 X64.621 Y66.618 E4.16500
G1 F3600.000 E0.16500
G92 E0
M107
M140 S0 ; turn bed off
M106 S255 ; Fan on maximum
G90 ; absolute coordinates
G0 X0 Y0 F5000 ; go to x,y zero 
M400 ; finish all buffered moves
M104 S0 ; turn hotend off
G0 Z1000 F1000; go to z max
M84 ; disable motors
; filament used = 285.8mm (1.9cm3)
; END OF GCODE FILE

LOG:

...
12:53:17: Printing layer 8 of 8
12:55:27: echo:endstops hit:  X:0.01
12:55:27: Error:Line Number is not Last Line Number+1, Last Line:22605
12:55:27: Resend:22606
12:55:27: Resend: N22606 M400 ; finish all buffered moves *13

The last GCODE sent from above was "G0 X0 Y0 F5000 ; go to x,y zero" which hits the endstop during travel. It then stays there for ever. None of the remaining GCODE commands or manual commands from GUI can be sent. Also clicking the "KILL- JOB" button has no effect. The only way to start communication with the printer again is to "Disconnect" / "Connect".

repetier commented 12 years ago

Hi,

thats already better but not the log I meant. The log you see in the host is only the filtered log. I meant the log written to disk, where all exchanged data is stored. That is why I explained how to create and find the file :-) Also it could be 20 Lines more above/below. If it is true that it happens with homing to z max this should also happen if you send the command manually. You could also try to write and send a script with the last lines if it needs a combination to create the error. What I think is that one of the commands send a message back that the host interprets as message read and executed. These lines are normally removed fro the visible log, because there are so many of them.

MaikStohn commented 12 years ago

I tried manually but then it does not happen. Also tried slow moves with endstop hit and during move to issue the M400... Always ok when doing manual.

Anyway, running next print right now I will catch the log you request.

MaikStohn commented 12 years ago

Here the complete log (END-GCODE sequence identical to the previous post)

...

> 14:22:43: N7651 G1 X40.52 Y37.85 E22.9730 *112
< 14:22:43: ok
> 14:22:44: N7652 G1 X40.84 Y37.73 E22.9747 *113
< 14:22:44: ok
> 14:22:44: N7653 G1 X81.57 Y78.47 E23.2472 *112
< 14:22:44: ok
> 14:22:46: N7654 G1 X82.01 Y78.47 E23.2493 *120
< 14:22:46: ok
> 14:22:46: N7655 G1 X53.95 Y50.40 E23.4370 *121
< 14:22:46: ok
< 14:22:47: ok
> 14:22:47: N7657 G1 E19.4370 F3600.00 *53
> 14:22:47: N7658 G92 E0.0000 *117
< 14:22:47: ok T:215.9 /216.0 B:60.0 /60.0 @:84 B@:19
> 14:22:47: N7659 M107 *56
< 14:22:47: ok
> 14:22:47: N7660 M140 S0 *114
> 14:22:49: N7661 M106 S255 *115
< 14:22:49: ok
> 14:22:49: N7662 G90 *5
< 14:22:49: ok
< 14:22:49: ok
> 14:22:49: N7663 G0 X0.00 Y0.00 F5000.00 *113
< 14:22:49: ok
< 14:22:49: ok
> 14:22:49: N7664 M400 ; finish all buffered moves *62
< 14:22:49: ok
< 14:23:14: echo:endstops hit:  X:0.06
< 14:23:14: Error:Line Number is not Last Line Number+1, Last Line:7663
< 14:23:14: Resend:7664
  14:23:14: Resend: N7664 M400 ; finish all buffered moves *62
< 14:23:14: ok
  14:23:57: Connection closed
repetier commented 12 years ago

Ok, I think it either the comment. The host normally doesn't send comments or the M400 which is >255 which is a special case for the host. Handling might have changed for that. The next version should be able to handle this correctly, as the next repetier firmware also uses such high codes now. A third reason could be a missing ok after resending the line. You might try hitting the fake ok button when the printer stalls. There is an option in the printer settings "Firmware sends ok after error", perhaps you need to uncheck that for Marlin.

MaikStohn commented 11 years ago

I tested today with the latest version 0.51 with exact same result.

I observed that the comment is sent to printer for the "M400" command only.

Next thing I try is to remove the comment in my end-gcode and report back soon.

Maik

repetier commented 11 years ago

Ok, I tested it myself and it is a combined fault. Marlin crashes if the comment is behind a command. The host normally removes comments, but not for M/G Codes > 255. So for now remove the comment and it will work.

MaikStohn commented 11 years ago

I just removed the comment and it worked.

Thanks for the help.