6
\$\begingroup\$

I have 3 sensors that feed into a couple of comparators that determine whether to move the servo or not. I used to do the moving with a microcontroller but I need to free some pins badly so I'm trying to accomplish this without software.

The sensor circuit has two output pins that tell me whether to move clockwise or counter clockwise or stop. Take note that this is relative movement, so it doesn't know the current position of the servo. All it knows is whether it should move and in what direction, if further movement is not possible then it should just be ignored.

I thought I could accomplish this by using 555 timers, but I couldn't think of a solution! I reckon I could just use a stepper or an ordinary motor instead but they don't fit on the joint. Is there anyway to accomplish "relative" servo movement with just analog circuits (and without messing the innards of the servo)? Any suggestions?

\$\endgroup\$
10
\$\begingroup\$

I still would try to use a microcontroller, that's going to be the easiest solution. Do you plan to remove the sensor inputs and the servo output from the controller? That will give you 4 extra pins. Isn't there a device in the same microcontroller family with a few more pins?

Alternatively you could use a small separate microcontroller to handle the sensor data and servo. That will be more compact, cheaper and easier to control than solutions involving 555s and what mores.

\$\endgroup\$
7
\$\begingroup\$

I think this falls into what Horowitz and Hill might call "hybrid" and not necessarily analog, but here goes:

Let's say you have a PWM signal in to control the position of the servo (A), and a pot on the servo, used to control the Pulse width of a timer circuit (like a model aircraft servo) whose output is B.

You use simple XOR between the command pulse and output pulse to determine any error (A xor B). The output pulse will either be the same width (zero error), wider than, or narrower than the command pulse. Then, (A xor B) AND A and (A xor B) AND B will represent PWM signals for CW and CCW rotations that you can use for servo control --- invert the appropriate channel (in the analog sense, i.e., x -1 ), sum them (only one of those signals can be non-zero at a time), and use it as an error signal. Or, just use each channel directly to drive opposite legs of an H-bridge.

A few details left hanging, like matching the gains of the command PWM to the output PWM and such, but this is the general approach (with a cartoon for the pulse width setting on the 555-- you'll need a real timing circuit for a 555 in monostable mode w/ variable pulse width).

sketch

But I agree, a satellite ucontroller might be the fastest route. I think the analog/hybird approach has more panache! It certainly embeds at a very different level-- when you do this, your servo is just looking for a pulse-width in, and other than that stands alone. It might serve as a better "building block".

\$\endgroup\$
  • 2
    \$\begingroup\$ iPad art? :-) \$\endgroup\$ – stevenvh Sep 19 '12 at 22:08
  • \$\begingroup\$ very close! Asus tf201 Android pad. \$\endgroup\$ – Scott Seidman Sep 19 '12 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.