Building a simple servo control

Thread Starter

mmtrigger

Joined Dec 14, 2008
5
I'm trying to design a circuit that drives a pair of servo motors. Basically what I want it to do is to take two push button inputs and hold a servo in a fixed position while one of the buttons button is pressed, and return to the neutral position when released. Each button would drive one of the servos. I'm trying to keep it simple and light, as it will be carried/worn as part of an animated costume for a production.

I've seen a myriad of methods for servo control. I do have assembly coding experience, but have never worked with PICs or other microcontroller chips (only coded for Motorola 68HC11 and Intel 8086). So for someone who is basically starting from scratch, how to I get going on something like this?
 

jpanhalt

Joined Jan 18, 2008
11,087
It can be done with a PIC or other microcontroller. Or, it can be done with a couple of 555 chips. The micro circuit would have fewer components.

Which one do you prefer?

John
 

jpanhalt

Joined Jan 18, 2008
11,087
Hi Bill,

There are dozens of circuits on the web. Search on "RC servo 555" to convince yourself. Most of the circuits use a single 555 chip and control the duty cycle. Basically, the 555 operates at 50 Hz with a low duty cycle, which is often obtained using the diode bypass method.

The first servo tester I had was a commercial unit made by KMI (don't know if it is still available). It was based on a 555 too. I have not bothered to reverse engineer it.

The problem with 555-based controllers is jitter with some high-end servos, namely the digital servos. I have not had that problem with a 16F628 PIC controller.

My concept for the OP was to use two fixed resistors for the two positions. The button switch would determine which resistor was in circuit (e.g., the two resistors in parallel with the spst switch controlling one).

Here are some typical links:

http://wolfstone.halloweenhost.com/Motors/svoint_RCServos.html#Driving
http://hades.mech.northwestern.edu/wiki/index.php/555_Servo_Circuit
http://funwithelectronics.com/servo.php
http://members.tripod.com/Sarconastic/servodriver.html

And finally, someone built a servo controller using two 555's, which is referenced in the first link and shown here:




John
 

Thread Starter

mmtrigger

Joined Dec 14, 2008
5
To keep the component count low, I would rather go with a microcontroller solution (besides I've already got embedded programming down pretty well). I know I will have to pick up a programmer, but how I figure out what chip would be best suited to this application?
 

beenthere

Joined Apr 20, 2004
15,819
Determine the inputs and outputs, plus any built-in interfaces the microcontoller needs and go looking. Both PIC and AVR devices may suit your needs.
 

jpanhalt

Joined Jan 18, 2008
11,087
As for which chip, what little experience I have is with Microchip products. All you need is 2 outputs and 2 inputs, so an 8-pin variety will work. You may also want ICSP capability. The 12F series (e.g., 12F509A) is easy (8-pin) as is the 16F series. You may find more sample code, if it matters, for the 16F628A chip.

John

John
 

Thread Starter

mmtrigger

Joined Dec 14, 2008
5
Honestly I feel a little overwhelmed. I just finished some embedded programming courses at my university, so I more or less know how to write code. I have never worked with controlling analog devices (like outputting the necessary control signal for a servo), or even trying to find an appropriate microcontroler for a specific application. I see there are many options from both PIC and AVR for me to choose from. Although I'm pretty sure I know what inputs and outputs I need, I still feel a little lost.

I'm going to continue searching for some info to help me get started. There's probably guides out there for this king of thing, but if anyone here can point me in the right dierction, it would be much appreciated. Thanks!
 

Thread Starter

mmtrigger

Joined Dec 14, 2008
5
Ah, didn't see your post before mine. I'll take a look at the 16F628A like you suggested. I'm discovering that this is going to be a large project for me, but I'm determined to learn :)
 

Thread Starter

mmtrigger

Joined Dec 14, 2008
5
Thanks for all the info everyone. I'm waiting for some equipment to come in so I can start on this project, specifically the programmer and servos. Hopefully I'll be able to put some of my CpE courses to good use. Thanks again all, and happy holidays!
 
Top