Shop OBEX P1 Docs P2 Docs Learn Events
Sorry for such a noob question, but what can I do... — Parallax Forums

Sorry for such a noob question, but what can I do...

c131frdavec131frdave Posts: 38
edited 2011-08-01 08:20 in BASIC Stamp
I'm a noob I guess.

I'm trying to test my new HD servo, and I'm having some problems. I haven't messed with my BS2 in about 3 years, so I'm probably just not thinking this through properly.

I wrote a very simple program to test the movement limits of the servo. Here it is:

pulsout 14, 750


That's all there is. When I run it, the servo moves slightly. If I tap on the reset button, it moves slightly again until it actually reaches center point, then it doesn't move. When I change the code to, say:

pulsout 14, 1200

it then will move just slightly off center to the right. I then tap on the reset button like sending morse code, and it gradually moves one tiny step at a time until it reaches approximately 90 degrees to the right.

Why doesn't the servo just go to where I want it?

If i loop it, it will travel to the commanded position faster, but then it sits there and pulses when it reaches it's final spot. You can hear the motor coming on and off. I know if you hear this on your RC airplane, it means you have servo problems.

Any ideas? Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-01 07:59
    Servos require a series of pulses about 20ms apart. The behavior you describe is exactly how they should behave. Normally, like with an R/C servo receiver, these pulses are always present. In practice, the pulses need to continue long enough for the servo to reach its intended position. When the servo stops seeing pulses for a while, it will turn itself off until it sees pulses again. This is the twitching that you see. If you send pulses too often, it will also confuse the servo. Read through the "Robotics with the BoeBot" tutorial for more details on how to use servos and how they work.

    Try
    for i = 1 to 100
    pulsout 14,550+i*4
    pause 20
    next i
    
  • c131frdavec131frdave Posts: 38
    edited 2011-08-01 08:02
    Thank you sir. I will search for the tutorial you mention.
  • c131frdavec131frdave Posts: 38
    edited 2011-08-01 08:20
    Ok, I tried your code. It didn't work on the original servo, so I installed two more an they work perfectly. I think I fried the first servo trying to get it to work. :(

    Thanks for your help! :D
Sign In or Register to comment.