Shop OBEX P1 Docs P2 Docs Learn Events
maybe im just ignorant. — Parallax Forums

maybe im just ignorant.

Jayguy5000Jayguy5000 Posts: 139
edited 2005-05-22 21:53 in BASIC Stamp
what am i missing? ive read the book lots of times and i still cant figure out why pulsout 12, 750 makes the servo stay still.
sorry for the stupid questions..

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-05-22 21:04
    Because...............750, give or take 2 or 3, is the center position of the servo.· If you pulse the servo to 800, it moves.· If you pulse it again to 750, it goes back to the center - or off - position.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Need a bezel for your LCD?

    Newzed@aol.com
    ·
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2005-05-22 21:17
    I guess what im asking is why does sending a 1.5 ms pulse to a servo keep it still when 1.3 ms makes it turn?
    any one feel free to help me out here [noparse]:)[/noparse]
  • NewzedNewzed Posts: 2,503
    edited 2005-05-22 21:27
    That's because if you write pulsout 750, the pulsout period is 2us.· 750 x 2 = 1500us = 1.5ms.· Cear enough?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Need a bezel for your LCD?

    Newzed@aol.com
    ·
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2005-05-22 21:40
    lol im not getting it...AHHH...ok maybe its how i adjusted the potentiometer? yea thats it! the potentiometer catches the 1.5 ms pulse and some how doesn't send anything to the servo? im making this hard arnt' I...
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-05-22 21:42
    Well, the Servo has within it a comparator, which compares the width you are giving it to the width being generated by a variable resistor connected to the gear train.

    When the two pulse widths don't agree, the Servo moves the motor inside the Servo. The motor turns the gears, which moves the output shaft, and also moves the variable resistor. This causes the pulse-width generated by the servo to move closer to the pulse width you've supplied. When the two pulse-widths are equal, the servo stops moving the output shaft, and holds that position.

    A 1 mSec width is all the way one way, a 2 mSec width is all the way the other. Thus a 1.5 mSec pulse width is in the center of the Servo's output shaft range of travel.

    The Servo was created to recieve this 1 to 2 mSec pulse (repeated every 20 mSec) from an R/C control reciever, located in a remotely controlled airplane. This let people on the ground remotely pilot the control surfaces of an R/C plane (or boat, or car). The stick movement on the ground would be transmitted to the reciever in the plane. The reciever in the plane would then adjust the pulse-width of its output signals to the on-plane servo, which would move its output shaft, which would move an aileron or elevator on the airplane.

    This means a servo is a reasonably cheap, robust, and not very power hungry package including a motor and gearing that the BS2 can easily use to convert signals into movement.
  • JonathanJonathan Posts: 1,023
    edited 2005-05-22 21:43
    Jay,

    The servo has a little controller inside. When you send is a 700 uS pulse, it centers the servo. A longer pulse will move it one direction, and a shorter one moves it the other way. This makes an easy way to place a servo in the same position every time. Most servos are made to operate over 180 degress, and have stops that prevent it from going further. In a continous rotation servo, the stops have been removed. So, if you send pulses shorter or longer than 750uS (usually 500uS and 1500uS), the servo will rotate at full speed for as long as you continue to send pulses every 20mS or so. Sending a pulse slightly longer than 750uS will cause it to rotate slowly, but it will draw a lot of power. Continous servos only have a limited speed control that way.

    In the traditional uses of servos, like RC airplanes, the servos are constatnly getting pulses from the controller. The length of the pulse determines the position of the servo and maintains it there. In robotics applications pulses are usually sent for as long as you want the servo to move, and then no pulses are sent when you don't want movement. The exception to this is braking, where a robot will lock the wheels in the stop postion to slow the robot down more quickly.

    HTH,

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • JonathanJonathan Posts: 1,023
    edited 2005-05-22 21:47
    Oops, swap my timings in the post above for allans. He is correct about the pulse lengths.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • edited 2005-05-22 21:53
    The servo is a classic example of a "black box". A black box is a circuit or device that expects an input, and gives you an output. In the case of a servo, it turns when you send it a train of 1.3 ms pulses separated by 20 ms pauses(the input), it turns full speed clockwise (the output). When you send it a train of 1.5 ms pulses, it says still, and when you send it 1.7 ms pulses, it turns full speed counterclockwise. I don't know whether you've had the chance to experiment with pulses ranging from 1.4 ms to 1.6 ms, but you can get pretty good speed control with those.

    So, what you're asking is what's inside the black box, and how does it work. Inside the servo, there's a control circuit, a driver circuit, and a DC motor. The control circuit translates the pulses into a series of pulses that will be good for controlling the DC motor, and sends those pulses to the driver circuit. It also tells the driver circuit which polarity to apply to the DC motor. Polarity indicates which of the two terminals on a DC motor gets power or ground. Connect it one way, and the DC motor turns clockwise, connect it the other way, and it turns counterclockwise. .

    Unlike the control circuit, the driver circuit can handle the current the DC motor will require, and it switches the DC motor's power on and off for a certain period of time every 20 ms. The motor's speed depends on the "on" time relative to the "off" time, and its direction depends on the polarity the driver circuit applies to the motors terminals.

    Post Edited (Andy Lindsay (Parallax)) : 5/23/2005 4:29:34 AM GMT
Sign In or Register to comment.