+++ title = "Reference Tracking" author = ["Dehaeze Thomas"] draft = false +++ Tags : ## Following Ramp inputs with one integrator {#following-ramp-inputs-with-one-integrator} Let's suppose a static plant and a controller with one integrator with a crossover frequency of \\(\omega\_c = 10\cdot 2\pi\\) (i.e. 10Hz). ```matlab G = tf(1); % Plant K = 2*pi*10/s; % Controller ``` The transfer function from the reference to the output is: \\[ T(s) = \frac{G(s)K(s)}{1 + G(s)K(s)} \\] ```matlab T = G*K/(1 + G*K); % Transmissibility ``` The reference signal is a ramp with a "velocity" \\(r\_v = 1\\) unit/sec. ```matlab % Time domain simulation Ts = 1e-4; % Sampling Time [s] t = 0:Ts:0.4; % Time vector [s] r = zeros(size(t)); % Sepoint r(t>0.1) = t(t>0.1)-0.1; y = lsim(T, r, t); % Output ``` {{< figure src="/ox-hugo/reference_tracking_ramp_one_int.png" caption="Figure 1: Comparison of the setpoint and the plant output for a ramp with only one integrator in the loop" >}} The error converges to a constant equal to \\(\frac{r\_v}{\omega\_c} \approx 0.016\\). The output "lags" behind the reference by \\(\frac{1}{\omega\_c}\\) in seconds. ## Bibliography {#bibliography}