Building a simple servo control

Discussion in 'The Projects Forum' started by mmtrigger, Dec 14, 2008.

  1. mmtrigger

    Thread Starter New Member

    Dec 14, 2008
    5
    0
    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?
     
  2. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,696
    904
    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
     
  3. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    I'd be interested in the 555 version.
     
  4. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,696
    904
    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:

    [​IMG]


    John
     
    5416339 likes this.
  5. mmtrigger

    Thread Starter New Member

    Dec 14, 2008
    5
    0
    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?
     
  6. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    If you choose to go with ATMEL's AVR, you can get the Assembly Language development software FREE.

    hgmjr
     
  8. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,696
    904
    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
     
  9. mmtrigger

    Thread Starter New Member

    Dec 14, 2008
    5
    0
    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!
     
  10. mmtrigger

    Thread Starter New Member

    Dec 14, 2008
    5
    0
    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 :)
     
  11. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    The ATTINY2313 an AVR device that you can compare with the 16F628A just to get a feel for the differences.

    hgmjr
     
  12. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,696
    904
  13. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Here is a link to the FREE software development tools for assembly language. The newest version is AVRSTUDIO 4.15.

    Enjoy,
    hgmjr
     
  14. mmtrigger

    Thread Starter New Member

    Dec 14, 2008
    5
    0
    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!
     
Loading...