The UCCNC when the spindle encoder A and B channels are configured then it automatically switches to measure the RPM always with the encoder A and B channels.
When only the encoder index is configured then it uses the encoder index for the measurement.
The loop is not closed, the PWM is output in open loop, the value is what is configured with the PWM min and max. and Spindle speed min and max. and the programmed RPM.
To close this loop there would be a need to add a PID control loop or at least a PI loop with the programmed RPM the input, the encoder the feedback and the PWM the output which is currently not implemented, but we have plans to add this function later.
And running in open loop is not a problem for the thread and tap cutting, because the feed is synced to spindle RPM, to the position of the spindle, so if the RPM drops then the feedrate is automatically adjusted,
so the thread pitch will be still perfect, because the encoder gives enough points, enough resolution to compensate quickly and this is why we don't support single index channel threading and tapping, because that would not give enough resolutions to keep the threads good if the RPM drops fast.