Page 1 of 2

PWM Speed Control - Will it work with gshield?

Posted: Sun Oct 05, 2014 12:58 pm
by aeleus
I'm considering a 400W, brushless spindle that comes with "PWM speed control (Mach 3 control)".

I'm new to this, so I'm wondering does "PWM speed control" mean I can control the speed with the Arduino/gshield/universal gcode sender combination? Or, is this specific to a Mach 3 setup as the description seems to imply?

More detail from the description:
"You can input an external PWM signal to speed control. It requires external PWM level 3.5-12V VPP, frequency 1K-10KHZ, which is suitable for Mach3 spindle speed control."

Re: PWM Speed Control - Will it work with gshield?

Posted: Tue Oct 07, 2014 1:04 am
by aeleus
Here's a link to the electronic speed controller (ESC) that comes with the motor:

http://www.ebay.com/itm/New-BLDC-HX-WS4 ... 1409264751

It has a connection marked "PWM". It's probably a simple connection from the Arduino/gShield, but I'm new at this...

Re: PWM Speed Control - Will it work with gshield?

Posted: Tue Oct 14, 2014 2:17 pm
by CrazyBillybob
From what I understand the limiting factor in this is GRBL. The firmware that runs the Shapeoko. If you are running GRBL version 9 there is a PWM output for Spindle speed Please note that the hook up for Z limit has changed in V9. https://github.com/grbl/grbl/wiki/Connecting-Grbl
If you're running Version 8 there is no spindle PWM output.
If you plan on using the Easel software from inventablies you have to use version 8 at this time.
With that said the spindle controller that you linked to also has a potentiometer so that you can adjust the spindle speed without a software input. it can be used by both versions.

The spindle PWM output allows you to be able to set the spindle speed in side your program. This is normally used in machines that do auto tool changes as different mill bit profile require different speeds to cut properly. With the Shapeoko you're doing any tool changes manually so restarting the spindle and setting the proper speed for the new bit before restarting the program isn't that big of a deal.

By the way PWM= pulse width modulation. It is a way of controlling the speed (or brightness) of something by turning it on and off really fast. The more time that it's on the faster (or brighter) it is. (this is a very simple explanation of PWM but you should get the idea).

I hope that this rambling helps you out and that I fully answered your question.

CBB

Re: PWM Speed Control - Will it work with gshield?

Posted: Tue Oct 14, 2014 3:40 pm
by aeleus
Thanks CBB. That's very helpful.

While controlling RPM's via PWM is doable (and kinda cool), the trade-offs and complexity don't seem worth the effort. The potentiometer would be just fine if I can get an indication of what the RPM's actually are. In other words, I'd like to set different runs at specific RPM's and be able to do repeat that. That's what this solution provides: SuperPID (http://www.vhipe.com/product-private/SuperPID.htm).

So, can I use the potentiometer and somehow passively read the RPM's from the controller?

Re: PWM Speed Control - Will it work with gshield?

Posted: Tue Oct 14, 2014 3:55 pm
by ThatOtherGuy435
The only way to read the true RPM is to put a sensor on the spindle itself - that is how every closed loop controller (including SuperPID) does it.

Re: PWM Speed Control - Will it work with gshield?

Posted: Tue Oct 14, 2014 4:34 pm
by cvoinescu
What the SuperPID does is what you would do, if you had a RPM display and a potentiometer controlling the PWM factor: you'd watch the display, and keep a hand on the potentiometer, and adjust it up or down continuously to get the RPM display to match the value you want. This is "closed-loop control". When you have a simple controller with no feedback, where the potentiometer just sets the PWM factor and the controller has no idea about the actual RPM or load, that's "open-loop control".

So the SuperPID does not just provide a RPM readout. It actually implements closed-loop control based on that reading, which is a big difference. Without that, for a given potentiometer setting, the RPM would vary with load. Your goal of setting the RPM with the potentiometer (or the GRBL PWM output) is not possible with open-loop control.

Re: PWM Speed Control - Will it work with gshield?

Posted: Wed Oct 15, 2014 1:11 am
by aeleus
I see now that the SuperPID uses an optical sensor to "close the loop".

The description for the control motor that I ordered makes the following claim:
Closed-loop steady speed, when a large load speed of the motor can maintain
It's not the best English, but it's clear that it promises to adjust the power and maintain the RPM's automatically when under load.

That will certainly be one of the first things I test when it arrives.

Re: PWM Speed Control - Will it work with gshield?

Posted: Wed Oct 15, 2014 2:56 am
by CrazyBillybob
The motor controller that you linked to in the original post has an input for a Holzer sensor (also called a Hall effect Sensor) . This sensor changes state or voltage when in the presence of a magnetic field. there is a magnet mounted to the spindle and the sensor tells the controller how fast it's spinning. It is the feedback loop that makes the controller also a "Closed" loop controller. The down side is that you have to have a spindle that has the sensor in it or understand enough electronics to find/build a sensor setup that is compatible with the controller. But it doesn't have a display so your still guessing (you can mount the pot use a tachometer to mark common speed locations if you want to be spot on... just more expense for the tach)

If this is a must have item, your best bet is to order the spindle and controller from the same source, that way the are compatible.

I know that the super pid setup works with many different types of spindles and has many happy users here.(I don't have one... but I can see where it would be useful when running a machine for profit)

Re: PWM Speed Control - Will it work with gshield?

Posted: Wed Oct 15, 2014 1:50 pm
by ThatOtherGuy435
If you end up getting that brushless spindle and controller, I would be very curious if it is *actually* closed loop RPM control.

One common thing with brushless motors in radio control vehicles is the sensor is there exclusively to tell the controller where the rotor is relative to the coils, to reduce cogging when applying current. - this does NOT provide fixed-RPM closed loop, but it is technically closed loop control.

Re: PWM Speed Control - Will it work with gshield?

Posted: Wed Oct 15, 2014 1:50 pm
by aeleus
CrazyBillybob wrote:...your best bet is to order the spindle and controller from the same source, that way the are compatible
I did just that. This is the kit I purchased:
http://www.ebay.com/itm/251628160639?_t ... EBIDX%3AIT

From the description:
Speed/Current alike close loop technology, smooth rotation
There are some cryptic (to me anyways) instructions on how to set up various methods of speed control. I was hoping to somehow tap into that and get some sort of RPM reading. Maybe it's easier to just point a cheap optical sensor at the spindle (but then I have to connect to something to get a readout...). Or, not worry about RPM at all.

The goal is not necessarily to get precise RPM readings. The goal is to be able to repeat the process once I dial in the best combination of bit, material, feed rate, etc. The potentiometer for speed control seems a bit analog (i.e., inaccurate) when everything else is digital and precise. That is probably just my misconception and inexperience.

So that brings me back to "how do I connect the arduino/gshield to this motor controller to use PWM?" From the link, that CBB posted, I see that PWM speed control is provided by Grbl v0.9 on pin D11 with a range or 0V to 5V. The controller calls for "PWM signal control" of 3.5-12V Vpp. That doesn't seem like a match. The "VR" terminal on the controller (where the pot is connected) calls for an input of 0v - 5V. Can I use that? If so, would I just run a wire from D11 to VR?