Society of Robots - Robot Forum

Mechanics and Construction => Mechanics and Construction => Topic started by: RedGolf on September 18, 2011, 01:58:29 PM

Title: Issue modifying servo
Post by: RedGolf on September 18, 2011, 01:58:29 PM
I recently bought some HS-311 Hitec Servos. I am trying to modify them, but when I use my microcontroller to tell it to go to 0, all I hear is clicking. I have tried other pulses also, and it still gives me the same clicking. I have tried multiple servos, and they all do the same thing. Can anyone help me with my problem?

Here is the code (modified from $50 robot)
Code: [Select]
int main(void)
{

configure_ports(); // configure which ports are analog, digital, etc.
a2dInit(); // initialize analog to digital converter (ADC)
a2dSetPrescaler(ADC_PRESCALE_DIV32); // configure ADC scaling
a2dSetReference(ADC_REFERENCE_AVCC); // configure ADC reference voltage



while(1)
{

servo_left(35);

delay_cycles(500);//a small delay to prevent crazy oscillations
}
/*********ADD YOUR CODE ABOVE THIS LINE **********/

return 0;
}

Should I build the microcontroller first and then modify the servos?
Title: Re: Issue modifying servo
Post by: Soeren on September 18, 2011, 06:01:09 PM
Hi,

I recently bought some HS-311 Hitec Servos. I am trying to modify them, but when I use my microcontroller to tell it to go to 0, all I hear is clicking. I have tried other pulses also, and it still gives me the same clicking. I have tried multiple servos, and they all do the same thing. Can anyone help me with my problem?

Here is the code (modified from $50 robot)
Sorry, but this subset of a program tells me less than nothing
Where does the clicking come from (the servo or somewhere else)?
How fast is the clicking?
What happens if the servo only gets the supply (positive and negative battery voltage) and the servo signal wire is disconnected?
Does it happen on unmodified servos (that you have never opened)?


Should I build the microcontroller first and then modify the servos?
Either that, or find some other means of generating a 1.5ms positive pulse every 20ms.
If you have an oscilloscope (or access to same), check whatever you use to generate this pattern.