View Full Version : Non-camera servos in Autonomous
Vashts6583
17-02-2007, 14:42
Alo. I wish to have a servo move from 0 to 255 during autonomous mode, but I can't seem to get it to work at all. I've tried just hard-setting it to 255 and also moving it in increments (25 every loop), but neither method seems to work. Anyone have a solution?
Alan Anderson
17-02-2007, 19:01
Servo power is supplied by the 7.2v backup battery. Do you have one installed?
Vashts6583
17-02-2007, 19:46
Yes, we do. I'm just not sure how to run it software-wise.
Also, I tested the autonomous with the dashboard hooked up, and the PWM that I have the servo hooked up to actually DID move to 254, but the servo itself didn't budge at all, yet the servo works with the controls on the OI... I know that the autonomous works with motors....but not with servos.... >_<
Alan Anderson
18-02-2007, 00:36
If it's working in teleop mode but not in autonomous, I'm going to guess that you're using the camera code from Kevin Watson, and your servo is on pwm13, pwm14, pwm15, or pwm16. If I've guessed correctly, read on. If not, I don't know what to tell you.
Kevin included a very nice PWM driver with the camera code. However, he didn't replace all of the original calls to Generate_Pwms() with calls to the new PWM(). Make the change yourself near the end of the autonomous loop.
Vashts6583
18-02-2007, 01:05
Actually, I already did make the change. However, it still didn't work (servo is on PWM 15).
Is moving a servo in autonomous even possible?
Is moving a servo in autonomous even possible?
Yes, it is definitely possible, with no fancy tricks required. It sounds like you've got some issues with using PWM 13-16.
paulcd2000
18-02-2007, 08:39
our camera is mounted on 11 and 12. We have absolutly no problems. Try using a different pwm port.
Vashts6583
18-02-2007, 12:20
Alright, I'll give that a shot, and I'll post the results. Thanks
Vashts6583
18-02-2007, 12:31
Thank you very much. I was using PWM 15, and as soon as I changed it to PWM 11 it worked just how it was supposed to.
Best of luck in the competition.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.