Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spindle speed (g-code Sxxxx) doesn't result in correct speed setting at GRBL output #19

Closed
deHarro opened this issue Mar 21, 2017 · 2 comments

Comments

@deHarro
Copy link
Contributor

deHarro commented Mar 21, 2017

GRBL can set the spindle speed by issuing a PWM signal at a given pin.
The hi/lo percentage of the PWM signal is controlled by the S command in terms of 10th percent.
This implies, that the command S1000 results in 100% PWM duty cycle.

If your spindle turns 24000 rpm max and you want to adjust the speed to 16000 you have to set the S parameter in the g code manually to something about 666. Not so catchy.

It would be fine to have a direct dependency of the value behind the S command and the spindle speed (S12600 should result in 12600 rpm).
So you should implement a means of setting the factor for the given spindle controller in form of maximum speed for 100% PWM and then calculate the correct percentage value for the S value.

Just an idea :-)

@martin2250
Copy link
Owner

grbl does that, see the docs:

$30 - Max spindle speed, RPM

This sets the spindle speed for the maximum 5V PWM pin output. Higher programmed spindle RPMs are accepted by Grbl but the PWM output will not exceed the max 5V. By default, Grbl linearly relates the max-min RPMs to 5V-0.02V PWM pin output in 255 increments. When the PWM pin reads 0V, this indicates spindle disabled. Note that there are additional configuration options are available in config.h to tweak how this operates.

$31 - Min spindle speed, RPM

This sets the spindle speed for the minimum 0.02V PWM pin output (0V is disabled). Lower RPM values are accepted by Grbl but the PWM output will not go below 0.02V, except when RPM is zero. If zero, the spindle is disabled and PWM output is 0V.

@deHarro
Copy link
Contributor Author

deHarro commented Mar 21, 2017

Oh, didn't notice that, thank you very much!

Harald

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants