Closed Loop Assignment
MAE156A; Winter 2013; Closed loop control homework
1) Filtering exercise:
a. Run turntable at maximum PWM (100%) for 540 degrees then set the PWM to zero and allow it to slow down and stop. The filtering algorithm should be incorporated into the code. Provide output and plot displacement and velocity vs. time.
Use the filtering equation provided in lecture
Choose an appropriate time constant that reduces noise while maintaining the essence of the signal
There is no need to measure the encoder in this assignment.
During the dead-zone there will be "garbage data". This is fine, but notate this on your output plot.
b. Calculate unfiltered and filtered velocity (using the same time constant as in the Arduino code) from the displacement output obtained in part a. Compare calculated filtered velocity from what was output by the Arduino.
c. Provide plots of calculated velocity using a 2 time constants different then what was used in the Aduino. One should be 0.5X and the other 3X. Discuss what happens when the time constant is too small or too large.
d. Repeat a, b, and c with the turntable rotating in the other direction. Check if your response is similar in both directions. If you see a significant difference, comment why?
2) In this part you will do multiple moves of the turntable using closed loop control. You will need to implement PID code using filtered velocity feedback (i.e. derivative feedback) as described lecture. Note, the Embedded Programming examples do not include filtering; you will need to incorporate this yourself.
a. Define the 180° location to be one half of a rotation away from the dead zone of the potentiometer.
b. Starting at 180° after 100ms.
i. Move +50° (to 230°), then wait 500ms
ii. Move -100° (to 130°), then wait 500ms.
iii. Move +150° (to 280°), then wait 500ms
iv. Move -200° (to 80°), then wait 500ms
v. Move -50° (to 30°), then wait 500ms
vi. Move +200° (to 230°), then wait 500ms
vii. Move -150° (to 80°), then wait 500ms
viii. Move +100° (to 180°), then wait 500ms
c. The criteria for arriving at set point shout be that the displacement error is less than 1.5° (0.0262 rad) and the magnitude of velocity is less than 5°/s (0.087rad/s).
d. Try to optimize the motion(s) get complete them as quickly as possible and minimize overshoot.
e. Demonstrate the motion to a TA
f. Provide plots of displacement and velocity as a function of time for your optimized design, with less damping, and more damping.
g. Document your gains and discuss how you overcame the system friction.