GRBL 0.9i Spindle Issue

Discussion about the arduino based g-code interpreter, grbl
BArnold
Posts: 72
Joined: Tue Feb 17, 2015 9:28 pm
Location: Thomasville, GA

GRBL 0.9i Spindle Issue

Post by BArnold » Sat Mar 28, 2015 7:37 pm

I updated my Shapeoko 2 Arduino Uno to grbl 0.9i yesterday. I did some testing and really like the rapid jog time now. When I started an engrave job I had run previously, the spindle did not start as it had before. I moved the spindle relay line from pin 12 to pin 11 as instructed when I did the update. I tried sending M3 and M5 manually and nothing happened. Then, I found that I should move the spindle control to pin 13 if I just want ON/OFF control. Now, M5 does nothing, M4 turns the spindle on and M3 turns it off. What have I missed?
ShapeOko2 with Custom 660mm Y-axis, 1500mm X-axis, ArduinoUno/gShield/grbl 0.9j
Two NEMA 23 on X-axis, one NEMA 23 on Y-axis, NEMA 23/belt drive on Z-axis
DeWalt DWP611 Router
VCarve Desktop, UGS, SketchUp, PhotoVCarve

chamnit
Posts: 376
Joined: Tue Aug 12, 2014 2:16 pm
Location: Albuquerque NM, USA
Contact:

Re: GRBL 0.9i Spindle Issue

Post by chamnit » Sat Mar 28, 2015 8:36 pm

Grbl is has the spindle speed PWM enabled by default. It operates different from the old simple enable/disable spindle pin. If you need to revert it, just comment the VARIABLE_SPINDLE define in the config.h and re-compile and upload.

Pin D13 is still spindle direction by default. You can turn this into spindle enable and keep the spindle speed PWM on D11, if you enable that configure option in config.h.

BArnold
Posts: 72
Joined: Tue Feb 17, 2015 9:28 pm
Location: Thomasville, GA

Re: GRBL 0.9i Spindle Issue

Post by BArnold » Sun Mar 29, 2015 1:01 am

Thank you, chamnit.

I've looked at the code and understand what I need to do now. I'll have a go at it and let you guys know what happens.
ShapeOko2 with Custom 660mm Y-axis, 1500mm X-axis, ArduinoUno/gShield/grbl 0.9j
Two NEMA 23 on X-axis, one NEMA 23 on Y-axis, NEMA 23/belt drive on Z-axis
DeWalt DWP611 Router
VCarve Desktop, UGS, SketchUp, PhotoVCarve

BArnold
Posts: 72
Joined: Tue Feb 17, 2015 9:28 pm
Location: Thomasville, GA

Re: GRBL 0.9i Spindle Issue

Post by BArnold » Sun Mar 29, 2015 3:17 pm

Another question before I update my Arduino: When I did the update a couple of days ago, I downloaded the Shapeoko2 hex file from github. When I re-compile the code to make the adjustment to the spindle control, what else do I need to look for?
ShapeOko2 with Custom 660mm Y-axis, 1500mm X-axis, ArduinoUno/gShield/grbl 0.9j
Two NEMA 23 on X-axis, one NEMA 23 on Y-axis, NEMA 23/belt drive on Z-axis
DeWalt DWP611 Router
VCarve Desktop, UGS, SketchUp, PhotoVCarve

BArnold
Posts: 72
Joined: Tue Feb 17, 2015 9:28 pm
Location: Thomasville, GA

Re: GRBL 0.9i Spindle Issue

Post by BArnold » Thu Apr 02, 2015 5:24 pm

I was out of town for a few days and got back into my shop this morning.

When I started through the steps to fix the spindle on/off, I found that commenting the VARIABLE_SPINDLE define in config.h didn't have the desired effect. I still didn't have proper spindle control regardless of whether I used pin 11 or 13. Uncommenting USE_SPINDLE_DIR_AS_ENABLE_PIN and VARIABLE_SPINDLE gives me spindle on/off on pin 13.

Thanks for your guidance!
ShapeOko2 with Custom 660mm Y-axis, 1500mm X-axis, ArduinoUno/gShield/grbl 0.9j
Two NEMA 23 on X-axis, one NEMA 23 on Y-axis, NEMA 23/belt drive on Z-axis
DeWalt DWP611 Router
VCarve Desktop, UGS, SketchUp, PhotoVCarve

chamnit
Posts: 376
Joined: Tue Aug 12, 2014 2:16 pm
Location: Albuquerque NM, USA
Contact:

Re: GRBL 0.9i Spindle Issue

Post by chamnit » Thu Apr 02, 2015 5:59 pm

Disabling VARIABLE_SPINDLE will revert Grbl to the old pin layout, where spindle enable is on D12 and direction on D13. With it enabled, spindle enable/PWM is on D11 and direction on D13.

EDIT: Here's a chart to make it a bit clearer.

VARIABLE_SPINDLE enabled:
D11 = Spindle enable/PWM speed
D12 = Z-limit
D13 = Spindle direction

VARIABLE_SPINDLE disabled:
D11 = Z-limit
D12 = Spindle enable (on/off only)
D13 = Spindle direction

VARIABLE_SPINDLE and USE_SPINDLE_DIR_AS_ENABLE_PIN both enabled:
D11 = Spindle PWM speed only
D12 = Z-limit
D13 = Spindle enable (on/off only)

Hope that helps.

BArnold
Posts: 72
Joined: Tue Feb 17, 2015 9:28 pm
Location: Thomasville, GA

Re: GRBL 0.9i Spindle Issue

Post by BArnold » Thu Apr 02, 2015 7:55 pm

Thanks, chamnit. If my explanation wasn't clear, what I ended up doing is what you have in your chart as option 3.
ShapeOko2 with Custom 660mm Y-axis, 1500mm X-axis, ArduinoUno/gShield/grbl 0.9j
Two NEMA 23 on X-axis, one NEMA 23 on Y-axis, NEMA 23/belt drive on Z-axis
DeWalt DWP611 Router
VCarve Desktop, UGS, SketchUp, PhotoVCarve

HPGreyling
Posts: 123
Joined: Sat Nov 15, 2014 11:37 am
Location: South Africa

Re: GRBL 0.9i Spindle Issue

Post by HPGreyling » Sun Oct 18, 2015 5:50 pm

How do I perform these action s as I would like to effect option 3 of Chamnit explanation.

How does 1 re-compile this file?

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

Re: GRBL 0.9i Spindle Issue

Post by cvoinescu » Mon Oct 19, 2015 7:09 pm

Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

veng1
Posts: 250
Joined: Fri Nov 30, 2012 12:09 pm

Re: GRBL 0.9i Spindle Issue

Post by veng1 » Mon Oct 19, 2015 8:44 pm

If you'd really like to be on the bleeding edge of technology, you could try to compile it with Platformio. The (maybe) advantage is that it uses an actual linker and only includes the parts of the libraries that are used. This may free up some memory for other things but only if there is any fluff in the binary. There may not be.

Typically one gets 7-10% smaller hex files from what I read. Presently, I'm not code space limited on anything right now so I haven't actually tried it. At last reading, it didn't work for Win yet but one of the developers was in the process of fixing that. Mac and linux apparently are working now.

And it's command line driven, no GUI yet although a simple .Net wrapper should be fairly easy when the Win version is working I suspect.

This is a good place to get an idea of what is going on as the web site is a little opaque:

http://www.printrbottalk.com/forum/view ... 22&t=10160

Post Reply