EE 233 Laboratory Exercise 03 We will investigate the performance of a digital controller derived from the approximation of derivative terms as difference equations. Given the Maglev transfer function 56.54 G(s) = ------------------------ 0.12 s^2 + 0.6 s + 58.31 and a PID controller that yields an acceptable closed-loop response D(s) = U(s)/E(s) = 0.21 + 19.95/s + 0.04s. 1. Determine the difference equation for the digital controller by approximating the derivative terms using the following equations. xdot[k] = (x[k] - x[k-1])/T xddot[k] = (x[k] - 2x[k-1] + x[k-2])/T^2 You should get a difference equation in terms of u[k], u[k-1], e[k], e[k-1] and e[k-2]. 2. Determine the closed-loop response of the Maglev system with the above difference equation defining the digital controller. Assume the desired output is 2.5 (cm). The procedure of simulating the response is similar to lab experiment 02, part 2b. This is done by iterating over the following steps. a. Calculate the input to the forward path e[k] by subtracting the the forward path output from the reference input. b. Determine the output u[k] of the digital controller in response to the error e[k]. c. Determine plant response to u[k] calculated in b. by using lsim command. d. Determine the lsim output at the "end" time of the iteration. Feed this back to the forward path and repeat from a. Use a 10 ms "sampling" time similar to lab experiment 02. Do 100 iterations for a total of 1 second simulation time. 3. Compare the results in 2. with the results of the previous experiment.