Machine stuck at busy
Closed this issue · 11 comments
Using RAMPS 1.4 with Arduino mega. After uploading the code to and observing the output on serial moniter gives mm per rev(default value 95) as nan. So all calculation based on it gives nan. Problem persists even after uploading machine specs.
Could it be the possible reason for machine remaining busy?
It's not a good sign. If that issue isn't directly responsible for the busy signal, then it will definitely prevent any motion anyway.
You haven't described what you're trying to do when the machines gets stuck on busy? Moving? You mention that uploading machine spec seems to work.
Sorry that post was misleading.Machine spec wouldn't upload as it was busy after execution of the first command.
I made a small trick in the code to make the machine save 95mm.
However it is just a trick and not a standard solution. But still no avail.
Actually first when i resume the queue only one command gets executed and then it remains busy. Each time I reset it one command gets executed. When I had no improvement using it on Windows I tried the same on kali linux.
However the same issue struck me on linux too. So what I did was upload the machine spec one command at a time by resetting the board(opening and closing serial moniter while using the controller software) and bam...now it works atleast for now.
Also I saw the same issue (machine remaining busy) being brought up in your forum. I observed that the screenshot uploaded by that person shows nan for mm per rev as nan before his issue was solved and the screenshot posted by him after the issue was corrected shows his correct settings. He also mentioned that his issue was solved by itself.
So I assumed that there was some correlation between the machine stuck at busy and mm per rev as nan. However my observations showed that they we not related.
Hi thanks for the follow-up. Can I confirm: At first, the machine accepted only one command at a time, but it did act on that one command ... just never sent a "ready" back.
Eventually something (not sure what) happened that fixed it, and now it's fine?
Like all of the other persistent settings, mmPerRev is stored as a float in EEPROM. When the machine first turns on, the program retrieves the value from a particular address, and if its < 1, it gets set to a default value.
I don't suppose you ever watched the console when it was happening? There's a couple of diagnostic lines in eeprom.ino that I'd be interested in seeing what they said: "Loaded mm per rev: ...".
Okay. Before resuming the queue the machine sent a ready every 4 seconds. After I sent something via the serial moniter or resume the queue it gets stuck at busy and I don't receive a ready back. But when I reset the board one command gets executed and again gets stuck at busy.
I loaded the correct mm per rev using by checking
if(isnan(mmperrev))
Did you mean the output from the serial moniter at the beginning???
Loaded width:650
Loaded height:65
Loaded mmPerRev:nan
Loaded steps per rev:400
Loaded step multiplier:255
Loaded down pos:90
Loaded up pos:180
Recalc mmPerStep (nan), stepsPerMM (nan)
Recalc pageWidth in steps (-2147483648)
Recalc pageHeight in steps (-2147483648)
About to connect to serial port in slot 32
Successfully connected to port /dev/ttyUSB0
incoming: POLARGRAPH ON!
incoming: v1.4
incoming: Hardware: RAMPS14
incoming: Servo 4
incoming: Loaded machine width:650
incoming: Loaded machine height:650
incoming: Loaded mm per rev:nan
incoming: Loaded motor steps per rev:200
incoming: Loaded motor step multiplier:8
incoming: Loaded machine name:��������
incoming: Loaded down pos:90
incoming: Loaded up pos:180
incoming: penWidth: 0.80
incoming: Recalc mmPerStep (nan), stepsPerMM (nan)
incoming: Recalc pageWidth in steps (-2147483648)
incoming: Recalc pageHeight in steps (-2147483648)
incoming: Card failed, or not present
incoming: Autostart file couldn't be opened: AUTORUN.TXT
incoming: Released motors
incoming: READY_200
...
incoming: READY_200
regenerating preview queue. //here I cllicked set home
incoming: READY_200
incoming: READY_200
regenerating preview queue.
queue clicked.
Dispatching command: C02,0.8,END
Last command:C02,0.8,END
Then it stucks on BUSY. I have tested hardware with ramps14test sketch - motors do move.
But motor did not move with polargraph commands.
Yup. I've figured out that much and I forced the machine to upload the correct mmperRev by checking
if(isnan(mmperRev))
This set the mmperRev correctly. But I can't figure out why I've got the message Machine Busy.
Yup. I've figured out that much and I forced the machine to upload the correct mmperRev by checking
if(isnan(mmperRev))
This set the mmperRev correctly. But I can't figure out why I've got the message Machine Busy.
I can't replicate it but if I was going to try and fix it, I'd scatter a bunch of debugging Serial.prints throughout the code and see what comes out.
First thing is to uncomment
//#define DEBUG_STATE
//#define DEBUG_COMMS
and see if you can see anything interesting happening during the parsing of the incoming command.
There must be outdated version possibly containing a bug on the www.polargraph.co.uk page, as I got same 'mmPerRev nan' issue. Just go to github and download polargraph_server_polarshield and polargraphcontroller from there.
I am using RAMPS 1.4, Arduino IDE, Processing 2.2.1 (not 3.x).
Follow Wiki or Instructable and your setup will be completed shortly.