Automatic Spindle cuts off immediately

Ok, so, I had everything going smoothly, the machine was working perfectly.

Then, I decided to try running it with a Raspberry Pi. I don’t know if it has anything to do with it, but ever since plugging it into that thing I’ve had issues. I tried using GrblController as a Gcode sender. It was a pain in the neck, and nowhere near as nice as Easel, but it seems like the only thing that’ll work for a Raspberry Pi, or Linux, other than UGCS. I got the controls to work sorta, though it wouldn’t jog the X or Y axis until you jogged the Z axis (it returned an error, about undefined step size). The first time I sent it a job, I did so with the Z axis way up in the air to keep it from actually cutting, and it seemed like it was working. Today, nothing. It won’t turn the spindle on, and every time it hits a limit switch (when homing) it returns “Warning: Hard Limit” and I have to close and reopen the port. Sending a job didn’t really work either, it wouldn’t do anything if I told it to Zero the machine based on where it currently was, and if I told it not to, it went to the middle of the piece, but didn’t drop the Z axis to cut.

Based on this frustration, and faced with a need to just get a part cut already, I decided to go back to my Mac.

I don’t remember if it did this before, but now, when I plug the USB cable in, all the green axis lights on the grbl shield stay on. Also, (and this is most important) when I go to run a job in Easel it goes through all the setup steps like normal, but after it raises the bit, and I click the “Start Spindle” button, it only runs for a second or less, then stops, and the machine goes unresponsive. Reloading the Easel page will re-establish the connection to the machine, but the same thing happens every time.

I’ve tried a full unplug-and-walk-away-then-come-back-and-restart and it’s still doing the same thing.
Here’s a video of what I’m talking about:

If I go back through and disable automatic spindle control, when I try to run a job it raises the bit, I turn the spindle on, and hit “GO” and the software seems to work, but the machine does nothing. It then hangs again and needs to be refreshed.

HELP!!!

Can you fire up UGS and give it a $$ to get your grbl settings, then post them here? Did you enable hard limits by any chance?

Here’s my grbl config:

Grbl .9i

$0=10
$1=255
$2=0
$3=3
$4=0
$5=0
$6=0
$10=3
$11=0.050
$12=0.002
$13=0
$20=0
$21=1
$22=1
$23=3
$24=25.000
$25=750.000
$26=250
$27=1.000
$100=40.000
$101=40.000
$102=188.976
$110=8000.000
$111=8000.000
$112=500.000
$120=500.000
$121=500.000
$122=50.000
$130=290.000
$131=290.000
$132=100.000

It looks like $21 is set to yes for hard limits. That shouldn’t affect the spindle though should it? It would explain why grbl crashes when hitting the switches outside of easel though.

Also worth clarifying:
When I start the spindle manually, the spindle fires up and runs just fine, but the machine won’t move. In fact, starting the spindle with the switch (even with the logic unplugged) causes the machine to stop dead in its tracks.

Perhaps there’s a power supply thing going on? Seems like perhaps when the spindle cuts on it pulls more current than the grbl board can handle, and it shuts down. I don’t know, it’s just a thought.

If you have hard limits enabled, starting the spindle will cause enough interference on the limit switches lines to trigger a false positive, which is why it stops moving as soon as you turn the spindle on.

Hmm. You might be on to something. I did use shielded cable for the limit switches, but the exposed leads (on the Z axis where I broke the switch and am waiting for a replacement) might be causing something.

However, I’m not getting an error in UGS like I do when the switch trips like it’s supposed to.

I’ll try disabling the switches and see if that does anything.

Ok, I changed $21 to 0 and it seems to be cutting again!!!

Does this mean that I can’t use my limit switches?
Did GrblController over on my Raspberry Pi change this setting without me knowing?

You should consider the switches more like homing switches than limit switches. In order to get them to behave like limit switches, you’ll need to use shielded cable (it sounds like you’ve done that already), and you might need to add small capacitors as well, to help remove some of the noise.

homing switches are fine, that’s what I really wanted anyway. I had more than 10 hours on the machine before this happened, so I don’t know what changed, other than the Grbl configuration.

If that is the stock spindle it could be generating more and more noise as it wears out. Is this your original spindle? Mine generated a TON of electrical noise before it self-destructed. Just one more thing to check.

Yeah, it’s the original, stock spindle. It’s got about 10 hours of run time on it. I haven’t detected anything like noise or vibration that would otherwise indicate it’s on its last legs or in any other way defective.

It just seems odd to me. Disabling hard limits in the Grbl config worked, so I’m not complaining right now. and I did have the leads from one of the limit switches draped over the spindle, so it’s entirely plausible that the motor is causing electrical interference. But, I had run several jobs before then and had no problems. It wasn’t until I tried to use the machine with the Raspberry Pi that everything went pear shaped.

One more thought re Raspberry Pi:

Are you using other USB peripherals on the Raspberry Pi that could draw power? Your Raspi needs a good 5 volt power supply for reliability especially when it is driving usb devices or a shield with relays or power hungry peripherals (think 2 amps or more). I don’t use GRBL or the shields but I suspect the pins that the limit switches attach to are either pulled up or down in the normal state. If they are normally pulled down or set to LOW via the software, you could add a resistor between that pin (or those pins) and ground to reinforce it’s normal state (like a 10K ohm resistor). That should prevent it from floating due to power fluctuations and might do the trick. A 10uf capacitor and a .1uf capacitor, close to your input power between 5v+ and ground might smooth it out as well. If you are powering your Raspi from a USB port, it is probably only getting 500ma of power.

The power supply for the Pi I’m using puts out 5.5V @ 700mA. Not a ton, but more than is necessary for the Pi. I didn’t want to blow it up, so I was going by the instructions. I’m running a logitech wireless keyboard with it, but that’s it. I don’t think that’s pulling much power at all. I thought USB powered the Arduino but it looks like the main power supply is what drives the grbl shield as it comes on whether USB is connected or not.

At any rate, I was having the issue both with the Pi and with my Macbook Pro, but it started after trying to use Grbl Controller on the Pi. So I don’t know if the Pi changed something in Grbl’s config (I hadn’t checked it beforehand to know for sure if something changed.) My plan is to run the first-time-setup again in Easel and see if the problem returns. Then I’ll know that it’s something weird with the actual wiring and not with the config file.

Here is a link to Pi power requirements - note the increase in recommended power on B models: Raspberry Pi Documentation The wireless keyboard will draw incremental power as well. Is there a relay on the shield? That draws a lot of mamps when it fires.

Do you think powering your USB connections externally helps for that.

http://www.amazon.com/HDE-Compact-Powered-SuperSpeed-Adapter/dp/B00BMB0LN2/ref=sr_1_2?ie=UTF8&qid=1436095873&sr=8-2&keywords=external+powered+usb+hub.