Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: razvanc_roro on May 08, 2007, 01:14:33 PM

Title: 50$ robot> servo modify
Post by: razvanc_roro on May 08, 2007, 01:14:33 PM
I'm a novice in programming the microcontroller and I found out that the servos are being modified by this... How do I send the signal to sorvo to make 0 degrees on the gears?
Also I want to ask you if I could make this after building the whole robot and turning it on.

Thank you!
Title: Re: 50$ robot> servo modify
Post by: hazzer123 on May 08, 2007, 01:21:53 PM
It depends which microcontroller.

You will need to make a delay of about 500 uS.

Then you turn on the signal pin for the servo --> call the delay --> turn off the signal pin

Repeat this a couple of dozen times a second.

For different angles, you could great a 8uS delay and loop it a number of times. This would be added onto the 500uS delay.

Using 8uS means you have the range of 0.5 - 2.5 mS in 256 steps.

Harry
Title: Re: 50$ robot> servo modify
Post by: ed1380 on May 08, 2007, 01:59:02 PM
 or use 35 cpu cycles. 20-50 control angle.
Title: Re: 50$ robot> servo modify
Post by: hazzer123 on May 08, 2007, 02:01:24 PM
Won't the length of the cpu cycle differ between microcontrollers?
Title: Re: 50$ robot> servo modify
Post by: ed1380 on May 08, 2007, 02:07:33 PM
if you use the same mcu it won't
Title: Re: 50$ robot> servo modify
Post by: hazzer123 on May 08, 2007, 02:27:24 PM
oh yeh haha  8)
Didnt realise it was the $50 robot.