Shop OBEX P1 Docs P2 Docs Learn Events
Potentiometer controlling Servo — Parallax Forums

Potentiometer controlling Servo

Moonman80Moonman80 Posts: 4
edited 2008-03-04 01:28 in BASIC Stamp
We are trying to control a servo using a potentiometer and basic stamp but cannot find any Basic Stamp programming that would allow to do so. Any suggestions?

Comments

  • RefondersRefonders Posts: 1
    edited 2008-02-25 17:26
    yo just connect the anti-voltometer in between the servo and the potentiometer, then use basic stamp to program the analog controls
  • Moonman80Moonman80 Posts: 4
    edited 2008-02-25 17:28
    that doesn't help aaron
  • UghaUgha Posts: 543
    edited 2008-02-25 17:31
    You can use a capacitor with the POT and use RCTIME to read in the resistance on the pot.
    Then you can move the servo based on the RCTIME.

    If you need more help with this, let us know.
  • Moonman80Moonman80 Posts: 4
    edited 2008-02-25 17:33
    Yes I need more help. I have almost no knowledge in this kind of stuff. A step-by-step walk through would be preferable.
  • stamptrolstamptrol Posts: 1,731
    edited 2008-02-25 18:19
    Moonman,

    Look in the Stamp help file under RCTIME. A sample circuit is shown there to allow the Stamp to read the position of the pot.
    You'll have a value ranging from near zero to about 4000, with the components shown in the example, if I remember correctly. Don't forget to use a Word-sized variable.

    Then look in the Help file under PULSOUT.When the pulsout value is 500, the servo will be at full rotation in one direction, when its 750, it will be centered and when its 1000, it will be full rotation in the other direction.

    All your program has to do is read the pot, scale it to be between 500 and 1000 and send that value out with the PULSOUT command. The command has to resend its value every 20 mSec or so by having the program loop around again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • JedJed Posts: 107
    edited 2008-02-26 01:49
    Try this:
    parallax.com/Portals/0/Downloads/docs/books/edu/wamv2_2.pdf

    Page 153, activity #4 .... but I'd encourage you to read the entire book starting at the beginning if you are new to micro-controllers.
  • UghaUgha Posts: 543
    edited 2008-02-26 02:13
    Some questions...

    What size is your pot?

    Is your servo standard or continuous rotation?

    Did you get you components from a parallax kit or did you buy them elsewhere? (that'll help answer questions 1 and 2).

    Did the previous suggestions help you enough or do you still need more info?
  • Moonman80Moonman80 Posts: 4
    edited 2008-02-26 17:43
    The servo is continuous rotation and the parts are from parallax kits. not sure what size the pot is
  • aladasaladas Posts: 18
    edited 2008-03-03 19:51
    I have done more or less the same as a training exercise. The potentiometer wiring and code are borrowed from Chapter 4 of the Robotics v 1.5 Student Workbook (hard copy came with my BoEBot) and the servo I used was an unmodified Futaba compatible, attached to the spare servo port as pin 14. Unless I messed up taking out some extraneous sound generating code this attachment works. You may need to alter some multipliers to agree with the values for your pot and servo. Trial and error. What I wanted was to get the full travel of the servo arm with a full rotation of the potentiometer. Good luck.
  • Joshua PetersJoshua Peters Posts: 5
    edited 2008-03-04 01:28
    Moonman If you realy want to learn about Pots and servos I reqemend getting the "Whats a microcontroler" It teachs you about Pots and servos. I read your post talking about controllering a servo with a Pot, Now I reqEmend useing a 10K pot, I also read that you are use a contuiss rotation servo, THIS WILL WORK BUT, it will just turn the direction, you can controlle the speed also with the pot. I was·just was experimenting with Pots and servos, I made a laser cannon, that you could controlle with two Pots. It turned the laser pointer around. I have souce codes for you, and I will send you a discrption about the circut tomorrow, its very simple,· its prety straight forward.
Sign In or Register to comment.