Closed Loop Challange

Pair Assignment.

    • Part 1: PID Control due before class Thursday 11/10

    • Part 2: Improvement on PID due in class on Thursday 11/17

Build a basic dual shaft setup:

      • Gear ratio 3:1 (small gear on motor shaft)

      • Inertia wheel of standard size on second shaft.

        • Symmetric Wheel. 3 10-32 bolts of length 2" loaded with 14 nuts mounted adjacently on one side of wheel and 3 similar bolts on opposite side.

        • Asymmetric wheel. 1 bolts as above mounted on just one side of the wheel.

      • Pot in line with inertia wheel.

Part 1:

    • Implement both Challenge 1 and Challange 2 using just regular PID control (not even with anti-windup).

      • Turn in plots on tuned system and Arduino code.

      • Describe tuning process and final gains used.

    • Grade is based on reaching specific target position without penalty for a long settling time, along with write up.

Part 2:

    • Implement both Challenge 1 and Challange 2 with the goal of improving the settling time relative to Part 1. Methods used could include adding anti-windup to PID, feedforward, bang-bang, velocity trajectory control.

    • Grade is based solely on how fast one settles at the target position.

Challenge 1: Symmetric Inertia Wheel

    • Implement a PID controller for a 180 degree rotation. Performance will be based on time to reach and settle in target position. Reaching target will be defined as:

      • position error < position threshold of +/- 1 degrees

      • velocity < velocity threshold +/- 1 degrees per second

Challenge 2: Asymmetric Inertia Wheel

    • Remove all bolts except 3 adjacent ones.

    • Start with bolts on inertia wheel at lowest position. Then implement a controller for a 90 degree rotation. Performance will be the same criteria as in challenge 1.


  • The performance will be based on potentiometer reading for the TA Arduino. The feedback sensor could be either the encoder, potentiometer, or a hybrid approach. Some Pros and Cons are:

    • Potentiometer feedback is more accurate since you are directly measuring the position of the object you care about. However, if there is a big lag between the motor and the pot due to backlash or twist in the flexible shaft coupling this cold lead to oscillation or even instability.

    • Encoder feedback will be more stable and possibly easier to tune, but backlash or twist in the flexible shaft coupling could lead to a steady state error that is not eliminated.

    • A hybrid approach would use the encoder to start with and then switch to the pot when one is close to the target, but there could be a time delay.


  • To quickly change gain values without recompiling, one can input gains through the serial port. An examples is provided in SampleP_Code. This example implements proportional control but not Derivative or Integral Control.

  • Make sure that your potentiometer is not going through the dead zone.

  • Note; not all pots are identical and thus may have a different calibration constant between counts and degrees. To easily address this, just play with the step size via the serial port input to achieve a desired 90 or 180 degree step. See void setup in SampleP_Code.

  • See Control Guidelines for PID tuning tips and other control approaches.

TA Setup