Job hangs

lutorm
Posts: 9
Joined: Tue Apr 16, 2013 4:00 am

Job hangs

Post by lutorm » Sun Apr 21, 2013 7:39 pm

Hey all,

I've had this spurious problem where the ShapeOko will just stop in the middle of a job. There is no feedback in GrblController, it just hangs. I don't know whether this is the limit switch wiring picking up an inductive spike or some other power issue that causes the Arduino to crap out. (If it's the limit switch, grbl should respond with an alarm, but when sending a file GrblController doesn't seem to handle unexpected responses very well.) It seems to happen more often when other stuff is running (shopvac or compressor), so I'm pretty sure it's some sort of noise pickup. Any ideas on how to troubleshoot? I was thinking of putting the scope on the limit switch pins, but it happens rarely enough that it'll be almost impossible to catch.

Thanks,

/Patrik

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

Re: Job hangs

Post by cvoinescu » Sun Apr 21, 2013 7:53 pm

It's a fairly common problem, and it's usually the USB communication that craps out, not the Arduino itself. It happens enough that it's got its own sticky thread. That points to at least two other threads discussing the same issue. In brief, there are several things that could help: a shorter and better screened USB cable, grounding/earthing the electronics of the machine, and looping the USB cable through a ferrite RFI suppressor. However, the only thing found 100% effective so far is complete electrical isolation of the USB from the rest of the machine, for example using the optocoupler circuit I've posted a while back.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

lutorm
Posts: 9
Joined: Tue Apr 16, 2013 4:00 am

Re: Job hangs

Post by lutorm » Sun Apr 21, 2013 8:17 pm

Ah, thanks. I'd missed that thread.

I'm a bit puzzled that it would be the usb, because one of my other projects was to put an Arduino (or a surface-mounted Atmega 328p, to be precise) in a wine refrigerator. It has a thermoelectric cooler that uses something like 7A that's PWM'd by the Arduino and was causing all kinds of noise issues. However, the usb cutting out was not one of them -- even when it was picking up garbage on all other input lines, the USB connection to the laptop was rock solid. It was more likely to reset the Atmega without dropping the usb.

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

Re: Job hangs

Post by cvoinescu » Sun Apr 21, 2013 9:30 pm

That's interesting, and I don't know why that would be. It may be that in your case it's the Arduino, but for me it has always been the USB.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

bjbsquared
Posts: 102
Joined: Mon Nov 26, 2012 10:48 am

Re: Job hangs

Post by bjbsquared » Sun Apr 21, 2013 11:32 pm

I had some hanging issues until I unplugged my spindle from the common power strip I was using for the computer and power supply and ran it directly to the wall with another extension cord. I also made sure the spindles power cord was moved away from the electronics. No problems since those adjustments (crossing fingers).
#1016 - 1M x 1M Y: Dual Motor Drive w/Looped Belts, X:Dual Rail with wlanfox blocks, Z: Stock, Spindle:DW660

rca
Posts: 8
Joined: Fri Mar 29, 2013 4:54 am

Re: Job hangs

Post by rca » Mon Apr 22, 2013 4:19 am

I do a fairly big computer lighting display that used to be run from a USB dongle. We had USB issues with that connection as well and it was PIC based. Usually switching to a higher quality USB cable would fix the problem, like 9 times out of 10.

lutorm
Posts: 9
Joined: Tue Apr 16, 2013 4:00 am

Re: Job hangs

Post by lutorm » Mon Apr 22, 2013 5:40 am

Well, this gets weirder: I just tried to mill some aluminum, and 4 out of 5 times, grbl would hang right as the bit touched the metal. It happened every time when I ran my test program (which just spiraled into the plate), and all but a couple of times when manually commanding while looking for the stock surface.

Is it possible there's static buildup on the bit that causes a little spark when it touches? That's the only thing I can think of that would make it happen so repeatedly at that point.

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

Re: Job hangs

Post by cvoinescu » Mon Apr 22, 2013 6:59 am

Depending on how your workpiece is clamped, could it be in contact with the frame of the machine? The bit would not be, as the spindle is insulated. There's enough capacitance and leakage to cause a lot of noise, even without static electricity. Try grounding the frame of the machine, and maybe the gantry too.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

ejs
Posts: 84
Joined: Sat Apr 28, 2012 7:42 pm
Location: Pittsburgh, PA, USA
Contact:

Re: Job hangs

Post by ejs » Tue Apr 23, 2013 7:21 pm

I'd like to post in light of bjbsquared's comments. I was working late last week on some thin brass sheet with no issues. Two days later, with no changes to the setup, I went after milling some upgraded end plates in aluminum and nothing but disaster. anywhere from 60 to 1200 lines in the thing would freeze up. I downloaded the Universal G-code Sender which is very good for the price, and it showed me what other programs didn't--an I/O error that kept reoccurring.

Scientists would shame me, but I changed two things at once to try and fix this mess. First, I thought my Arduino may be bad, so I put in a clone I wanted to try. Second, I disconnected the dehumidifier that was on the same outlet as my 'Oko setup but is usually not on at the same time I'm cutting. I've got two plates done in two days. I had the machine lock up on my once, but it smelled more like a Java freeze than a communications error.

Since I'm betting the Arduino is fine, I'd recommend getting your setup off the same circuit as anything else with an AC motor in it. Fridge, dehumidifier, bench grinder, and so on.

EJ
Build it better than it was built for you. And give permission for the next guy to do the same. That's how Open Source works.
ShapeOko # 497: http://bit.ly/reactshop producing the Buildlog CNC Stepper Shield

lutorm
Posts: 9
Joined: Tue Apr 16, 2013 4:00 am

Re: Job hangs

Post by lutorm » Sat Apr 27, 2013 8:05 pm

So I hooked up the limit switch pins to the scope, and I'm pretty sure they are picking something up. Every time the machine has hung, the scope has triggered on a spike in the voltage on the limit switches. It always looks pretty much the same, the voltage drops to close to 0V and then rapidly swings up and dampens over maybe a ms. A couple of times it's happened when just running a manual move and then grbl has shown the "hard limit alarm". I guess I should test the +5V line, too -- it might just be drops in the supply.

Post Reply