Welcome! Log In Create A New Profile

Advanced

Arduino Mega using Shapercube (joaz's) firmware, problems communicating

Posted by kutch2001 
Arduino Mega using Shapercube (joaz's) firmware, problems communicating
September 19, 2010 10:41PM
I currently have a makerbot (yup, unfortunately right now) and had problems with the extruder controller as both the h-bridges on it are burnt out and makerbot doesn't have the replacements (go figure)... Have been wanting to switch to a simpler solution for the electronics, one where can easily replace components when they fail (and they will as shown). So picked up an Arduino Mega and the shield from ultimachine, along with all the assorted parts. As I didn't print a geared extruder had to stick with the existing extruder motor. As such, grabbed Joaz's firmware, from Shapercube, and modified it slightly to use an extra pin for the dc motor controller (a polulu TB6612FNG). Also wired the motor controller to the appropriate pins (bypassing what's on the board currently).

My existing problem stems from not being able to communicate well with the Mega. Not sure if doing something wrong or I'm just being a noob. Can't tell you how much have had to search and hunt and poke just to get this far.

When launch reprap.bat on a winblows machine (XP) get the following info in the dos window before the 2 windows appear for the software, which looks somewhat good I think.
C:\Program Files\reprap>rem reprap-host -- runs Reprap Java host code with an ap
propriate classpath

C:\Program Files\reprap>rem Amount of RAM to allow Java VM to use

C:\Program Files\reprap>set REPRAP_RAM_SIZE=1024M

C:\Program Files\reprap>rem reprap.jar file and stl file

C:\Program Files\reprap>set REPRAP_DIR=C:\Program Files\Reprap

C:\Program Files\reprap>rem Java3D and j3d.org libraries

C:\Program Files\reprap>set JAVA_LIBRARY_DIR=C:\Program Files\Reprap

C:\Program Files\reprap>rem cd so we can find the reprap-wv.stl file.  Can we av
oid this??

C:\Program Files\reprap>IF NOT EXIST reprap-wv.stl cd "C:\Program Files\Reprap"


C:\Program Files\reprap>java -cp ".\reprap.jar;.\RXTXcomm.jar;.\j3dcore.jar;.\j3
d-org-java3d-all.jar;.\j3dutils.jar;.\swing-layout-1.0.3.jar;.\vecmath.jar;." -X
mx1024M org/reprap/Main
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

From what I can tell there is nothing else until get a whole slew of the following messages, which look rather bad and ominous.
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.953s/31ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.953s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.953s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.953s/0ms]

Searched and found some info in German about these but, even with Google translate, couldn't understand much beyond they got it resolved somehow.

The Arduino code I have modified slightly is posted to google code, which is here

I do not think it's a hardware issue right now, am thinking it is mainly software and something is not configured properly on my end.

I have been able to communicate with the Arduino Mega using RepSnapper. Haven't done much with it as can't control the extruder motors with it (steppers yes, motors no). Just tried it while trying to figure other things out, and they mentioned it on the Shapercube wiki. Here is a log from that software (note, no 12V is applied to the shield yet so temp is not working).
21:28:59 Send >>Connecting to port: COM6 at speed 115200
21:29:00 Send >>Sending:M105 
21:29:01 Send >>Received: start
21:29:03 Send >>Sending:M105 
21:29:03 Send >>Received:T:307 with parameter 307
21:29:06 Send >>Sending:M105 
21:29:06 Send >>Received:T:302 with parameter 302
21:29:09 Send >>Sending:M105 
21:29:09 Send >>Received:T:298 with parameter 298
21:29:12 Send >>Sending:M105 
21:29:12 Send >>Received:T:305 with parameter 305
21:29:15 Send >>Sending:M105 
21:29:15 Send >>Received:T:312 with parameter 312
21:29:18 Send >>Sending:M105 
21:29:18 Send >>Received:T:315 with parameter 315
21:29:21 Send >>Sending:M105 
21:29:21 Send >>Received:T:307 with parameter 307
21:29:24 Send >>Sending:M105 
21:29:24 Send >>Received:T:305 with parameter 305
21:29:27 Send >>Sending:M105 
21:29:27 Send >>Received:T:293 with parameter 293
21:29:30 Send >>Sending:M105 
21:29:30 Send >>Received:T:310 with parameter 310
21:29:33 Send >>Sending:M105 
21:29:33 Send >>Received:T:302 with parameter 302
21:29:36 Send >>Sending:M105 
21:29:36 Send >>Received:T:312 with parameter 312
21:29:39 Send >>Sending:M105 
21:29:39 Send >>Received:T:302 with parameter 302
21:29:42 Send >>Sending:M105 
21:29:42 Send >>Received:T:300 with parameter 300

I would have tried some of the other Arduino Mega firmware that is out there, but the ones I looked at appear to only support stepper extruders (which is a good thing) and do not support DC motors at all. Have an extra stepper board waiting to hook into the shield so that when I can print the geared extruder will switch in a heartbeat.

The reprap software am using came with a name on the zip file: reprap-mendel-20100806.zip I am really impressed with the software, and the speed it loads so far.

Have attached my reprap.properties file for reference. Note, I did change to COM6 and baud rate to 115200, and couple other settings as couldn't figure out where it was located (FINALLY found it).

Thank you!
Attachments:
open | download - reprap.properties (11.1 KB)
Re: Arduino Mega using Shapercube (joaz's) firmware, problems communicating
September 23, 2010 08:28PM
OK, with no response from the group, I tried other firmware (tonokip's) and get a similar problem as I had posted above with Joaz's, but am able to see the first few queries and the return codes associated with them. Am going to assume that I have something setup improperly on the software and won't use the reprap software.

This is the first couple seconds of responses using tonokip's updated firmware on the arduino mega (unmodified) and reprap client software.

C:\Program Files\reprap>rem reprap-host -- runs Reprap Java host code with an ap
propriate classpath

C:\Program Files\reprap>rem Amount of RAM to allow Java VM to use

C:\Program Files\reprap>set REPRAP_RAM_SIZE=1024M

C:\Program Files\reprap>rem reprap.jar file and stl file

C:\Program Files\reprap>set REPRAP_DIR=C:\Program Files\Reprap

C:\Program Files\reprap>rem Java3D and j3d.org libraries

C:\Program Files\reprap>set JAVA_LIBRARY_DIR=C:\Program Files\Reprap

C:\Program Files\reprap>rem cd so we can find the reprap-wv.stl file.  Can we av
oid this??

C:\Program Files\reprap>IF NOT EXIST reprap-wv.stl cd "C:\Program Files\Reprap"


C:\Program Files\reprap>java -cp ".\reprap.jar;.\RXTXcomm.jar;.\j3dcore.jar;.\j3
d-org-java3d-all.jar;.\j3dutils.jar;.\swing-layout-1.0.3.jar;.\vecmath.jar;." -X
mx1024M org/reprap/Main
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Echo:00000N0 T0
*26 [0.000s/-1285286491406ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRapconfused smileyerial Error: Li
ne Number is not Last Line Number+1, Last Line:0 [0.015s/15ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Resend:1 [0.015s
/0ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Echo:N0 T0 *26 [
0.031s/16ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRapconfused smileyerial Error: Li
ne Number is not Last Line Number+1, Last Line:0 [0.047s/16ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Resend:1 [0.062s
/15ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Echo:N0 T0 *26 [
0.078s/16ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRapconfused smileyerial Error: Li
ne Number is not Last Line Number+1, Last Line:0 [0.078s/0ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Resend:1 [0.094s
/16ms]
ERROR: GCodeReaderAndWriter.getETemp() - no value stored! [0.094s/0ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Echo:N1 M113 *1
[1.609s/1515ms]
ERROR: GCodeReaderAndWriter.getETemp() - no value stored! [1.609s/0ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Echo:N1 M113 *1
[3.125s/1516ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRapconfused smileyerial Error: Li
ne Number is not Last Line Number+1, Last Line:1 [3.140s/15ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Resend:2 [3.140s
/0ms]
ERROR: GCodeReaderAndWriter.getETemp() - no value stored! [3.156s/16ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Echo:N1 M113 *1
[3.187s/31ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRapconfused smileyerial Error: Li
ne Number is not Last Line Number+1, Last Line:1 [3.203s/16ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Resend:2 [3.203s
/0ms]
ERROR: GCodeReaderAndWriter.getBTemp() - no value stored! [3.219s/16ms]
ERROR: GCodeWriter.waitForResponse() - dud response from RepRap:Echo:N2 M105 *5
[4.719s/1500ms]

Using exactly the same settings here is what Repsnapper returns, which seems to be much more conducive to what I am looking to accomplish.. And it has the added bonus of the temperatures looking roughly correct, within couple degrees.
19:58:45 Send >>Connecting to port: COM6 at speed 115200
19:58:47 Send >>Sending:M105 
19:58:48 Send >>Received: start
19:58:50 Send >>Sending:M105 
19:58:50 Echo >>Echo:M105
19:58:50 Send >>Received:T:21.00 with parameter 21.00
19:58:53 Send >>Sending:M105 
19:58:53 Echo >>Echo:M105
19:58:53 Send >>Received:T:21.00 with parameter 21.00
19:58:56 Send >>Sending:M105 
19:58:56 Echo >>Echo:M105
19:58:56 Send >>Received:T:20.00 with parameter 20.00
19:58:59 Send >>Sending:M105 
19:58:59 Echo >>Echo:M105
19:58:59 Send >>Received:T:20.00 with parameter 20.00
19:59:02 Send >>Sending:M105 
19:59:02 Echo >>Echo:M105
19:59:02 Send >>Received:T:19.00 with parameter 19.00
19:59:05 Send >>Sending:M105 
19:59:05 Echo >>Echo:M105

And, am going to assume I posted this in the wrong forum as it's not the official firmware?

Will try and update the firmware to use repsnapper and the DC motor extruder then post someplace...

Thanks for looking.
Re: Arduino Mega using Shapercube (joaz's) firmware, problems communicating
September 23, 2010 09:08PM
Both the firmwares you are testing are currently only compatible with Repsnapper's temperature comms. Try sending M101 and M103 from Repsnapper to Joaz's firmware to start and stop the dc extruder. You can then add them as custom buttons.

Edited 1 time(s). Last edit at 09/23/2010 09:09PM by johnnyr.
emt
Re: Arduino Mega using Shapercube (joaz's) firmware, problems communicating
September 24, 2010 04:25AM
Hi

I am using a Mega with the latest Mendel firmware. I also had the timing trouble with the host on Windows XP . There is a note that Java 6 is flaky on Windows so I tried Java 5. I still had trouble so I switched to Ubuntu. This works better for me and I can get jobs printed but I still sometimes get communication failure like this.

ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]
ERROR: bufferQueue(): too many retries (4) sending T0 [27.922s/0ms]

I am sure I have seen that a number of users have reported trouble wuth the Host communicating from Windows yet others seem to have no trouble at all. I wonder if it is minor differences in the computer serial port hardware.
I am hoping to use the experimental firmware at some time as I believe they have XON XOFF protocol working. At the moment there is no Mega or thermistor version. When someone cleverer than me sorts the thermistor code I will try and sort out the Mega pins. I did a little patching a while back and got it to compile and communicate on the Mega but without heater control I can't try it on a real job.


Regards

Ian
Re: Arduino Mega using Shapercube (joaz's) firmware, problems communicating
September 24, 2010 07:50PM
johnnyr Wrote:
-------------------------------------------------------
> Both the firmwares you are testing are currently
> only compatible with Repsnapper's temperature
> comms. Try sending M101 and M103 from Repsnapper
> to Joaz's firmware to start and stop the dc
> extruder. You can then add them as custom buttons.

Thank you so much for that info johnnyr.. Since they were both mentioned on the pages where I acquired the firmware, figured both reprap and repsnapper would work, guess not...

To figure out which firmware to stay with, that is the question now.. Will have to see which has the features I like the most, or I can just keep retrofitting.. Waiting for some connectors to arrive for the 12V (broke the one on the shield due to some movements not thought out when things weren't working) before can start testing fully..

emt - Am sure saw a thermistor version out there someplace, unless was delusional (which more than one person has called me). I would have no problem plopping it into either firmware if can point me to the source. Would put a switch in there to toggle what to use.

Going to the makerfaire in NYC (minus bot but with shield) so hopefully can get some tips from the folks there.

Thanks!
emt
Re: Arduino Mega using Shapercube (joaz's) firmware, problems communicating
September 25, 2010 07:51AM
Hi

I was referring to to the 5D Arduino firmware here:-

[github.com]


Regards

Ian
Re: Arduino Mega using Shapercube (joaz's) firmware, problems communicating
December 13, 2010 07:39AM
there are issues with older firmware and reprap host. i think it is when the check sum is not returned. I'm looking into it too. basically rewrite your firmware around the new one. The new firmware is good in the sense the interrupt handling no longer causes serial errors. the bad is it is a bit more to look threw and a big change in how it is written.

the mega version works out of the box with reprap host software. it is not friendly to replicator g yet. it does not have m17,m18,m101,m102,m103 commands. gets confused if it sees those, and sends back an error response. seems ok to work if you use reprap host and set baud to 19200. I hate java BTW... serial is so buggy on it! the default speed is 57600 so that and the pins.h file are what you need to change. also copy over the configuration.h.dist to configuration.h

here is the download for the host. [sourceforge.net] surprise. it is in the reprap host software firmware directory a few in...

since the most recent changes seem to effect communication and error checking each version may talk a little bit different, so you want to rewrite the firmware that is included.

or you can go back to reprap host before march release. here is the files folder [sourceforge.net]


I may not be adding anything new to you. good luck on getting your setup going. also thanks for the firmware tip above. i now know about the tonokip firmware for rep-snapper!
Sorry, only registered users may post in this forum.

Click here to login