Thread: pulsing motors
View Single Post
  #3   Spotlight this post!  
Unread 19-12-2011, 20:29
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: pulsing motors

It sounds like that you're using two joysticks to simultaneously control the robot (2 for tank, 1 for arcade). Since you - the human - are only interacting with one set of joysticks at one given point in time, the other joystick will read 0 when you're not using it. Therefore, every iteration through your code, two values will be set to the motor: one value (which is the one you want) from the joystick that you're actively using to control the robot, and another value from the joystick you're not using (which will give a 0). I can easily see why this setup would cause the symptoms you're describing.

To fix this, I wouldn't have your robot controlled in this manor. Maybe have a joystick button you have to hold down in order to go into a certain drive mode, or a switchbox switch. But don't have both types of control happening in parallel - then two values will be get set to the motor each iteration - and that's bad.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote