Shop OBEX P1 Docs P2 Docs Learn Events
Simple Continous Servo Controller — Parallax Forums

Simple Continous Servo Controller

TechnoRobboTechnoRobbo Posts: 323
edited 2007-01-30 01:06 in Robotics
This circuit is intended to roll a continuous servo with out chewing up Basic Stamp processing time. The LM339 comparator can be wired up for maximum of 2 servos so you can run your BOE Bots without using time consuming Pulsout commands.

You can also use this circuit with a standard servo if you only want preset positions. Any number of IO pins can be wired for preset for 1 controller circuit.

The circuit has 2 trimpots (potentiomenters) that you adjust for the servo position, speed or direction.

Set the IO pins to "INPUT" to shut off the motor. Set the pins to HIGH to activate preset position.

An example program is included below with the schematics.

·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun


TR

Post Edited (TechnoRobbo) : 1/14/2007 1:51:18 AM GMT

Comments

  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-01-12 14:36
    TechnoRobbo

    Can you explane how this routine works

    I thought that when you use a HIGH command to turn pin ON that you had
    to use a LOW command to turn OFF that pin


    I am still learning how to use a Basic Stamp I have not seen this one before

    This might a stupit question help me understand how this work

    Many Thanks for your help and time in this matter


    INPUT 1 'cutoff pin's driver
    HIGH 0


    PAUSE 5000



    ' {$STAMP BS2}
    ' {$PBASIC 2.5}


    INPUT 0 'cutoff pin's driver
    INPUT 1 'cutoff pin's driver

    Main:

    DO
    INPUT 1 'cutoff pin's driver
    HIGH 0
    PAUSE 5000

    INPUT 0
    HIGH 1 'cutoff pin's driver
    PAUSE 5000

    LOOP ' do it again
    END

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-12 17:04
    An I/O pin can actually be in 3 states - High (Vdd, 5V) , Low (Vss, 0V) and tri-state aka high impedance or hi-z·mode.· In Hi-Z mode the output driver is deactivated and the pin doesn't affect the circuit. If you were to put Pin 1 High and Pin 0 Low there would be an electrical path from pin 1 to pin 0 and this would affect the voltage going to the comparator.· Since this circuit is essentially voltage-controlled the pulse-width of the output would be changed.· To avoid this from happening we simply set the unused pins to INPUT which deactivates the pin driver and the pin neither sinks nor sources voltage in any noticeable amount.·

    Most circuits you use will require you to set the output pin to low but in this case it doesn't.

    Hope my explanation was clear. I know we tend to treat binary logic as ones and zeros but in real world there really is no such thing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-01-12 21:27
    TechnoRobbo

    Thanks for your reply
    I search on the web for tri-state aka high impedance or hi-z mode
    and found something to read on this subject and i have a better understanding of what is
    going with what you have here

    Thanks again for explane this to me

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-13 01:26
    Sorry for using·a colloquialism -·AKA stands for·"also known as"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-14 01:51
    I uploaded a new schematic changing the 2 resistors to 470 ohm - this makes calibration much easier.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-01-15 06:48
    TechnoRobbo
    I knew that was what that mean AKA stands for·"also known as

    One thing i look at your schematic I did not see any changes yet

    I uploaded a new schematic changing the 2 resistors to 470 ohm - this makes calibration much easier.

    Thanks for all of your help



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-15 13:21
    Try hitting refresh on your browser - I just checked it's there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-01-15 14:29
    TechnoRobbo

    I· see it now

    Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-25 23:54
    Here's a more complex but stabler circuit - It replaces the LM339 with a 555 timer (just as cheap). A standard servo can be controlled by applying a voltage ranging from aprroximately .7V to 2.8V (180 degress). Your servo may vary.

    You can use the BS2 circuit above to control it.

    A D/A or a digital potentiometer and some trimpots to control the high and low voltage.

    Use an R-2R resistor ladder.

    You can also run it by hand with a potentiometer and a 9 volt battery

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR

    Post Edited (TechnoRobbo) : 1/27/2007 5:03:31 AM GMT
    2055 x 1585 - 228K
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-26 01:05
    Here's how to control the new circuit with a digital potentiometer. Schematic attached.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    x·· VAR···· Byte

    LOW 2
    LOW 3
    x=64
    DO
    · DO WHILE x < 128
    ··· PULSOUT 3,1
    ··· PAUSE 10
    ··· x=x+1
    · LOOP
    · TOGGLE 2
    · PAUSE 1000
    · DO WHILE x >0

    ··· PULSOUT 3,1
    ··· PAUSE 10
    ··· x=x-1
    · LOOP
    · TOGGLE 2
    · PAUSE 5000
    LOOP

    END

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
    1161 x 617 - 83K
  • Special_KSpecial_K Posts: 162
    edited 2007-01-29 07:36
    I am going to get the parts and try it this weekend.
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-30 01:06
    I'd suggest the 555 version it's requires·no calibration.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
Sign In or Register to comment.