Dear,
I have an incremental encoder connected to the robot. I want to activate a digital output until a given number of encoder pulses have been counted.
the output is actually a motor, the encoder measures the angle of rotation of the motor. In effect I want to rotate the motor a specific number of degrees and then stop.
(in speudo code) would it be something like:
target = angle_in_tick_count
b = get_conveyor_tick_count()
d = 0
set_output(“on”)
while d < target
c = get_conveyor_tick_count()
d = c-b
set_output(“off”)
This seems cumbersome, any suggestions for a better solution welcomed!
Regards,
Max