go_away

Author Topic: pulse for servo  (Read 959 times)

0 Members and 1 Guest are viewing this topic.

Offline tipipliouTopic starter

  • Full Member
  • ***
  • Posts: 48
  • Helpful? 0
pulse for servo
« on: March 11, 2010, 01:00:50 PM »
hi
i bought 2 hitec servos HS-422,and I would test them before modifying them
i made a test program ,but it doesn't work as it should  >:(
i generated a 2 ms width pulse,repeated every 20 ms during 1 second,  then a tempo of 2 seconds,then a 1.5ms width pulse,repeated every 20 ms during 1 second,i did the same with a 1 ms width pulse
with this program ,i think it should turn,wait 2 seconds,come back wait 2 seconds,then turn the other sens.
well ,IT DOES NOT !!!
sometimes ,it doesn't move at all,sometimes it moves really really slowly (just like a stepper) ???
so ,i wish somebody could help me,tell me what i have to check,or a mistake with the program .......... please :'(
PS : i do the tests in educational board,with a an old computer power supply,the microcontroler is a Pic16f877a,i use mikroC for prgramming

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: pulse for servo
« Reply #1 on: March 11, 2010, 03:29:43 PM »
Hi,

then a tempo of 2 seconds,
I guess you mean a pause of 2 seconds?

No reason for a pause. Just go from one timing to another and hold each for at least as long as it takes the servo to go to that position.

Put a 'scope on the servo output to see if anything happens at all.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline tipipliouTopic starter

  • Full Member
  • ***
  • Posts: 48
  • Helpful? 0
Re: pulse for servo
« Reply #2 on: March 11, 2010, 05:13:56 PM »
yes,i mean a pause
so there is no problem with the program?
ok,well, i'll keep on trying ,the problem provides probably from the wires and their connections
but could you explain why sometimes it turns very very slowly? ???
thanks

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: pulse for servo
« Reply #3 on: March 11, 2010, 07:00:12 PM »
Hi,

so there is no problem with the program?

I never said that. I said check the servo signal with an oscilloscope, to see whether any pulses appear.


the problem provides probably from the wires and their connections

Are you perhaps using a solderless breadboard?
They're very prone to errors of the intermittent kind.


but could you explain why sometimes it turns very very slowly? ???

Again, it's hard to tell anything about a circuit thousand of miles away, no matter how far sighted I may be ;D
"Very very" is not the best way of describing rotational velocity, something like "45° in 10 seconds" is more descriptive.
Depending on the metric equivalent of "very very", it might be that it's when it's actually working as wanted.

You might consider making a simple servo tester in hardware. Something like this
It will help by reassuring servo functionality, both before and after modification.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline tipipliouTopic starter

  • Full Member
  • ***
  • Posts: 48
  • Helpful? 0
Re: pulse for servo
« Reply #4 on: March 12, 2010, 02:23:51 PM »
hi
I finally found out the problem
it was MikroC,when i built projects ,it seemed fine but when i checked the microcontroler outputs ,it was 2V everywhere !!!!!
so i tried to build it in another directory(with  the examples),it worked perfectly  8)
thank you for your advices
ciao

 


Get Your Ad Here

data_list