im trying to orient and stop a slowly rotating spindle. (no brake)
the spindle has 1 index pulse sensor only.
im ramping up the pwm until the spindle just turns and the index signal is seen.
ramping up a #var with analogue out attatched to it to drive the spindle.
my question- re coding. what would be the best way
would a while loop- looking for the spindle pulse work faster than
an if loop. (as the if loop will only trigger if the index pulse is active at the precise timing of the if being called)
i have also tried running a macroloop- just running an if - setting a #var to 1 as soon as the index pulse is seen. (so its latched on once seen)
checking this #var in my orient spindle code- and if 1 killing the pwm back to zero.
im still getting rotation way past the sensor.
suggestions as to fastest way please.