GRBL Freezes while sending a file

Discussion about the arduino based g-code interpreter, grbl
cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: GRBL Freezes while sending a file

Post by cvoinescu » Sun Dec 30, 2012 1:28 pm

I found the source, or one of the sources, of the "random" occurrences: the fridge. I also found that connecting the signal and power ground (Arduino GND, motor power supply V-) to earth (aka ground -- confusing!) makes it less likely for the fridge to interrupt my connection, but does not fix the problem completely. I'll try the ferrite torus (thanks @misan2), and I've also ordered parts for a USB serial interface with optocouplers.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

forgottenCNC
Posts: 34
Joined: Mon Jul 30, 2012 6:36 am

Re: GRBL Freezes while sending a file

Post by forgottenCNC » Mon Dec 31, 2012 4:19 am

V+ and V- are terms used in DC because these points are “floating” voltages, this basically mean these points are not references to anything e.g “ground” and can be used in a positive or negative potential.

Earth is a term used in AC (mains) or site protection and its' main purpose is safety, for example if you have a metal case that is not earthed and the Active(Live) phase of your mains power shorts to the case, the case is now “Live” and can kill. By earthing the case the active phase is now shorted to earth and should trip/blow fuses.

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: GRBL Freezes while sending a file

Post by cvoinescu » Mon Dec 31, 2012 2:26 pm

@forgottenCNC, I agree.

"Earth" (or protective earth) in the UK and "ground" (equipment grounding conductor) in the US mean the same thing. So what would be an earthed socket here is a grounded outlet across the pond. They call an RCD a GFCI and so on. I'm not sure what the correct terms are in the US, but in the UK both the Line and Neutral conductors are considered live, technically.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

AngusF
Posts: 17
Joined: Mon Apr 09, 2012 9:33 pm

Re: GRBL Freezes while sending a file

Post by AngusF » Tue Jan 01, 2013 4:55 pm

Grounding V- did the trick for me!

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: GRBL Freezes while sending a file

Post by cvoinescu » Thu Jan 03, 2013 2:49 pm

Earthed V- and ferrite torus on USB cable did not fix it completely, but the USB-to-serial converter with optocouplers on the TTL serial lines did.

The bill of materials is as follows: Chinese USB-to-serial with SiLabs CP2102 chip (I bought this one; Pololu also have one), two 6N137 optoisolators (from here, but any will do), a USB B female to A female adapter (such as this), four 470 ohm resistors (from my box o' resistors), breadboard (this one is of excellent quality, miles above the $#&* I got on eBay for about the same price), wires. I changed the serial interface in Marlin to 2 (unused pins on my Mega), but it should work fine with serial 0, because there are 1 Kohm resistors between the USB chip and the main microcontroller. To be on the safe side, lower the pull-up on the output of the computer-to-Arduino optocoupler to 270 ohm.

If someone wants the schematic I can draw it, but it should be fairly obvious. The LEDs of the optocouplers are connected between VDD and the respective signal pin (RX on the CP2102, TXn on the Arduino) with the 470 ohm resistor in series. The output of the optocoupler is open-collector, so it gets a 470 ohm pull-up to VDD. Make sure you use the Arduino ground and VDD on the Arduino side, and the USB +5V and GND on the computer side, with no connections between them.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

jsbannis
Posts: 80
Joined: Tue Apr 10, 2012 11:09 pm
Location: Chicago, IL

Re: GRBL Freezes while sending a file

Post by jsbannis » Thu Jan 03, 2013 7:29 pm

I've seen issues with USB/serial communication with arduinos with the Adalight code from Adafruit (for ambient lighting) where communication would shutdown seemingly randomly after a long duration. There is a setting in Windows under "control panel / power options / advanced / USB settings / USB selective suspend setting" to turn off USB hubs after inactivity, that doesn't seem to work quite right. Turning it off fixed my problem with the adalight code.

This may not be the problem since it seems that linux and OSX users are also experiencing this, and because grbl isn't an arduino sketch, but might be worth a try if you are running Windows.
shapeoko #0057

sa now
Posts: 7
Joined: Wed Dec 26, 2012 4:03 pm

Re: GRBL Freezes while sending a file

Post by sa now » Thu Mar 07, 2013 4:37 pm

hai all... i found that when i run the program and i start the spindle than grbl freezes ...even i put a little away from the machine it was same. but when run on air they could run. i mean without on the spindle.. these bellow pic my spindle.. i sit need to change the spindle?
Attachments
spindle.JPG
spindle.JPG (17.26 KiB) Viewed 4763 times

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: GRBL Freezes while sending a file

Post by cvoinescu » Thu Mar 07, 2013 5:02 pm

Does GRBL freeze, or does it just lose connection to the PC? It's difficult to tell, but try this (in mm mode): G1 F300 X100, hit Return, and immediately turn on the spindle while the machine is still moving. If it's GRBL, it'll stop moving right away. If it's the USB communication, it'll finish the move, but you won't be able to send any more commands.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: GRBL Freezes while sending a file

Post by Will Winder » Mon Apr 15, 2013 2:38 am

cvoinescu wrote:Earthed V- and ferrite torus on USB cable did not fix it completely, but the USB-to-serial converter with optocouplers on the TTL serial lines did.

The bill of materials is as follows: Chinese USB-to-serial with SiLabs CP2102 chip (I bought this one; Pololu also have one), two 6N137 optoisolators (from here, but any will do), a USB B female to A female adapter (such as this), four 470 ohm resistors (from my box o' resistors), breadboard (this one is of excellent quality, miles above the $#&* I got on eBay for about the same price), wires. I changed the serial interface in Marlin to 2 (unused pins on my Mega), but it should work fine with serial 0, because there are 1 Kohm resistors between the USB chip and the main microcontroller. To be on the safe side, lower the pull-up on the output of the computer-to-Arduino optocoupler to 270 ohm.

If someone wants the schematic I can draw it, but it should be fairly obvious. The LEDs of the optocouplers are connected between VDD and the respective signal pin (RX on the CP2102, TXn on the Arduino) with the 470 ohm resistor in series. The output of the optocoupler is open-collector, so it gets a 470 ohm pull-up to VDD. Make sure you use the Arduino ground and VDD on the Arduino side, and the USB +5V and GND on the computer side, with no connections between them.
I made one of these CP2102 based optocouplers with the schematics you posted over here, but am having trouble getting it to work with GRBL. Since the arduino is no longer running off the USB I'm powering it with a 6v AC adapter and then have the CP2102 plugged into the computer with the optocouplers connected to the arduino's rx/tx and 5v/gnd. I installed the CP2102 drivers so I see the device when I attach it to my computer, but I don't see GRBL starting up when I power the arduino. I also tried attaching the CP2102 rx/tx directly to the arduino to see if my wiring was the problem but still don't see anything.

Any idea what I'm missing?
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: GRBL Freezes while sending a file

Post by cvoinescu » Mon Apr 15, 2013 3:41 am

No, sorry. Mine worked on the first try. Have you set the baud rate to what GRBL wants (250,000 bps, if I recall correctly)? The only other thing that stands out is that 6 V may be too little for the voltage regulator on the Arduino. Does the Arduino power up? Also, I may have got the Tx and Rx the wrong way round, I'm not sure (not at home, can't check).

Edit The correct baud rate for GRBL is 9600, not 250,000.
Last edited by cvoinescu on Mon Apr 15, 2013 4:39 am, edited 1 time in total.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Post Reply