Shop OBEX P1 Docs P2 Docs Learn Events
Servo Deleted Stamp program from my PC!!! — Parallax Forums

Servo Deleted Stamp program from my PC!!!

stevebzzzzzstevebzzzzz Posts: 38
edited 2011-07-18 15:57 in BASIC Stamp
Well,

Not really :tongue:

I got so frustrated trying to understand how the servo works, I gave up, and vowed never again to learn this stuff! :tongue:

OK, so after I reinstall the stamp program, please tell me if I'm correct about the following assumptions:

1) I assumed that applying a high to the servo control, that it would cause the servo to rotate as long as the signal is high! This statement is INCORRECT....right?

2) I NOW assume that the servo is designed (Via it's own built in micro-controller) to "HOLD" or go to a particular angle, based on a sequence of timing pulses. This statement is TRUE...right?

If I got both of the above questions correct, I'll give it another try :smile:

Thanks, Steve

Comments

  • dandreaedandreae Posts: 1,375
    edited 2011-07-18 06:51
    Hello,

    Servos work off of pulses that are sent to them. They require power, ground, and a pulse (3 pins). Depending on the pulse that is sent it will move to a certain position. In chapter 4 of the "What's a Microcontroller" text it explain how a servo works in full detail. Here is a link for the free download:

    http://www.parallax.com/Store/Books/EducationalTexts/tabid/181/CategoryID/66/List/0/SortField/0/Level/a/ProductID/139/Default.aspx.

    Dave
  • stevebzzzzzstevebzzzzz Posts: 38
    edited 2011-07-18 07:16
    Hi,

    Yes Dave, I'm finally beginning to understand. I have an electronics background, but I just didn't grasp the servo. I incorrectly assumed that the servo is nothing more than a "Dumb" motor, when in fact, it is an intelligent device that is able to determine it's position, and calculate the amount of "thrust" to obtain it's new position based on the pulse sequence on the controll...is that correct? I am diligently working my way through the manual, and I just got hung up on this intelligent servo.

    Question: Who or what programs the intelligence into the servo? :lol:

    Thanks,

    Steve
  • LeonLeon Posts: 7,620
    edited 2011-07-18 07:55
    A servo is basically a negative feedback system that adjusts its output so as to minimise the error between the actual position and the input position. Servo systems are designed using techniques like the Laplace Transform.
  • stevebzzzzzstevebzzzzz Posts: 38
    edited 2011-07-18 07:58
    I'm trying to take apart my servo as we speak :lol:

    I wanna see the chip that is actually controlling the servo...I need to see it in real life!

    Steve...
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-18 08:07
    You don't need to 'calculate the amount of "thrust"'. R/C servos used to use analog circuitry to convert the control pulse width into a voltage and compare that voltage to the voltage produced by a pot attached to the output shaft of the gearbox using an op amp. The output of the op amp would drive the motor. If the voltages were the same, there'd be no movement. If one voltage were greater than the other, the motor would move in one direction with the speed of the movement proportional to the voltage difference, etc. These days, it's simpler and cheaper to do the same thing with a little microcontroller and the manufacturer of the servo puts a permanent program into the microcontroller during the manufacturing.
  • stevebzzzzzstevebzzzzz Posts: 38
    edited 2011-07-18 08:19
    Hi Mike :o),

    I took apart my servo...at least part one as you can see. If you look closely, there is a "level 2" that goes deeper into the matrix. I unscrewed those additional tiny screws, but knew for sure either one of two things would happen if I pulled it apart. Either the world would end, or I would destroy the servo lol! I didn't pull apart the second layer for fear of either of those scenarios lol.

    OK, on a serious note. OK, I think I get it...so what you're saying is that in the old days there was a potentiometer inside and thus allowed circuitry to measure the resistance and thus the current position of the mechanism, based on the amount of the rotation of the potentiometer ???

    I would imagine there is still a potentiometer in there, or would the built in microcontroller remember it's position in flash memory? or both? or is there a hamster in there haha :o)

    Steve

    servo.jpg
    1024 x 768 - 42K
  • ercoerco Posts: 20,256
    edited 2011-07-18 09:58
    There's a pot on the other side, wired to the driver circuit.

    Behind the hamster.

    PS: They make cheap clear servos that would save you some disassembly time! :)

    http://cgi.ebay.com/Micro-9g-Servo-RC-Futaba-walkera-Hitec-HS-55-TREX-450-/160608544620?pt=Radio_Control_Parts_Accessories&hash=item256503e76c
  • RonPRonP Posts: 384
    edited 2011-07-18 11:38
    Check out this video maybe a visual will help I know it helps me understand.


    Ron
  • stevebzzzzzstevebzzzzz Posts: 38
    edited 2011-07-18 12:24
    Great video. I'm gonna have that repetitious sound in my head all day long! Yea, that really did help me understand. Now I can move on...

    Thanks!
  • bomberbomber Posts: 297
    edited 2011-07-18 14:02
    To fully dismantle the servo, You need to (carefully) remove the white gears and (gently) pull off the back cover. Then (gently) pull down on the PCB. Look at the attatchments for pictures if you cannot dissasemble the servo yourself.
    1024 x 768 - 65K
    1024 x 768 - 116K
    1024 x 768 - 100K
  • stevebzzzzzstevebzzzzz Posts: 38
    edited 2011-07-18 14:06
    Nice,

    Thanks
  • ercoerco Posts: 20,256
    edited 2011-07-18 14:27
    Lots of servo guts documented online. Everybody and their brother feel a need to make a webpage about modifying a servo for continuous rotation. Here are two (one from me and one from my brother):

    http://www.acroname.com/robotics/info/ideas/continuous/continuous.html
    http://www.kronosrobotics.com/an116/GAN116.shtml
  • stevebzzzzzstevebzzzzz Posts: 38
    edited 2011-07-18 15:14
    I'm struggling through the servo chapter sentence by sentence. It's all of the math that's bothering me lol. Anyway, is there any command to read the starting position of the servo. For example, when I first run the program, how would I be able to determine it's current location? Is this possible?

    Thanks...,
    Steve
  • schillschill Posts: 741
    edited 2011-07-18 15:37
    I'm struggling through the servo chapter sentence by sentence. It's all of the math that's bothering me lol. Anyway, is there any command to read the starting position of the servo. For example, when I first run the program, how would I be able to determine it's current location? Is this possible?

    The simple answer, with a standard servo, is "no, it's not possible." There is no way to get information from an standard, unmodified servo.

    You can, however, do things like tap into the voltage from the potentiometer inside the servo and use an A/D converter to figure out the position of the servo.
  • schillschill Posts: 741
    edited 2011-07-18 15:38
    erco wrote: »
    Lots of servo guts documented online. Everybody and their brother feel a need to make a webpage about modifying a servo for continuous rotation. Here are two (one from me and one from my brother):

    http://www.acroname.com/robotics/info/ideas/continuous/continuous.html
    http://www.kronosrobotics.com/an116/GAN116.shtml

    Kronos Robotics is related to erco?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-18 15:45
    Except for special digital non-standard servos that work completely differently inside (other than having a motor, gears, a case, a 3-wire cable, and a microcontroller), R/C servos do not talk to their controller. Communications is one-way only. The controller tells the servo what position to go to. That's it. There's no way to know what position the servo is in unless you do some fancy cheating.

    Beau posted a thread quite some time ago explaining a scheme where you have a switch that can provide full power to the servo or limited power ... enough for the electronics, but not for the motor. You then try various pulse widths and measure the current drawn by the servo. When you attempt to make the servo move to the position it's already in, the current doesn't change because the servo electronics doesn't attempt to move the motor. Any other pulse width causes the servo electronics to try to move the motor and you can measure a drop in the servo voltage.

    Realistically, programs assume nothing about the position of a servo when they start. If the program needs the servo in a particular position, the program moves the servo to the position that it needs. If not, the servo will move to the desired position on the first attempt to move the servo.

    With continuous motion servos, the feedback circuitry is disabled and the mechanical stop is removed so the control pulse width specifies the direction and speed of the motor rather than the position. If you want to control the position of the servo, you have to add some kind of external position sensor like Parallax's optical Wheel Encoder.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-18 15:55
    It's supposedly possible.

    Beau came up with this method.

    I haven't tried it myself yet.

    The servo gears aren't as scary as they look. They usually only go back together one way.

    Duane

    Edit: Mike beat me to it and with a nice summary too. (At least my post could still be useful by providing a link to Beau's method.)
  • stevebzzzzzstevebzzzzz Posts: 38
    edited 2011-07-18 15:57
    Wow, Thanks for the explanation Mike!

    I can see how that can be a pain. So, essentially, you need to center or reset the servo at the beginning of your program, I think. I'm writing a program with two switches. One makes the servo go clockwise, the other makes the servo go counter-clockwise. I'll let you know how that goes...
Sign In or Register to comment.