Control Theory
Control theory is a branch of engineering and mathematics that deals with the behavior of dynamical systems. The main goal of control theory is to develop models and strategies to influence the behavior of these systems to achieve desired outcomes. In the context of FRC robotics, control theory is essential for designing systems that can respond accurately and efficiently to changing conditions on the field. In this module, we will explore some fundamental concepts of control theory that are relevant to FRC robots.
Presentation
The exercises below are the Control Theory lesson in Scriptum. Open the lesson, start the simulated robot and follow its README. Each step is checked with the Verify button.
New Java in this lesson: no new syntax. You practice enums, switch, small methods and unit conversion.
Exercises
Three ways to hold a speed
- Write a Bang Bang controller for the flywheel
- Full power when too slow, no power when fast enough
- Write a Feed Forward controller for the flywheel
- Work out the power from the target speed and
kV, with no measuring:volts = FLYWHEEL_KV * SHOOT_VELOCITY kVis in volts per rad/s: 12 V / 628 rad/s (a Kraken's free speed) is about 0.0191- Find a good
kVby experiment
- Work out the power from the target speed and
- Use PID (feed forward plus feedback) to hold the speed
- Tune
kPand compare how each style recovers from a simulated ball launch
- Tune
Tuning
- Tune the flywheel for velocity control in simulation
- Make sure your system measurements like MOI and radius are close to the real robot
- Wheel Radius: 0.0762 m
- Wheel Mass: 2.3 kg
- Spin up in under about 1.5 seconds without overshooting the target
- Once you have tuned in simulation try final values on the robot
- Make sure your system measurements like MOI and radius are close to the real robot
WPILib exercises
Related Documentation
Controls
- Control Types: Basic overview of control loop types and vocabulary
- Feed Forward: Description of a Feed Forward system control approach
- Bang Bang Controller: Description of a Bang Bang system control approach
- PID Controller: Description of a PID system control approach