I am trying to set up a servo controller that will automatically make the servo switch direction when it nears the end of its travel range.
I designed a solution that uses a quad comparator and a peak detector to produce a useful control signal. The circuit has one signal input and two outputs that control a signal to an H-bridge driver. As the voltage across the potentiometer approaches 5V, the first output is high and the second is low. As the voltage approaches 0V the first output is low and the second output is high. The signal flips when the voltage gets close to 5V and again near 0V. It works, but there are some drawbacks.
Is there a standard analog approach or IC that performs the same operation while using a potentiometer for the signal source?