Shop OBEX P1 Docs P2 Docs Learn Events
Problem with PropBot — Parallax Forums

Problem with PropBot

MacGeek117MacGeek117 Posts: 747
edited 2007-03-06 20:17 in Propeller 1
I just got my first Propeller in the form of a Protoboard that I just put on my BoeBot chassis. I've posted the program I'm using to test the servos, but only the servo I set first runs. The other one stays still. Does anyone know what I'm doing wrong?
RoboGeek


PS. Yes, the connections are good, I already tested them.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"

Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com


Post Edited (RoboGeek) : 3/6/2007 5:34:04 PM GMT

Comments

  • Stan671Stan671 Posts: 103
    edited 2007-03-06 19:41
    According to the Servo32_demo, you seem to need to issue one Servo.Set for each servo you will be using BEFORE running Servo.Start. Otherwise, the pin direction settings get out of sync.

    'Preset Servo's you want to use to center position 
     
    SERVO.Set(PanServo1,1500) 
    SERVO.Set(PanServo2,1500) 
    SERVO.Set(PanServo3,1500) 
    SERVO.Set(PanServo4,1500) 
    
    'Note: Servo pins that will be used must be preset before running "SERVO.Start". 
    ' This is because the I/O direction is set here and is only executed 
    ' at the beginning of "SERVO.Start". Servo pins that aren't used will remain 
    ' in their original direction state. 
    
     
    SERVO.Start 'Start Servo handler
    


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Stan Dobrowski
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-03-06 20:06
    RoboGeek,

    Stan671 is correct... another reason for doing this is so the servo's have some sort of pre-defined position. Doing so otherwise may yield unpredictable behavior.

    Try something like this...

    ''***************************
    ''* Propeller Template V1.0 *
    ''*  Author: Peter Quello   *
    ''*  Started: 18 JUN 2006   *
    ''***************************
    
    [b]CON[/b]
        [b]_clkmode[/b]      = [b]xtal[/b]1 + [b]pll[/b]16x
        [b]_xinfreq[/b]      = 5_000_000
        left          = 25
        right         = 24                        
    [b]VAR[/b]
      
    [b]OBJ[/b]
        servo :       "servo32"
    [b]PUB[/b] Start
        servo.set(right, 1300)
        servo.set(left, 1700)
    
        servo.start
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 3/6/2007 8:17:28 PM GMT
  • MacGeek117MacGeek117 Posts: 747
    edited 2007-03-06 20:17
    Thank you for the help! IT WORKS!
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
Sign In or Register to comment.