Grbl / SuperPID / Shapeoko 3

Discussion about the arduino based g-code interpreter, grbl
twforeman
Posts: 1351
Joined: Tue Jan 29, 2013 4:51 pm
Location: Minneapolis, MN
Contact:

Grbl / SuperPID / Shapeoko 3

Post by twforeman » Sat Apr 02, 2016 9:37 pm

I have managed to get my SuperPID working with my Shapeoko 3 after some cussing, compiling and RTFMing.

There are a few changes in config.h that you need to make on the stock Grbl v0.9 code branch to get the SuperPID working.

I'm going to list them here just for funzies. These are all changes from the default config.h file.

Code: Select all

Change
#define DEFAULTS_GENERIC
to
#define DEFAULTS_SHAPEOKO_3

Uncomment
#define INVERT_SPINDLE_ENABLE_PIN

Set the max/min spindle speed here 
#define SPINDLE_MAX_RPM 30000.0
#define SPINDLE_MIN_RPM 0.0

Uncomment
#define USE_SPINDLE_DIR_AS_ENABLE_PIN
INVERT_SPINDLE_ENABLE_PIN was the one that bit me. I couldn't figure out for the longest time why the SuperPID was starting the spindle when the enable pin was at zero volts. Then I finally read the SuperPID doco again and realized that it turns on the spindle at 0 volts and turns it off at 5 volts! So you have to invert the enable signal in Grbl. This seems backwards to me since it fails to the on setting. If the enable wire gets disconnected or broken the spindle will start.

If you made it this far, I have a problem that I hope someone has the solution to.

I set the SPINDLE_MIN_RPM to 5000 and SPINDLE_MAX_RPM to 30000. If I send S5000 then I get 5000 RPM on the spindle. If I send S30000 then I get 30000 RPM. But the low end of the range is not right. It won't increase the spindle speed above 5000 until I send S10000, and then the spindle runs at 6070 RPM.

Should I be setting MIN/MAX differently? Or is the Grbl controller sending voltage and not PWM? Should I wire it like it's sending a voltage level? Maybe I'll try that and see...

Edited: MIN should be Zero and works as advertised. See later posts.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

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

Re: Grbl / SuperPID / Shapeoko 3

Post by twforeman » Sat Apr 02, 2016 10:37 pm

I tried hooking up to the POT pin instead of the PWM pin on the SuperPID and it had pretty much the same effect...
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

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

Re: Grbl / SuperPID / Shapeoko 3

Post by twforeman » Sat Apr 02, 2016 10:41 pm

Ah. RTFM again...

The SuperPID doco says:
Super-PID calibration needs the max PWM (100%) to correspond with 30000 RPM, and the minimum PWM (0%) corresponds with 0 RPM.
So... Guess I'll go change MIN to 0 and see if that works.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

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

Re: Grbl / SuperPID / Shapeoko 3

Post by twforeman » Sat Apr 02, 2016 10:56 pm

Yes, indeed, it comes down to RTFM.

Setting MIN to 0 works just right. So, no problems and I have my SuperPID working now.

I'll update the original post with the MIN value for the next person.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

felice2
Posts: 8
Joined: Tue Aug 18, 2015 5:49 pm

Re: Grbl / SuperPID / Shapeoko 3

Post by felice2 » Tue Apr 26, 2016 3:17 am

Before I purchase the Superpid I wanted to check if the version you installed was the one optimized for the PC? I previously purchased and installed your limit switch kit on my Shapeoko 3 which is working perfectly so I trust your experience with the Shapeoko . I am waiting for my XXL upgrade kit to ship and want to install the Superpid at the same time I do the upgrade. If you have your experienced blogged with installing the Superpid I would appreciate a link so I could use it as a guide. Per your suggestion I have been reading the manual on Superpid but sometimes find the Shapeoko manual harder to read as it relates to the Superpid. I am also using BCNC.

CastIrony
Posts: 650
Joined: Mon Jul 21, 2014 10:21 pm
Location: Portland, OR

Re: Grbl / SuperPID / Shapeoko 3

Post by CastIrony » Tue Apr 26, 2016 4:08 am

felice2 wrote:Before I purchase the Superpid I wanted to check if the version you installed was the one optimized for the PC?
Yep, that's the one I have. It's still easy to control the speed with a potentiometer knob even on the linear (PC) setting, and if I ever want to switch it to logarithmic it's a pretty simple solder jumper on the back.
Shapeoko 3 #192 - Complete! Needs limit switches.

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

Re: Grbl / SuperPID / Shapeoko 3

Post by twforeman » Tue Apr 26, 2016 12:53 pm

Yes, I bought the PC version, but as CastIrony points out it's simple enough to solder the jumper if you want to change it over.

The only think I don't like about the SuperPID is that it treats the on-off signal backwards. It want's +5V to turn the motor off - which is not fail-safe.

This means that when you turn on the Shapeoko the SuperPID it will spin up the spindle a couple times until the Shapeoko controller is finished booting. Which I think is an unsafe practice.

Other than that it's working great.

I didn't make a blog post about hooking up the SuperPID. Pretty much you just need to read the instructions. All the "gotchas" that I ran into are in this forum thread.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

CastIrony
Posts: 650
Joined: Mon Jul 21, 2014 10:21 pm
Location: Portland, OR

Re: Grbl / SuperPID / Shapeoko 3

Post by CastIrony » Tue Apr 26, 2016 5:52 pm

This is actually one of the things that's preventing me from going full grbl-controlled spindle: the possibility that the spindle could just decide to start up while I'm changing bits.
Shapeoko 3 #192 - Complete! Needs limit switches.

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

Re: Grbl / SuperPID / Shapeoko 3

Post by twforeman » Tue Apr 26, 2016 6:10 pm

CastIrony wrote:This is actually one of the things that's preventing me from going full grbl-controlled spindle: the possibility that the spindle could just decide to start up while I'm changing bits.
Well, that's pretty unlikely. But it can't hurt to turn off the power switch at the router when changing bits (assuming you are using a router) or add a switch to the control the spindle power outside of the SuperPID.

I plan on having an On-Off-Auto switch for my router that will directly control the 110V line. Though it will have to have multiple poles so that I can also enable the potentiometer speed control in "On" mode.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

felice2
Posts: 8
Joined: Tue Aug 18, 2015 5:49 pm

Re: Grbl / SuperPID / Shapeoko 3

Post by felice2 » Wed Apr 27, 2016 3:39 am

Thanks. Just submitted my order.

Post Reply