Let's Make Robots!

master-slave robotic arm

graph.pdf79.63 KB

in order to operate a PWM servo we have to give PWM to it.
PWM can be achieved by using timers or opamps or MCU, i don't know anything about programming, so i go with timers(easy way). opamps(difficult but perfect)
shaft rotation on a servo motor is limited to approximately 90 degrees (±45 degrees from the center position). A 1-ms pulse wil rotate the shaft all the way to the left while a 2-ms pulse will turn the shaft all the way to the right. By varying the pulse width between 1 and 2 ms, the servo motor shaft can be rotated to any rotational degree position within its range.
servo motor circuit isn’t at all difficult, i used  556 dual timer to control a servo motor. The 556
has two independent timers. One timer is configured in astable mode. The astable timer outputs a 50Hz square wave(RC network) with a 1ms-2ms negative. The output from the timer1 is connected to the timer2 that is configured in monostable mode.    monostable timer(timer2) outputs a positive pulse, each time it receives a negative pulse from timer1. The positive pulse from timer2 can be varied from 1 to 2 ms using  potentiometer(master)
here is the picture  of  servo control circuit(ne556)
and power supply circuit
anyway it looks ugly. so far it is working good...
AVR version:
this time i  learned a little bit of programming to implement the same project in AVR version.
and i used AVR microcontroller(ATmega48)
to generate PWM from uC.
configure the TCCR(timer or counter control register) in Fast PWM mode
servo frequency is 50Hz(if 20ms pulse travelling Ton 1-2ms), CPU frequency 1MHz (by defualt) factory fuse settings
 servo_frequency = CPU frequency/(N(1+top))
            50    = 1MHz/(N(1+top))
             N    = 1 (timer prescaling bit CS)
    therefore top = 19999  (ICR input cature register)
   draw a graph to find pulse width.

  time on x axis (in ms)
  ICR on Y axis to find OCR
  mark a point (18,18000)
  OCR = 18000,  means Ton = 2ms and Toff = 18ms (servo angle 180degrees)
  for master:
  ADC conversion, include converted ADC value in OCR(math) to sync master and slave positons.
some pic's

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

changed the fuse bits for  external oscillator.

I really like this project.  It shows a lot of creativity and different ways of doing things.  The 555 / 556 way of controlling servos can be very useful.  Are you going to post the new AVR version as well?  It would really be good to see them side by side for comparison.

The movement on the arm and gripper is very smooth.  Nice. work.

yes i will post AVR version too.. just received servos and claw today.

thank you sir.


The gripper follows the input movement very nicely.

Good job.

thanks dan M


i almost did this for a robot arm contest i entered... had it all soldered up but never got around to programming it so i used my debuging board (5 pots and one switch in a row)


Oh... how I like this arm. Looks like you use two potentiometers inside the teacher-arm to apply the actual values to the robotic arm. Nice work - but poor documentation.

   thank u.......for your comment... i've used 3potentiometers. (3dof.)

nice smooth movement.  could you put some detail about your project up as well please :)