Shop OBEX P1 Docs P2 Docs Learn Events
Problem with Servo Control (PSC) - Page 2 — Parallax Forums

Problem with Servo Control (PSC)

2»

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-01-20 21:36
    The switch on the PSC disconnects the servo power (your 4AA's) when not in use. If you leave it switched on the batteries are permanently connected to the servos and drawing current. When you are not using the BOE or PSC you need to switch off the servos and switch off the BOE.

    If you are 100% the pos and neg are not touching then a small amount of solder won't hurt.

    Depending on how many servos you want to control and for how long you may want to consider larger capacity batteries or some other power supply. The 4AA's wont last long.

    Jeff T.
  • skatjskatj Posts: 88
    edited 2008-01-20 22:07
    Alright I went to Radioshack and picked up a new battery pack, same batteries, different pack though (this one has an on/off switch)

    I ran the following code:

    ' {$STAMP BS2}
    '{$PBASIC 2.5}
    
    Sdat CON 15
    baud CON 396
    
    servoPos VAR Word
    
    DO
    
    servoPos = 500
    ' after the !SC, 15 is the servo channel (on the PSC), 3 is the ramp (speed), then the position
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 15, 7,  servoPos.LOWBYTE, servoPos.HIGHBYTE, CR]
    PAUSE 2000
    
    servoPos = 1000
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 15, 7,  servoPos.LOWBYTE, servoPos.HIGHBYTE, CR]
    PAUSE 2000
    
    LOOP
    



    The servo moved very very very slowly, and then when I touched it, it was REALLY hot.
    This is my setup:

    http://i137.photobucket.com/albums/q224/skatj/servosetup-1.jpg

    edit: Oh Smile, no wonder why the wires were switched. Did I just permanently damage the PSC?

    Everything appears to be working now (well, the PSC works in servo port 12 but not 15, so yea), but knowing my luck something will go wrong within the next 24 hours.

    Thanks so much for your help guys!

    Post Edited (skatj) : 1/20/2008 10:34:34 PM GMT
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-01-20 22:50
    Well it looks like you are good to go, I would use Zoots last code where he cycles through all 15 channels and try each channel one by one to see if they all check out.

    well done

    Jeff T
  • skatjskatj Posts: 88
    edited 2008-01-20 23:06
    One more thing, I'm running an experiment to log which position corresponds to the number I type in the program.

    For example, if I run this code:
    ' {$STAMP BS2}
    
    '{$PBASIC 2.5}
    Sdat CON 12
    baud CON 396
    
    servoPos VAR Word
    
    DO
    
    servoPos = 350
    ' after the !SC, 14 is the servo channel (on the PSC), 3 is the ramp (speed), then the position
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 13, 3,  servoPos.LOWBYTE, servoPos.HIGHBYTE, CR]
    PAUSE 2000
    
    
    LOOP
    



    The servo will center itself each time, and then go to the specified position. For now this isn't that big of a deal but I can see it becoming a problem when I actually start my project. Is there a way to make it not center itself?
  • ZootZoot Posts: 2,227
    edited 2008-01-20 23:59
    On reset or powerup the PSC will center all servos. If you want different behavior, you'll need to program that into your Stamp.

    Also, to reiterate what unsoundcode said, run the code that loops through all the servos. This way you can see if your PSC is still working properly on all channels after running the PSC on more than 5v, misconnections, battery leaks, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
Sign In or Register to comment.