Servos on the Boe-Bot
nab014
Posts: 22
Is there any reason why you can't connect the servos that come with the Boe-Bot to ports 14 and 15 instead of 12 and 13? Note that I'm talking about the four sets of three prongs above the bread board.
Comments
This is one of the reasons it's a good coding practice to use names for the pins. All you have to do is change the name definition to match the physical configuration.
The piece of code looks like it should work so the problem might be your power supply.
If you add a DEBUG statement, something like DEBUG " Program Started", before you declare your counter variable you will be able to see if your program is restarting. A brownout will restart your program from the beginning.
Brad
Try the suggestions made earlier.
As for running in reverse, fix the first problem first, and see if the other one disappears too.
PAR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
If you're using larger batteries, you could power the BOE off the same power source. The issue is that the power source has to supply at least 6V under full load (of all the servos at peak). If not, you want a separate supply for the BOE itself so the Stamp doesn't reset.
Have you determined the power supply to be the problem?
Brad
I don't know what kind of wall adapter you have. You can run some servos off the 7.5V adapter, but it will only supply 1 Amp continuously. Four servos draw more than that at peak. If you start more than one servo running simultaneously within a short time (a few hundred milliseconds), you might attempt to draw more than the wall adapter can supply. If you're trying to run the BOE off the same supply, it might reset due to low voltage.
If you attempt to run servos off a higher supply voltage, you can damage them.
You may be running the servos off the +5V regulator on the BOE. This can only produce about 1 Amp and will shut itself off if you attempt to draw more than that.
Read the section of the Robotics with the Boe-Bot manual on servos. You'll see that there are three wires coming out of a servo. One (black) is the ground connection and needs to be connected to the negative side of any power source for the servo as well as the ground of the BOE. One (yellow or white) is the control pulse and needs to be connected to a Stamp pin that you're program uses to control the servo. The third (red) is the positive power connection and needs to be connected to the positive pole of a battery or wall adapter that can supply 4.8V to 7.2V at currents up to 1 Amp per servo (peak).
Did you try it with the DEBUG statement, that should tell you if power is your problem. I can't think of what else it could be.
Don't you have the BoE schematic?
One pull-down resistor should go from P12 to Vss, another from P13 to Vss, another from P14 to Vss, and another from P15 to Vss.
We connected the external supply to the Boe-Bot and it solved the "brown out" issue I believe, but we still have rogue servos. The servo connected to port 15 runs at random times and even when the reset button is pushed. I moved everything to another Boe-Bot but the problem persisted. I'm attaching the code, perhaps the problem lies in there. I'm sure there are some errors in the program, any help would be appreciated. The system should read a value from the accelerometer and then move certain servos to correct the system from being un-level. Once the system determines it to be level, the program should just sit there. Thanks again for the help so far.
It looks like something is sending pulses to P14 and P15, and your code is measuring it before it attempts to control the servos. Servo ports 14 and 15 are controlled by I/O pins P14 and P15. If you also have a sensor that is sending pulses to those I/O pins, that sensor could well be controlling the servos connected to ports 14 and 15.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Priceless.
That last submittal is quite a bit different from all of the previous.