Lab 7
Problem 2 (Review on Algebraic design)
Given the continuous time LTI system described by the transfer function,
\[ G_{cont} =\frac{1}{s(1+s)} \]
design a digital controller C (z) using a 1dof architecture to meet the following requirements:
1.a \(\left|e_r^{\infty } \right|=0\) in the presence of a step reference
1.b \(\left|y_{d_1 }^{\infty } \right|\le 0.85\) in the presence of a step disturbance \(d_1 (k\cdot Ts)=\varepsilon (kT_s )\)
2. \(\hat{s} \le 10%\)
3. \(t_{s,2%} \le 5.6s\)
Assume a sampling time \(T_s =0.15s\)
Execution
First instructions, finding zeros, poles, gains.
The transfer function is converted in a discrete form, then reconsructed from the extracted elements.
|
|
Plant G(z):
|
|
G =
0.010708 (z+0.9512)
-------------------
(z-1) (z-0.8607)
Sample time: 0.15 seconds
Discrete-time zero/pole/gain model.
The transfer function of the plant is:
\[ G=\frac{0.010708(z+0.9512)}{(z-1)(z-0.8607)} \]
Requirements on damping and natural frequence
In this section we will derive \(\omega_n\) and \(\zeta\) from the transient requirements. Since repetita iuvant, we recall the formulas.
\[ \zeta =\frac{\left|\log (\hat{s} )\right|}{\sqrt{\pi^2 +\log^2 \hat{s} }} \]
\[ t_{s,\alpha %} =\frac{\log (100/\alpha )}{\omega_n \zeta } \]
|
|
Requirements on tracking error and disturbances
1.a Tracking error
This strict requirement imposes \(\mathcal{l}=1\), nothing special.
Since a pole at 1 is present in the Plant t.f. (l1=1),
\[ \begin{array}{l} \mathcal{l}={\mathcal{l}}_1 +{\mathcal{l}}_2 \newline {\mathcal{l}}_1 =1\Rightarrow {\mathcal{l}}_2 =0 \end{array} \]
1.b Disturbance on the controller
\({\mathcal{l}}_2 =0\) is perfectly paired with the previous assumption.
Since the error should be less than a max value, according to this table we will add another condition to the resolution of the final big system.
\[ \left\lbrace \begin{array}{l} \left|\frac{\delta_1 }{K_{l_2 } }\right|\le 0.85\newline K_{l_2 } =\lim_{z\to 1} (z-1)^{l_2 } C(z)\newline C(z)=\frac{S(z)}{R(z)} \end{array}\right.\Longrightarrow \delta_1 R(1)-0.85S(1)\le 0 \]
Design Settings
Definition of \(A^+ ,A^- ,B^+ ,B^-\)
In order to design a 1-dof controller with zero-pole cancellation, it is important to find the correct zeros and poles.
In general, the cancelled factors must correspond to asymptotically stable modes (i.e. with magnitude strictly less than 1).
In order to grant the possibility to satisfy the transient requirements (e.g. damping factor),
it’s useful to introduce a cardioid region \(\mathcal{D}\) in the z-plane that corresponds to roots with sufficiently high damping.
Zero/Poles inside the cardiod will be inserted inside \(A^+ -B^+\).
WARNING: Do not touch \((z-1)\)!
|
|
Whatching the graph, the pole at 0.861 is inside the cardioid.
The pole at 1 is not considered, the zero at -0.9512 is out of the cardioid.
|
|
\[ \begin{array}{l} A^+ =(z-0.8607)\newline A^- =1\newline B^+ =1\newline B^- =0.0107\cdot (z+0.9512) \end{array} \]
Degree analisys and poles design
Now it is important to find the correct solutions to the diophantine problem.
It is very important to remember to add an ulterior degree at the end, due to the condition 1b
In this case the system is now:
\[ \left\lbrace \begin{array}{l} (z-1)^l A^- (z)R^{\prime } (z)+B^- (z)S^{\prime } (z)=A_m (z)\newline \deg (S^{\prime } (z))=\ell +\deg (A^- (z))-1+1\newline \deg (R^{\prime } (z))=\deg (A^{\prime } (z))-\deg (B^+ (z))+\ell_1 -1+1\newline \deg (A_m (z))=\ell +\deg (A^{\prime } (z))+\deg (A^- (z))+\ell_1 -\deg (B^+ (z))-1+1 \end{array}\right. \]
Recalling that deg(X) represents the maximum degree of the X polynomial of variable z, at the end we have:
\[ \begin{array}{l} \deg (S^{\prime } (z))=1\newline \deg (R^{\prime } (z))=2\newline \deg (A_m (z))=3 \end{array} \]
Since the degree is 3, we can add 2 complex-conjugates poles and a faster pole.
The resulting \(A_m\) will be obtained out of those poles with poly(p1,p2,p3).
|
|
Diophantine problem settings
The goal now is to solve the equation.
\[ (z-1)^l A^- (z)R^{\prime } (z)+B^- (z)S^{\prime } (z)=A_m (z) \]
In order to solve this equation we can use the sym
|
|
eq1 =
\[ \displaystyle \begin{array}{l} \left(\begin{array}{cc} \frac{5347678730376377,z^2 }{2251799813685248}-\frac{2101603943401923,z}{1125899906842624}-z^3 +\frac{6172728145636147,z,{\left(s_0 +s_1 ,z\right)}}{576460752303423488}+\sigma_1 +\frac{4325465917834329}{9007199254740992}=0 & \frac{5347678730376377,z^2 }{2251799813685248}-\frac{2101603943401923,z}{1125899906842624}-z^3 +\frac{733966194918183,z,{\left(s_0 +s_1 ,z\right)}}{72057594037927936}+\sigma_1 +\frac{4325465917834329}{9007199254740992}=0 \end{array}\right)\\mathrm{}\\textrm{where}\\mathrm{}\;;\sigma_1 ={\left(z-1\right)},{\left(r_2 ,z^2 +r_1 ,z+r_0 \right)},{\left(z^3 -\frac{5347678730376377,z^2 }{2251799813685248}+\frac{2101603943401923,z}{1125899906842624}-\frac{4325465917834329}{9007199254740992}\right)}\end{array} \]
|
|
eq2 = \(\displaystyle r_0 -\frac{17,s_0 }{20}+r_1 ,z-\frac{17,s_1 ,z}{20}+r_2 ,z^2 =0\)
|
|
Helper Functions
|
|