Skip to content

Commit ef5947d

Browse files
committed
orient: Commit 79c0966 had an un-noticed effect on the behaviour of M19
reported in #3389 Prior to the change M19 would turn spindle-on to "off". After it remains on with speed=0. This commot adds an explicit spindle-off to the M19 behaviour.
1 parent dc46b17 commit ef5947d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/emc/motion/command.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,11 @@ void emcmotCommandHandler_locked(void *arg, long servo_period)
16931693
// so far like spindle stop, except opening brake
16941694
emcmotStatus->spindle_status[n].brake = 0; // open brake
16951695

1696+
// https://github.com/LinuxCNC/linuxcnc/issues/3389
1697+
emcmotStatus->spindle_status[n].state = 0;
1698+
*(emcmot_hal_data->spindle[n].spindle_on) = 0;
1699+
// https://github.com/LinuxCNC/linuxcnc/issues/3389
1700+
16961701
*(emcmot_hal_data->spindle[n].spindle_orient_angle) = emcmotCommand->orientation;
16971702
*(emcmot_hal_data->spindle[n].spindle_orient_mode) = emcmotCommand->mode;
16981703
*(emcmot_hal_data->spindle[n].spindle_locked) = 0;

src/emc/motion/motion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ extern "C" {
255255
int probe_home_err_inhibit; // setting to inhibit probe tripped while homeing error.
256256
EmcPose tool_offset; /* TLO */
257257
double orientation; /* angle for spindle orient */
258-
int state; /*spindle state*/
258+
int state; /*spindle state seems to just be 0 for off and 1 for on andypugh 2025-04-03*/
259259
char direction; /* CANON_DIRECTION flag for spindle orient */
260260
double timeout; /* of wait for spindle orient to complete */
261261
unsigned char wait_for_spindle_at_speed; // EMCMOT_SPINDLE_ON now carries this, for next feed move

0 commit comments

Comments
 (0)