Changes between Version 10 and Version 11 of ControlSystems/SoftwareTeam/Training/GettingStarted/ClosedLoopControl


Ignore:
Timestamp:
Nov 9, 2019, 8:19:30 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/ClosedLoopControl

    v10 v11  
    22[[Image(walkTheLine.jpg,right,250px,margin=10)]]In the last example, we saw why robot programming is challenging: robots work in the real world where wheels slip, motors have different powers, wheels aren't inflated equally, and floors aren't perfectly level.  The robot didn't go straight and didn't stop at exactly 36"; traveling in a straight line is more difficult than it sounds.  In the basic Autonomous example, one wheel was turning faster than the other so the robot turned.  Since the encoders were reporting this, we can modify our program to compensate.  The simplest way to do this is to proportionally increase the motor power of the wheel that's going slower / reduce the power on the wheel that's going faster.
    33
    4 Create a new project named ClosedLoopControl and replace the default Robot.java with:
     4Create a new project named !ClosedLoopControl and replace the default Robot.java with:
    55* PWM [wiki:ControlSystems/SoftwareTeam/Training/GettingStarted/ClosedLoopControl/PWMCode Robot.java]
    66* CAN [wiki:ControlSystems/SoftwareTeam/Training/GettingStarted/ClosedLoopControl/CANCode Robot.java]