GRBL Freezes while sending a file

Discussion about the arduino based g-code interpreter, grbl
DasWookie
Posts: 8
Joined: Sat Mar 07, 2015 3:55 am

Re: GRBL Freezes while sending a file

Post by DasWookie » Mon Mar 16, 2015 10:18 pm

DasWookie wrote:I keep having problems with my job freezing up about 40 minutes in. It's happened 4 different times now, with 2 separate files, and three different controllers: Easel, Universal gCode Sender, and Grbl Controller.
Well fricky frack! This has just gotten worse and worse. It started locking up this morning only about 4-5 minutes in, and now, the gShield won't control the steppers at all. The blue power LED is flashing, and the X axis LED is also flashing. The axis seems to be pulsing on/off/on/off. I tried running a job a fifth time, but it's just no use. The gShield seems to be fried, or something! It's doing this pulsing if it's plugged into the Arduino or not, and as a test I tried pulling all the stepper wires and it's still just pulsing the blue LED indicator on/off/on/off.

I don't know what is wrong with this thing. It had been working perfectly, just only for 40 minutes or so, before it worked less and less time, and now, not at all. No wires were ever crossed, no axis was ever crashed causing missteps or skipping of the belt. I ran the Hello world with the sharpie, ran the circle diamond square for calibration confirmation, and then started trying to mill my part, and it's just gone to hell. :(

RobCee
Posts: 587
Joined: Wed Jan 08, 2014 11:33 am
Location: Birmingham, UK

Re: GRBL Freezes while sending a file

Post by RobCee » Tue Mar 17, 2015 8:46 am

I was having similar frustrations to you and boiled it down to the lack of error checking in the USB connection. From my reading (that I can remember) I found that the USB connection's handshaking can be flaky. When the handshaking breaks down, the behaviour is exactly as you describe. If it is the same as the challenges I was facing, then simply disconnecting everything will be insufficient. I had to reboot to refresh my connection.
The solution, to my particular problem, was to use a Galvanically Isolated USB board to connect my laptop into the Arduino/Gshield boards.
Another proposed solution was to use a bluetooth adapter on the Arduino side. Apparently they are available pretty cheaply.
ShapeOko2 #3400 - Chinese 800W AC Spindle - Stiffened X-Axis - TR10 Z-Axis - Inverted Z Motor - Hall Effect Limits - Drag Chains & Custom Brackets

criznach
Posts: 220
Joined: Sat Dec 14, 2013 5:28 pm
Location: Great Falls, Montana, USA

Re: GRBL Freezes while sending a file

Post by criznach » Tue Mar 17, 2015 5:27 pm

The adafruit bluefruit ez-link has been working great for me. I haven't had a freeze up since I switched.

https://learn.adafruit.com/introducing- ... k/overview

I do sometimes have to push reset on the GRBL shield after hitting connect in gcode sender before I see the GRBL welcome/header info.

WillAdams
Posts: 8547
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: GRBL Freezes while sending a file

Post by WillAdams » Tue Mar 17, 2015 5:48 pm

Okay, lemme see if I understand:

- one can plug in a Bluetooth adapter into one's microcontroller's USB connection
- one can then connect to said adapter using one's Bluetooth-capable computer
- this allows one to operate one's machine w/ the only cables to it being power for the stepper drivers and spindle
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets
Nomad 883 Pro #596 (bamboo)

twforeman
Posts: 1350
Joined: Tue Jan 29, 2013 4:51 pm
Location: Minneapolis, MN
Contact:

Re: GRBL Freezes while sending a file

Post by twforeman » Tue Mar 17, 2015 5:55 pm

You definitely should have a fan blowing cooling air over the Grbl shield. The stepper drivers will go into thermal shutdown and lose steps. Or just lock up.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

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 » Tue Mar 17, 2015 6:27 pm

WillAdams wrote:Okay, lemme see if I understand:

- one can plug in a Bluetooth adapter into one's microcontroller's USB connection
- one can then connect to said adapter using one's Bluetooth-capable computer
- this allows one to operate one's machine w/ the only cables to it being power for the stepper drivers and spindle
Not quite that simple. The Bluetooth adapter gets connected to Arduino GND, 5V, D0 and D1. You also need to power the Arduino, because it won't get 5V from USB anymore. A small DC-DC converter to get 12V out of the motor supply is ideal (useful for fans too).
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

DasWookie
Posts: 8
Joined: Sat Mar 07, 2015 3:55 am

Re: GRBL Freezes while sending a file

Post by DasWookie » Tue Mar 17, 2015 10:07 pm

RobCee wrote:I was having similar frustrations to you and boiled it down to the lack of error checking in the USB connection.
This seems to be a problem with the gShield itself. I disconnected the steppers and removed it from the Arduino and wired it up to my bench power supply. It immediately threw the fault light and shut off the current. So, seems that the gShield, or more likely one of the DRV8818 stepper driver ICs gave up the ghost. I suspect it's the X axis one. Luckily, the guys over at Inventables are sending me a replacement. I want to be sure I stated that they did so of their own volition. I just contacted them to ask about what the problem might be, and they said "Seems like you likely got a bad board, we will send you a replacement." so I'm VERY happy about (and surprised by) that. While I can SAY I didn't do anything stupid, I've built enough circuits and delivered enough electronics to see some incredibly stupid stuff folks have done. Certainly not as much as they have, but enough to know that bad boards are FAR less likely that end users making significantly stupid mistakes. To Inventables credit, they stood behind their product before I even considered asking them to! So, two big thumbs up of props to Zach and his crew! That sort action contributes significantly to customer satisfaction, and I'll be letting everyone know they just did good in a big way in my book!

garetbiglow
Posts: 76
Joined: Fri Dec 26, 2014 6:33 pm

Re: GRBL Freezes while sending a file

Post by garetbiglow » Wed Aug 05, 2015 7:36 pm

All the USB stuff is super annoying. I have USB dropouts here and there (just wrecked a $40 piece of walnut yesterday) and it's really not predicatable. It's especially annoying when you run the machine without limit switches, as when the machine screws up, there is no way to recover your position smoothly.

USB is not an industrial serial connection. It's just not very robust in noisy electrical environments. A 0 or 1 is one different by ~3V. Not much noise is needed to influence the signal. It's also buffered, and not truly real time. I suspect this is the reason that jogging an SO3 right now on 'fast' or 'slow' is really choppy.

I'm not sure why more people aren't considering RS232 as an option? It is a much more stable serial connection for industrial environments (noisy steppers, AC spindle motors). With the voltages swinging from -13VDC to +13VDC for your 0's and 1's, it's much more capable of withstanding the electrical noise. It's also a very low level peripheral in computers that have a dedicated serial port, and is real time (not buffered). I've recently designed a PCB with RS232 connected to the Atmega328p (via a MAX232) + 4 x Sparkfun's Big Easy Driver to give RS232 a go and see if it solves the dropout issues. I know RS232 is slower, but GRBL is operating at 115200 baud, so thats well within RS232 spec.

Thoughts?
SO3 #0196

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 » Wed Aug 05, 2015 10:00 pm

The reason we don't use RS232 is that very few computers have serial ports anymore, but all have USB. So most people would have to use a USB to RS232 adapter, which is exactly what the Arduino Uno and the Carbide Motion boards are: the AtMega16U2 chip is programmed to do just that. The communication to the AtMega328P is serial (but at logic levels, because there's no point in shifting levels back and forth when both chips are on the same board).
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

garetbiglow
Posts: 76
Joined: Fri Dec 26, 2014 6:33 pm

Re: GRBL Freezes while sending a file

Post by garetbiglow » Fri Aug 21, 2015 7:52 pm

I agree that using an RS232 converter is a poor solution. You're still using USB, just adding another layer of translation. Using an RS232 GRBL controller via a USB port is not a good idea. I also agree, the machine is much more accessible as it uses a USB connection. It's very hard to find computers with a native RS232 port anymore.

However, it would be nice to have the option. I would much prefer to purchase a board based on RS232. I think the advantages in this application are very obvious. The requirements of GRBL are very minimal as far as a serial connection goes and RS232 more than meets those requirements. It's more immune to electrical noise as well which the Shapeoko + Dewalt611 produces lots of. Also, being quite a low level function, without so many software handling layers, the connection is more stable.

I have rewired my machine completely now using a PCB i designed with RS232 and have had much better results. No more dropouts. Even running the router/vacuum on the same circuit.

I think the ultimate solution however is to port GRBL over to the Raspberry Pi and run the whole works right on the machine. This kind of software development is over my head, but I'd happily design some PCB's/shields!
SO3 #0196

Post Reply