Shop OBEX P1 Docs P2 Docs Learn Events
Problem with Interfacing the PSC USB servo controller and the Basic Stamp — Parallax Forums

Problem with Interfacing the PSC USB servo controller and the Basic Stamp

vh_manvh_man Posts: 3
edited 2009-02-06 02:20 in BASIC Stamp
Well, I have a problem.......

I have a robot im currently constructing with the BOE as its main board, and the PSC as the servo driver. (its a BOE bot)

It interfaces the HM55B compass module, PING and PING mounting bracket to allow the robot to scan the room after it sees an obstacle and turn twoards the heading of which there are the least of obstructions (highest PING value). It also uses the compass to keep its heading constant, as an added bonus

I have taken simple source code from the PING and HM55B documentation, and PSC documentation, so those chunks of code are not mine. They do what I want them to though.

Anyway, My problem is this. The robot will detect an obstacle, and start its sweep. After this a multitude of unwanted things happen:

1. The robot does what its supposed to
2. the servo attached to the ping just stops moving in the middle of its scan cycle, And all servos move freely, despite the fact messages are still being sent to them
3. the servo reaches the end of its scan, Goes to return itself to center, and simply shuts off once it reaches the center point, causing all servos to go "limp"

What I THINK (and almost am sure of) whats happening is that the PSC is giving a dead band freqency to the servos. What I dont know is whats causing the PSC to behave so erratically. I was thinking its something with serial communications, But the thing that makes me think this is wrong is that if it were a program problem, it would happen every time if done in the same circumstances, which is not the case. Its as random as flipping a coin.

Attached is my giant program. Please help me! Its driving me CRAZY. And a schematic could happen if wiring might be the problem. That and a picture of how I have everything layed out.

Thanks in advance!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-06 01:04
    How are you powering all of this? It sure sounds like a power problem, like the PSC suddenly reset due to a loss of power or low voltage.
  • vh_manvh_man Posts: 3
    edited 2009-02-06 01:18
    the PSC is split into controller power and Servo power on separate power supplies, If I am correct.

    The Piece the controller runs on (the part not controlled by the on/off switch) is from the servo connectors on the side of the BOE next to the breadboard. Wether its attached to VIN or VDD it still has a problem.

    The "servo power" (the piece with the screws) is attached to a separate pack of 4AA batteries, attached above the BOE via a standoff.

    I have fully charged/tested the batteries in both the robot and the servo power pack, So im pretty sure dying batteries isn't the problem.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-06 01:44
    This may not have anything to do with the behavior, but you have to run the PSC logic from +5V. There's no voltage regulator, so you have to set the servo connectors on the BOE to Vdd. I don't have any way to look at your program for a couple of hours, so I can't give you any suggestions there.
  • vh_manvh_man Posts: 3
    edited 2009-02-06 02:00
    Thanks for the Hint. I was switching between VDD and VIN just for testing purposes.

    Could there be noise coming from the compass or PING sensor?

    I guess I should also mention I have Indicator LED's put in pins 12, 11, 4, 3, 2, 1. Its just a resistor to the LED to VSS. Nothing special.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-06 02:20
    Neither the compass nor the PING is likely to generate enough noise to reset the PSC. The primary source of noise is the servo motors, but you've isolated that somewhat by having a 2nd power supply.
Sign In or Register to comment.