Servo Motion Direction

automationservo

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?

Best Answer

The standard answer is to use a microcontroller to read the pot and make the decisions.

You don't say what the drawbacks of the current circuit are. A comparator with some positive feedback or hysteresis, and an inverter, will do the trick, but likely it sounds awful when reversing, and takes a huge spike of current.

The micro will be able to drive the H-bridge with some sort of PWM, and thus gently slow the motor down and reverse it again. You will define a voltage profile in software, or even make your own PD control loop and have the servo follow an internally generated position profile.

With some programming experience, the learning curve with an Arduino will be short. And if you need to produce several of them, you could use a small 8-pin microcontroller with internal clock, not very expensive.