we were going use a pneumatic actuator to control ball flow but that got axed when we cam in over weight. it was replaced by one of the servos.
i added :
pwm09 = p3_x
printf(" %d || %d\r", p3_x, pwm09) // edited post “p3_y” to “p3_x”
to my code hoping that i could just plug the servo into pwm09 and have it track back and forth and then rewrite the code later to include endpoints.
the idea with the printf was to let me find reasonable values for the ends.
the problem is that when i move the 3rd joystick i get no motion out of the servo
it dose however move a tiny bit when the robot is first turned on.
if i missed anything in my code or wiring I’d be grateful if some one could point it out.
Is anything being displayed by your printf? You didn’t mention anything about that.
This is exactly how we dump out joystick and pwm values. Saturday it showed us that one of our joysticks from last year had died. The only difference in our code syntax is this:
printf("Joystick1 X = %u
", (int)p1_x);
printf("Joystick1 Y = %u
", (int)p1_y);
The small twitch at startup comes from servo values being initialized, most to 127.
Also verify your joystick is plugged in to port 3 and your servo to pwm09.
the code should have p3_x … when i coppied my printf over i acidentaly changed it to p3_y
also the print statement works all right
it reads 130 centered though, but thats just being lazy with calibration
even the pwm out check works so im at a lose to explain why i get no motion
also the servo dosenotalways return to the same spot when it moves at first, even if the pwm out is fixed at 127 (joystick unplugged)
you are aware the servos run off the power from the little backup battery, yes?
also, make sure you dont have a line of code further down that sets the PWM9 port to 127. Teams often set the unused ports to 127, and then forget that line of code is in there!
Do you have some other PWMs or speed controllers that are working? You could try swapping the servo to a PWM you know is working and swapping the speed controller to pwm09. If the servo doesn’t work, then it’s a bad servo or wire. If the speed controller doesn’t work, then it’s something in your code.
FYI
Version 11 and earlier of the Master code had a “feature” that caused servos (not motors) to twitch occasionally on powerup. I haven’t tested version 12 yet to see if that’s been resolved, but IFI was aware of the issue.
I believe, if the servos are plugged into the main RC and not the camera, that they are run using the main battery. Whether or not an output is connected to a servo or motor is invisible to the controller, so it runs all outputs via the main. Servos are only powered by the backup battery if they are plugged into the camera.