Enforce complete AXIS control inventory

This commit is contained in:
2026-09-07 15:48:49 +08:00
parent 0a679b5eeb
commit bc69c513e3
12 changed files with 261 additions and 54 deletions

View File

@@ -274,8 +274,8 @@ int sim_io_spindle_adjust(sim_io *io, uint32_t spindle, double delta) {
state = &io->state.spindles[spindle];
// Match LinuxCNC EMCMOT_SPINDLE_INCREASE/DECREASE: change the signed
// speed only while the spindle is running and keep its direction.
if (state->command_rpm > 0.0) target = state->command_rpm + delta;
else if (state->command_rpm < 0.0) target = state->command_rpm - delta;
if (state->command_rpm > 0.0) target = fmax(0.0, state->command_rpm + delta);
else if (state->command_rpm < 0.0) target = fmin(0.0, state->command_rpm - delta);
else target = 0.0;
target = fmax(-state->max_rpm, fmin(state->max_rpm, target));
state->command_rpm = state->enabled && !state->inhibit && !state->amp_fault ? target : 0.0;