View Single Post
  #9   Spotlight this post!  
Unread 04-02-2010, 22:04
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Inverted Turning

Quote:
Originally Posted by Darkknight512 View Post
It doesn't seem to make sense to me that the robot goes backwards when the PWM's are switched.
Think about which way the motors turn in order for the robot to move forwards. Drivetrain designs with both motors going the same direction are vanishingly rare. Almost invariably, one spins clockwise and the other spins counterclockwise.

When you swap the motor control, you're telling each motor to turn the way the other one used to. That runs the robot in the other direction.

Just look at the code, and at the robot wiring, and make sure that the PWM signal configured as the left motor is the same one physically connected to the left motor. Do the same for the right motor. Then if either side of the robot runs in the wrong direction, invert that motor's control in the code.
Reply With Quote