Question: 1. In this problem you will design and implement a proportional (P) and a proportional derivative (PD) controller to track the horizontal movement of your

1. In this problem you will design and implement a proportional (P) and a proportional derivative (PD) controller to track the horizontal movement of your computer cursor on the screen (a) Proportional (P) Control Download the Matlab file track cursor.m provided on Blackboard with this homework assignment. This program plots the current horizontal position of your cursor with a blue dot. The red dot tries to track your mouse position using proportional control (u-Ke), where the gain is K-0.1. The program runs for a set amount of time, shown as a percentage in the figure title. Run the program, then without moving your cursor allow the red dot to reacha steady state position, then use your computer cursor position to implement a step input in the position of the blue dot (does not have to be a unit step; move your mouse a reasonable way across the screen). Plot the reference (r), output (y), error (e), and control input (u) as a function of time. Repeat with a higher gain, K-1 (b) Using P control with K = 0.1 let the red dot equilibrate to a steady state position and then implement something approximating a sine wave with the blue dot by moving the cursor from left to right. Plot the reference (), output (y), error (e), and control input (u) as a function of time. Does the reference track the output exactly or does it lag behind it? Also, does the amplitude of the output match the amplitude of the reference? Note: for this part of the problem you may need to increase the number of time steps you record over by changing Nstop (c) Proportional Derivative (PD) Control Now implement a proportional derivative controller (u K,e + Kde) to track the output. Recall that a derivative can be calculated numerically as: (Note that there are better numerical derivative approximations, which you are welcome to implement, though it is not required.) Plot the reference (r), output (y), error (e), and control input (u) as a function of time for a step input, as in part (a). You do not need to include this in your solution, but you may find that as you adjust the controller gains the system becomes unstable for some values of K, and KJ
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
