Problem with Interfacing the PSC USB servo controller and the Basic Stamp
vh_man
Posts: 3
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!
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!
bs2
8K
Comments
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.
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.