Equip your Genius
Welcome to the Parallax Discussion Forums, sign-up to participate.
Learn with BlocklyProp
Arduino uno shield bot servo rotates ~ 20 degrees on power up then works correctly
2020-02-05 - 15:27:52
One of the servos on my uno shield bot rotates ~ 20 degrees on power up then works correctly. I recentered the servo several times. The other servo behave just fine. OIdeas?
2020-02-05 - 15:45:51
Maybe the Arduino is sending a rotation signal when it starts up for some reason. about how long does the rotation last timewise?
2020-02-05 - 15:54:30
Welcome to the forums!
Can you post your code so it can be reviewed?
2020-02-06 - 01:29:18
/* sketch_left_servo_test */
// Counter clockwise
// Counter clockwise
2020-02-06 - 02:48:19
Have you swapped the servos to make sure the behavior stays the same? This will help isolate between hardware and software. If it moves with the swap, probably the servo is failing or the electronics on that channel has a problem.
2020-02-06 - 10:08:28
Most of my servos twitch on power up. I never stopped to figure out how far, but they all go clockwise.
2020-02-06 - 11:28:28
wild guess.... Are the servo's centering themselves at power up ?
Say you always center them in your code, before powering down your project. And then try a powercycle- do they stay almost still at the next power up?
2020-02-07 - 05:05:46
There's a reason for this twitch and Andy explained it to me more than once in the past ten years. Switch your two servo port connections (and code) to P14 and P15. I think the problem will go away.
If I recall correctly, some of the Arduino pins toggle and this is interpreted by the servo as a signal. Specifically, the Arduino has a built-in LED on P13 that toggles on startup.
Will be interested in the results.
2020-02-07 - 05:51:39
"Most of my servos twitch on power up. I never stopped to figure out how far, but they all go clockwise" ... If the pins are floating in any way, it could be picking up 50/60Hz mains until the pins are initialized to OUTPUTS. Try a 10k pull-down resistor on the signal line to the servo in question.
2020-02-07 - 12:57:00
edited 2020-02-07 - 12:57:52
I experience this on the BOEBOT kit with the servos plugged into the servo headers on pins the Board of Education or on the servo headers on the PropBOE. I’ve always taken it to mean they were initializing and never thought twice about it.
I’ve never had any issues with the servos (Parallax CR servos).
2020-02-07 - 14:41:20
I have only watched several videos on Arduino code so I'm not an expert by any stretch but from what I've seen the highlighted line looks like a command. I would comment it out to see if that worked.
* sketch_left_servo_test */
2020-02-07 - 16:51:07
Thanks Ken, I will give it a try! Greg
2020-02-09 - 20:52:16
There is no server port 14 and 15 on the BOA Shield, only 12 and 13.
2020-02-09 - 21:11:22
edited 2020-02-10 - 04:05:30
Never mind the reference to DHB-10; I realize you're using the Shield-Bot for Arduino.
766 x 708