for controlling one motor used for different sequential operations