We’re at a competition right now, and none of the CSA’s have seen our problem, and everyone is clueless as to what it is. Our servo for our gear grabber opens when the robot turns on, its set to the closed position in robot init. I’m writing this on my phone so I can’t supply code at the moment.
What happens if you upload a blank robot project? You might have some code somewhere that sets the angle that you’re not seeing.
If uploading a blank project still causes it to move, then you might have a short somewhere.
You realize your code will not effect the servo until robot is enabled? When powered on, the servo goes to its default position which can vary servo to servo.
How could I change the default position?
You would have to read the directions for the servo (if you can find them). It might be easier to change the linkage so the servo works as is.
Are you using the small white power/PWM block that came with the servo? We found the same behavior when that was in place. We removed that and connected the servo directly to the RoboRio and now everything works as desired.
We ran into same issue and switched it with another servo that had the desired default position. However, the spec sheet states that:
While voltage is applied to the motor power pins, (3 & 4) the actuator extends. Reverse the polarity and the actuator retracts.
Which servo are you using?