-
Notifications
You must be signed in to change notification settings - Fork 123
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
rename 'zAxisAuto' to 'spindleAutomate' #635
rename 'zAxisAuto' to 'spindleAutomate' #635
Conversation
PR MaslowCNC#458 added a setting to enable/disable spindle control. The setting was named 'zAxisAuto' which seems confusing as it is being used as an on/off control for spindle power. Change the name to 'spindleAutomation' to better reflect its use. Note that the change in GC will match an accompanying PR in Firmware.
On further thought, this setting chooses between 'on/off' and 'servo-control' modes. Is there a better name than 'spindleAutomate' to convey this? |
the setting chooses between external servo control (the default) and external relay control.
@@ -215,8 +215,8 @@ | |||
{ | |||
"type": "bool", | |||
"title": "Spindle Automation", | |||
"desc": "Should the spindle start and stop automatically based on gcode? Leave off for default stepper control.", | |||
"key": "zAxisAuto", | |||
"desc": "How should the spindle start and stop automatically based on gcode? Leave off for default external servo control, on for external relay control.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still feel like I wouldn't understand...or maybe I am just thinking the setting does something different.
The options are off -> The pin toggles digitally high/low to control a relay
or on -> The pin is a PWM to set speed
...is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's backwards... if the setting is off (the default) AUX1 has a servo signal that is controlled by Mx codes. If the setting is on, the output is LOW or HIGH as would be used to drive an external relay. Maybe 'auxServoRelay'?
Servo control is different from PWM. Servos, as used here, are motor/gearchain/crank devices that are driven to specific positions of the crank. While the signal is a controlled pulse width, the width of the pulse represents an angle instead of a speed. A 1.5mS pulse will put the servo at its 'neutral' angle, the middle of its range. Varying the pulse width up or down by 1mS will turn the output by 90 degrees in either direction. Removing the signal leaves the output at its present location for some of the simpler examples. That is the way this servo signal is configured, a brief drive to one of the active positions (0 or 180 degrees) followed by a brief 'return to center' pulse train.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woah, thanks for the explanation...that is way different than what I would have expected.
I like that we have the servo option, but I'm not sure it should be the default...I vote for just regular on off to be the default...but that's not about this PR 😀
Now that I understand what we're doing 🙄 I think this looks great! I'm glad that text is clarified. |
We really need a tristate, not a bool here anyway
on/off and servo are actually not what I would expect to be the most common. I
would expect a raw PWM output to be the most common.
so change this from being a boolean and start enumerating the different values
and what they do (who knows, some people may need this to be a digial
communications mode to talk to a speed controller
|
Unfortunately PWM isn't available on any PowerControl board AUX pins. These two options satisfy all the currently available output control options. |
servo control is PWM, so if it can control a servo position, it can control a
motor speed via PWM
|
Yes, anything’s possible with software 😉. In practice, though, the Servo library is doing bit-bang PWM at 50Hz. Would that be suitable for laser power control? |
On Sat, 17 Feb 2018, Scott Smith wrote:
Yes, anything’s possible with software 😉. In practice, though, the Servo library is doing bit-bang PWM at 50Hz. Would that be suitable for laser power control?
itshould be good enough for cutting (lowish speeds, consistant power), but
probably not great for trying to etch (high speeds, rapidlyvarying power)
but even if you aren't controlling a laser, people will want to control the
speed of their router
|
The Servo library pretty much limits the PWM to 50Hz ranging from 2.7% to 12% duty cycle, the standard servo signal range. So long as the PWM control for laser power or router speed can live within those limits... |
I think the 2.7% to 12% duty cycle is going to be an issue for a laser, but there is no reason we couldn't add an option using the digitalWrite() function which would give us 0%-100% duty cycle options |
I don't see how that would work, unless someone also wrote a bit-bang PWM routine to run on a timer. We're already running into situations where PID calculations don't finish in time before the next timer call, I would hesitate to add more time critical overhead like this. |
You are right, I had it in my head that analogWrite() would handle the bit-banging behind the scenes (which would probably still have been too slow), but from the docs:
|
PR #458 added a setting to enable/disable spindle control. The setting was named 'zAxisAuto' which seems confusing as it is being used as an on/off control for spindle power. Change the name to 'spindleAutomation' to better reflect its use. Note that the change in GC will match an accompanying PR in Firmware.
This accompanies Firmware PR #392