View unanswered posts | View active topics It is currently Tue May 21, 2013 6:49 pm



Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Gen6: checksum errors when trying to print 
Author Message

Joined: Mon Mar 28, 2011 10:32 am
Posts: 12
Post Gen6: checksum errors when trying to print
Hi.

I'm trying to print for the first time. I've compiled libreprap and repsnapper from github, last version, under linux. I can connect to the gen6 board, and issue simple commands under the tab "printer controls" (like moving a few steps in X, Y and Z, turn on and off the heater, etc). Optos are ok. Temps are ok (checked with M105, IIRC). I can even extrude a bit of PLA.

Problem:

I load an STL file, convert it to gcode, hit "print". At first, things look promising: the printer homes, goes to the starting position for the print, etc. However, it nevers actually starts printing.

The first weird thing is that the "Printing:" progress bar progresses very fast (it finishes in a couple of minutes).

Under the tab "comm" I can see:

Quote:
(Removed a zillion lines: commands sent TO the printer, and only a few "ok" FROM the printer. Here comes the interesting part:)

N2950 G1 X49.65 Y39.0363 E12676.7 F1000*58

N2951 G1 F1000*112

N2952 G1 Y40.4505 F3828.43*13

N2953 G1 Y41.8647 F1000*45

ok
ok
N2954 G1 F1000*117

ok
ok
N2955 G1 X48.5893 Y42.9254 E12678.2 F4000*52

ok
N2956 G1 X42.9254 Y48.5893 E12686.2 F4000*54

Serial Error: checksum mismatch
rs 7
ok
N2957 G1 X41.8647 Y49.65 E12687.7 F1000*55

ok
N2958 G1 F1000*121

N2959 G1 X43.279 F3828.43*60

Serial Error: LineNr is not the last lineNr+1
rs 7

ok
ok
N2960 G1 X44.6932 Y49.65 F1000*115

N2961 G1 F1000*115

Serial Error:Recieved a LineNr code without a Checksum code or Checksum without LineNr
N2962 G1 X45.7538 Y48.5893 E12689.2 F4000*58

rs 7
ok

(and so on...)


Every run is the same, with minimal variations (somestimes I get "rs 11", sometimes "rs 6").

IMHO, it seems as if repsnapper (or libreprap) is "spamming" the printer, i.e. it's ignoring flow control. Is it "normal" for repsnapper to send about 3000 lines of gcode, without waiting for the "ok"s of the first lines?

The cable seems ok. I've even recompiled and uploaded succesfully the gen6 firmware several times. I've tried setting the baud rate to 19200, 38400... and even 115200! The outcome is the same. Note I can send the firmware thru the cable without errors.

Apart from the baud rate, I have only reversed a couple of axis directions (I'm building a prusa), I've made no other changes to the firmware.

Edit: actually, I did another change, I changed the "resend" response to "rs", to conform to gcode specs, as mentioned in this thread: viewtopic.php?f=35&t=310&view=previous However, I get the same results with or withour this change.

I've searched the whole internet for hours, to no avail.

Any ideas?


Wed Jun 08, 2011 1:17 am
Profile

Joined: Mon Mar 28, 2011 10:32 am
Posts: 12
Post Re: Gen6: checksum errors when trying to print
Hmmm.

I can see at http://reprap.org/mediawiki/images/0/0f ... ircuit.pdf that gen6 doesn't seem to implement any kind of hardware flow control. RXD and TXD are the only lines connected between the Atmega 644 and the FT232RL? If so, the Arduino runtime could not signal anything (i.e., "don't swamp me") to the computer.

So, this leaves only software flow control, but at http://reprap.org/wiki/Libreprap "software flow control" seems in the to-do list!

This would explain very well this issue, but, of course, I must be wrong because it seems I'm the only one getting it.

Maybe it's a bug in the last version of repsnapper/libreprap, and usually the people get the packaged version, so they are not getting it?


Wed Jun 08, 2011 11:19 am
Profile

Joined: Fri Dec 31, 2010 3:00 pm
Posts: 74
Post Re: Gen6: checksum errors when trying to print
rs means request for "resend".

In the code you posted the hardware seems to be asking for resend line #7.

The commandbuffer is only a few commands deep (somewhere like 4 commands).

Repsnapper should: wait for OK, ánd it should resend when a mismatch occurs.

If I where you I would be searching in the repsnapper source for the resend command.


Wed Jun 08, 2011 11:42 am
Profile

Joined: Fri Dec 31, 2010 3:00 pm
Posts: 74
Post Re: Gen6: checksum errors when trying to print
In Tonokip version for repsnapper I can find that repsnapper is looking for "Resend"
(libreprap / tonokip.c)


Wed Jun 08, 2011 11:56 am
Profile

Joined: Mon Mar 28, 2011 10:32 am
Posts: 12
Post Re: Gen6: checksum errors when trying to print
ElmarJongerius: I agree with you. It does not make sense: the printer is ack'ing line 6 (or whatever), while repsnapper is sending line number 3000.

I've been diving into repsnapper and libreprap (repsnapper uses libreprap for "low-level" communications) and it seems to me that this line in serial.c in libreprap is wrong:

Quote:
/* Handle software flow control bytes from machine */
attribs.c_iflag |= IXOFF;


I think it must be IXON, not IXOFF.

IXOFF means "I (the computer) will send start and stop software flow control characters", which is useless (the 3d printer is not going to swamp the computer).

IXON means "I (the computer) will parse the start and stop characters received, and stop my flow accordingly".

Reference 1:
http://www.chemie.fu-berlin.de/chemnet/ ... bc_12.html
Quote:
IXON: If this bit is set, start/stop control on output is enabled. In other words, if the computer receives a STOP character, it suspends output until a START character is received. In this case, the STOP and START characters are never passed to the application program. If this bit is not set, then START and STOP can be read as ordinary characters.


Reference 2:
http://book.chinaunix.net/special/ebook ... 1sec3.html
Quote:
STOP: The stop character. This character is recognized on input if the IXON flag is set and is automatically generated as output if the IXOFF flag is set. A received STOP character with IXON set stops the output. In this case, the STOP character is discarded when processed (i.e., it is not passed to the process). The stopped output is restarted when a START character is entered.


It's worth mentioning that this line was introduced in 2011-1-17 and has not been changed since (https://github.com/Ralith/libreprap/com ... 7#serial.c), so everybody should have the same bug! Of course, I must be wrong somewhere because I seem to be the only one getting this issue.


Wed Jun 08, 2011 12:09 pm
Profile

Joined: Mon Dec 20, 2010 3:38 pm
Posts: 166
Post Re: Gen6: checksum errors when trying to print
have you made sure your electronic noise environment is as low as possible?... make sure your USB cable is not running along any stepper motor or heater cables...

Al...


Wed Jun 08, 2011 12:11 pm
Profile

Joined: Mon Mar 28, 2011 10:32 am
Posts: 12
Post Re: Gen6: checksum errors when trying to print
ElmarJongerius wrote:
In Tonokip version for repsnapper I can find that repsnapper is looking for "Resend"
(libreprap / tonokip.c)


To be sure, I'll change back the "rs" to "Resend". I think I checked but I may be wrong, and this change is causing my problem.


Wed Jun 08, 2011 12:11 pm
Profile

Joined: Mon Mar 28, 2011 10:32 am
Posts: 12
Post Re: Gen6: checksum errors when trying to print
araspitfire wrote:
have you made sure your electronic noise environment is as low as possible?... make sure your USB cable is not running along any stepper motor or heater cables...

Al...


This cable is "stolen" from a big USB drive. I've transmitted hundreds of GB withour errors. And I can upload new firmware images to the board without problems. Anyway, it's worth checking, so I'll this afternoon.


Wed Jun 08, 2011 12:15 pm
Profile

Joined: Mon Dec 20, 2010 3:38 pm
Posts: 166
Post Re: Gen6: checksum errors when trying to print
You understand that the bot is not switching heaters or running electronicly noisy motors when uploading firmware of course...

I personally twist the coil wires on my motors together... ensure my signal wires never run along (it's ok to cross) noisy drive cables... keep the USB cable well clear of everything.. as one wrong bit in the wrong place can cause disaster...

Al...


Wed Jun 08, 2011 12:21 pm
Profile

Joined: Mon Mar 28, 2011 10:32 am
Posts: 12
Post Re: Gen6: checksum errors when trying to print
I'm more and more convinced that the repsnapper/libreprap current version is bugged.

After googling for a while, it seems to me that what gen6 does (no hardware flow control) is in line with other Arduino-family designs. Also, Arduino runtime does not implement software flow control (no XON-XOFF). So, there's no "traditional" flow control at all.

Arduino has a 128 receive buffer (maybe sanguino's is larger), and you are supposed to do whatever you need to avoid swamping the receiver. And guess what... the last version of libreprap/repsnapper is not taking care of this. Repsnapper totally ignores the "4 lines buffer" (the config parameter is not referenced anywhere in the code), and they also don't count the number of "ok"s received from the board.

I'll check more on this this afternoon.


Wed Jun 08, 2011 2:27 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.