can someone explain this
I am just starting to implement standard parallax continious rotation servos in a custom built robot. I am using example from the book, 123 robot experiments for evil genius.
I set up the two servos as shown in the book, typed in the code. The author is using a variable for each servo, servoleft, servoright, and constants for the forward (600) and backward (900) values for each servo. In order to get the servos to drive in opposite directions the values were reversed for left and right servos. I dont have the code available to cut and paste here now.
It all worked OK, I had both servos going forward, one cw, one ccw. I added code to have them both then go backwards, by changing the values for each servo using the backwards values. This all seemed to work great.
However, when I took the setup upstairs to brag to my daughter, who was helping me with some of the construction, and I ran it again, both servos ran ok until the part of the program where they were to run backwards. One or both, did not reverse, it ran the same direction for both loops.
Then I noticed that the signal wire for that servo had come out of its connector. It was supposed to be connected to pin 13 and had fallen onto the connection for pin 10 or 11. The servo was still turning as it should but not in the correct direction. When I placed the wire back in the correct position then the program ran as it should.
So, was the disconnected servo receiving signals from the unused pin 11, or was it getting cross talk signals from the pin that was driving the other servo (pin 15)
I set up the two servos as shown in the book, typed in the code. The author is using a variable for each servo, servoleft, servoright, and constants for the forward (600) and backward (900) values for each servo. In order to get the servos to drive in opposite directions the values were reversed for left and right servos. I dont have the code available to cut and paste here now.
It all worked OK, I had both servos going forward, one cw, one ccw. I added code to have them both then go backwards, by changing the values for each servo using the backwards values. This all seemed to work great.
However, when I took the setup upstairs to brag to my daughter, who was helping me with some of the construction, and I ran it again, both servos ran ok until the part of the program where they were to run backwards. One or both, did not reverse, it ran the same direction for both loops.
Then I noticed that the signal wire for that servo had come out of its connector. It was supposed to be connected to pin 13 and had fallen onto the connection for pin 10 or 11. The servo was still turning as it should but not in the correct direction. When I placed the wire back in the correct position then the program ran as it should.
So, was the disconnected servo receiving signals from the unused pin 11, or was it getting cross talk signals from the pin that was driving the other servo (pin 15)
Comments
Remember that logic inputs are high impedance and very sensitive to nearby electric fields unless something is explicitly done to prevent that (like a pullup or pulldown resistor).