Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

PLEASE Help with SERVO motor : NOT WORKING !!

Status
Not open for further replies.

nikhilsigma

Full Member level 2
Joined
Jun 19, 2010
Messages
139
Helped
17
Reputation
34
Reaction score
16
Trophy points
1,298
Location
Delhi, India
Activity points
2,559
Guy i am trying to make my servo RKI-1210 work, but it's NOT working......

i am sending control pulses at 50Hz i.e. a pulse every 20ms...
the pulse widths are as follows :
-90degrees : 1.5ms
normal position : 2ms
+90degrees : 2.4ms

i get these from others discussions on internet, and thus NOT sure that these are right or not !! :-(


here is the code i am using for ATmega32



#include <avr/io.h>
#define F_CPU 1000000UL // 1MHz
#include <util/delay.h>


int main(void)
{
DDRB=0xFF;
PORTB=0xFF;
int i,j,k;
while(1)
{


for(i=0; i<1000; i++) // for -90degrees, pulse of 1.5ms pulse
{
PORTB=0xFF;
_delay_us(1500);
PORTB=0;
_delay_us(18500);
}


for(j=0; j<1000; j++) // for normal position, 2ms pulse
{
PORTB=0xFF;
_delay_us(2000);
PORTB=0;
_delay_us(18000);
}


for(k=0; k<2000; k++) // for +90 degrees, 2.4ms pulse
{
PORTB=0xFF;
_delay_us(2400);
PORTB=0;
_delay_ms(17600);
}
}
}



and the motor has not moved even 1degree !! he he.... :-(
PLEASE HELP !!


Hardware connection :
RED Wire : 5V
Brown Wire : Ground
Orange wire : PORTB.4 of atmega32


PLEASE HELP !!
 

kak111

Advanced Member level 4
Joined
Mar 30, 2011
Messages
1,366
Helped
933
Reputation
1,868
Reaction score
907
Trophy points
1,413
Location
Finland
Activity points
10,942
Normally servo pulses are like this:



But 0deg. can be 1.00ms and 180deg. 2.00ms
Mid.pos. should normally be 1.50ms

Refresh 20ms ( can be 15....40ms)

citation from another site: Futaba will need 0.25 to 2.50 ms, Graupner will need 0.6 to 2.4 ms ...

Are you sure servo get those pulses.............

your loop time 0...1000 = 20sec.
Are you your pulses in servo wire have right timing.


KAK
 
Last edited:

nikhilsigma

Full Member level 2
Joined
Jun 19, 2010
Messages
139
Helped
17
Reputation
34
Reaction score
16
Trophy points
1,298
Location
Delhi, India
Activity points
2,559
Yes I am 98% sure that servo might be getting those pulses.....
because i had programmed that port with same program( having high duty cycle, as with current program the duty cycle is too low) and have checked that on LED and it was working great....(rest i am not sure it to be exactly accurate, as i can't measure it).....

and my loop time is 20ms x 1000 i.e. 20 seconds.....

i have two brand new servo motors of same type, but both are not working :-( so there isn't any problem in servos....

so what's the exact problem...?? is there any problem in program, any idea.....

also there is no problem, if the servo can't go completely from -90 to +90........the main problem is that the servo isn't moved a degree......

i ain't getting anything....

---------- Post added at 20:27 ---------- Previous post was at 20:18 ----------

hey guys check out this....i found a almost same problem as mine.....but mine still not working even with his solution.... :-(

connecting a pwm servo(RKI 1210 aka HS311) to pic16f877a




and here is the link to the servo motor i am using.....

Standard Dual Ball Bearing Servo [RKI-1210] - Rs.525 : Robokits India, Easy to Use, Versatile Robotics Kits...
 

kak111

Advanced Member level 4
Joined
Mar 30, 2011
Messages
1,366
Helped
933
Reputation
1,868
Reaction score
907
Trophy points
1,413
Location
Finland
Activity points
10,942
Can you check that atmega is giving proper TTL pulses to servo.
Pulsed between 0 to 5Volt
Servo supply is 5V or higher
Motor and controller have same ground potential

Test refresh timing 40ms and 10ms
i think 1.5ms is right time for midpos.
but turn cw and ccw pulse times can vary by manufacturer and type.

Data sheet say that is direct compatible with

Hitec HS-311.

Pulse Cycle: 20 ms
Pulse Width: 900-2100 µs



KAK
 

nikhilsigma

Full Member level 2
Joined
Jun 19, 2010
Messages
139
Helped
17
Reputation
34
Reaction score
16
Trophy points
1,298
Location
Delhi, India
Activity points
2,559
I am so stupid.....the main problem was of power supply for motor.... it was not enough.... he he :p

Thanks dude for all the help....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top