Hi all,
I have been out of the programming loop (pun intended) for about a year but am back and I am rebuilding a robotic car that decided to launch itself down a flight of stairs. Dumb robots.
What I have so far is a 20X2(C.1) running 2 servos, 2 PING sensors, 2 LEDs and a LCD. Have not connected the drive wheels yet. The servos are used to allow the PINGs to look around. Everything was going well until I was hooking up the communication pins for the PING sensors. I hooked one up and started getting good data out to the LCD. Then I added another SEROUT command for the other PING, ran it, decided all was displaying properly then turned off the power to hook up the com pin to the second PING. When I turned the power back on the 2 servos would only move about 10 degrees either side of center and they were doing that faster than the program was suppose to allow. They were moving about 45 degrees from one side of center to 45 degrees to the other side of center per the program. Thinking that I had hooked something up wrong I reached for the 1K resistor that I had just installed from B.3 to the PING com pin and pulled it out. At this point all returned to normal. Being very careful, I placed the resistor back into the breadboard at pin B.3 and before I put the other end of the resistor into the connector track for the PING the servos started their short swings again. It turns out that as long as I only have one PING com pin connected (either one) all works well. Anytime I hook up or even touch the resistor for the second PING pin, thats when things go wrong. Keep in mind that I do not change the program. The program is coded for both PING sensors. The problem only occurs when I hook up the second PING sensor or touch the wire leading to the pin being used for the PING com.
I moved the com pins to the other side of the chip (port C instead of port B with the servos) but this had no effect. I added a high output with a 100 ms pause and this 100 ms time does not change. It just happens more often. When all is running well the program cycles about every 1.75 seconds. With both PING coms connected the program seems to speed up to about one cycle per just under a second. The servo com output pulse width does not change but instead of the chip sending it every 20ms the pins only send this info every 75ms so that the servos are not updated often enough. I added a 1 second delay between the commands that tell the servos to move left-center-right-center. I seem to be getting the proper 20 ms communication updates with the servos and the servos do drive to the proper angles now but the overall program cycle time still changes when I connect the second ping com to the PICAXE pin. With only one ping com connected, the program cycles every 5.8 sec. With both connected, the program cycles every 4.5 seconds.
At the beginning of the program, I drive both servos 90 degrees to the left then center them then drive then 90 degrees to the right. This works fine.
I have done the normal things like changing chips, verifying voltage and such. I have not searched the forum much because I am not sure what to search for. I keep thinking this is a loading issue but I have 1K ohm resistors on the PING com pins and 330 ohm resistors on the servo com pins.
I hope someone has an idea. Any help would be appreciated. If I need to post the code, I will.
Dave E
I have been out of the programming loop (pun intended) for about a year but am back and I am rebuilding a robotic car that decided to launch itself down a flight of stairs. Dumb robots.
What I have so far is a 20X2(C.1) running 2 servos, 2 PING sensors, 2 LEDs and a LCD. Have not connected the drive wheels yet. The servos are used to allow the PINGs to look around. Everything was going well until I was hooking up the communication pins for the PING sensors. I hooked one up and started getting good data out to the LCD. Then I added another SEROUT command for the other PING, ran it, decided all was displaying properly then turned off the power to hook up the com pin to the second PING. When I turned the power back on the 2 servos would only move about 10 degrees either side of center and they were doing that faster than the program was suppose to allow. They were moving about 45 degrees from one side of center to 45 degrees to the other side of center per the program. Thinking that I had hooked something up wrong I reached for the 1K resistor that I had just installed from B.3 to the PING com pin and pulled it out. At this point all returned to normal. Being very careful, I placed the resistor back into the breadboard at pin B.3 and before I put the other end of the resistor into the connector track for the PING the servos started their short swings again. It turns out that as long as I only have one PING com pin connected (either one) all works well. Anytime I hook up or even touch the resistor for the second PING pin, thats when things go wrong. Keep in mind that I do not change the program. The program is coded for both PING sensors. The problem only occurs when I hook up the second PING sensor or touch the wire leading to the pin being used for the PING com.
I moved the com pins to the other side of the chip (port C instead of port B with the servos) but this had no effect. I added a high output with a 100 ms pause and this 100 ms time does not change. It just happens more often. When all is running well the program cycles about every 1.75 seconds. With both PING coms connected the program seems to speed up to about one cycle per just under a second. The servo com output pulse width does not change but instead of the chip sending it every 20ms the pins only send this info every 75ms so that the servos are not updated often enough. I added a 1 second delay between the commands that tell the servos to move left-center-right-center. I seem to be getting the proper 20 ms communication updates with the servos and the servos do drive to the proper angles now but the overall program cycle time still changes when I connect the second ping com to the PICAXE pin. With only one ping com connected, the program cycles every 5.8 sec. With both connected, the program cycles every 4.5 seconds.
At the beginning of the program, I drive both servos 90 degrees to the left then center them then drive then 90 degrees to the right. This works fine.
I have done the normal things like changing chips, verifying voltage and such. I have not searched the forum much because I am not sure what to search for. I keep thinking this is a loading issue but I have 1K ohm resistors on the PING com pins and 330 ohm resistors on the servo com pins.
I hope someone has an idea. Any help would be appreciated. If I need to post the code, I will.
Dave E