Shop OBEX P1 Docs P2 Docs Learn Events
Steering servo and DC motor with ESC — Parallax Forums

Steering servo and DC motor with ESC

Vladimir059Vladimir059 Posts: 9
edited 2006-03-18 16:15 in Robotics
Hello everybody. My name is Vladimir and I’m beginner in Basic Stamp2. As I’m very lazy to do a home cleaning and my apartment serves me also as a workshop so I decided to make my life easier and build robot vacuum cleaner similar to IRobot’s·· “Roomba”. Buying such things from a store offends me as designer and decided to make it myself.· I have no problem with designing mechanical parts and assemblies, I don’t think I will have any problems with electronics, but I expect some difficulties with programming.· I’m currently reading “Basic Stamp Syntax and Reference Manual”, but to start with it I need a sample of wandering program. For my “MonsterVac”· I’m going to employ steering servo. For propulsion I’m going to use DC motor with a·hobby ESC- forward / reverse (hobby ESC using the same signals as standard hobby servo) ,· and two infrared sensors to collision avoidance. This is my basic set up. In future I’m planning to hook up a metal detector for searching and careful cleaning of metal shavings.· I checked up Parallax web site and found that all robots mentioned there using two continuous rotating servos. For my application such scheme not acceptable I have to employ steering wheels and due to relatively heavy structure I have to use powerful DC motor and accordingly ESC.
So if somebody have a sample of program to meets all this requirements, please let me know. I’m also appreciate for any input device subroutines which can improve “sensing” of my “devil machine” as ultrasonic sensors, whiskers, co-processor, wireless video camera, LCD display to monitor cleaning progress and so on.···
Thank you in advance
Vladimir.··· jumpin.gif

Comments

  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-03-18 13:03
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    
    DEBUG "Program Running!"
    irDetectLeft VAR Bit
    irDetectRight VAR Bit
    pulseLeft VAR Word
    pulseRight VAR Word
    
    DO
    FREQOUT A, 1, 38500
    irDetectLeft = INB
    FREQOUT C, 1, 38500
    irDetectRight = IND
    IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
    pulseLeft = 650
    pulseRight = 850
    ELSEIF (irDetectLeft = 0) THEN
    pulseLeft = 850
    pulseRight = 850
    ELSEIF (irDetectRight = 0) THEN
    pulseLeft = 650
    pulseRight = 850
    ELSE
    pulseLeft = 850
    pulseRight = 650
    ENDIF
    PULSOUT E, pulseLeft
    PULSOUT F, pulseRight
    PAUSE 15
    LOOP
    

    A= IR LED 1's anode Pin
    B= IR Receiver 1's output Pin
    c= IR LED 2's anode Pin
    d= IR Receiver 2's output Pin
    e= left servo's pin
    f= right servo's pin
    (I know this will work for a Board of Education)
    If you don't have a parallax board I sugest this one.roll.gif
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-18 16:15
    This thread is a duplicate and is being locked.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.