FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem making motor go in reverse with Talon SR controller

Hi,

Any help on this would be great. We have a simple motor (not sure exactly the type) that goes in one direction when connected with one polarity to a battery, and the other direction when connected with the reverse polarity. We are trying to program our Teleop.vi so that when we push one of the buttons on a joystick, the motor goes in one direction, and when we push another button, it goes in the reverse direction.

Right now we have code so that it does go in one direction (the direction corresponding to the "positive" polarity), but when pushing the button to go in the opposite direction, it moves but "stutters". In the positive direction, the lights on the Talon SR are green, but in the opposite direction, they turn orange.

I've attached a copy of the code below. Any help would be fantastic and much appreciated!

0 Kudos
Message 1 of 2
(4,930 Views)

donnaw,

Are you getting a solid orange light, or a blinking orange light? Page 6 of the Talon SR manual here specifies the meaning of each. A solid orange light indicates that the throttle is within 4% of the deadband, which might be part of the problem. 

I would also highly recommend combining those case structures. As it currently stands, both cases could be executed at the same time, which would potentially produce that stuttering effect.

0 Kudos
Message 2 of 2
(2,814 Views)