I started to build a CNC mill controlled by an Arduino board
it's all going pretty well. I made a little app using "processing" and it sends instruction to the arduino with "Serial.Write()". (so far so good)
the problem is that it sends instructions faster than the CNC mill can deal with.
It seem that if Data is sent when the buffer is full, data is ignored....
wich in ma case leads to strange behaviour of my CNC
I can't figure out how to cope with that.
I tried adding delay() but it's not the good option,
Then I tried this:
while (Serial.available()>10){delay(1);} in order to stop the processing app sending data until the buffer is free.....
but it works not :-/
i think you are right, but I need to know how slow should i go.
of course it'll work if I add 1 second delay after each instructions but then the router will take ages to drill my PCBs.
Well, the Arduino monitors how many characters it has in its buffer, and if it is greater than say 7/8 the capacity, the Arduino send an XOFF character.
Processing receives the XOFF and stops sending.
When the Arduino's buffer gets below, say 1/2 full, it sends an XON, and Processing starts sending again.
What handshaking have you got between your CNC and the Arduino?
hey AWOL!!!
I finally got My CNC working propperly thanks to you =]
I add and "ACK" but no "NACK" after each byte that the arduino board
receive so that the computer waits for it before sending the next byte!!!
making a video soon!! can't wait to drill my first PCB XD