Skip to content
Permalink
Browse files

Remove conflicting bool spindle_on

Bool `spindle_on` is initialized in `SpindleControl` and is shared
between `SpindleControl` and whichever control method (PWM, Modbus,
Huanyang, or Analog) is configured.

Initializing `spindle_on` in `PWMSpindleControl` as well clobbers the
shared variable and leads to `SpindleControl` and `PWMSpingleControl`
having different values for `spindle_on` and thus the spindle is never
actually turned on when sending M3 commands.

This can be confirmed via M957 which will always show that the current
PWM is 0, no matter what the current and target RPM.

Removing this superfluous initializion causes `spindle_on` from
`SpindleControl` to be shared as expeced and the module then works as
can be confirmed with M957 showing appropriate PWM values responding to
current and target RPM.
  • Loading branch information...
cilynx committed Nov 18, 2017
1 parent 126d6d6 commit 09c5297f5739bb9a902b850adf197fce8120696f
Showing with 0 additions and 1 deletion.
  1. +0 −1 src/modules/tools/spindle/PWMSpindleControl.h
@@ -35,7 +35,6 @@ class PWMSpindleControl: public SpindleControl {
bool vfd_spindle; // true if we have a VFD driven spindle

// Current values, updated at runtime
bool spindle_on;
float current_rpm;
float target_rpm;
float current_I_value;

0 comments on commit 09c5297

Please sign in to comment.
You can’t perform that action at this time.