[[授業]] *Advanced Automation 2021 [#yfa8a823] [[latest lecture>#o06f6c6c]] [[latest lecture>#m72f126d]] ** &color(green){[lecture #1]}; 2021.9.2 outline of the lecture, review of classical and modern control theory (1/3) [#a9394d94] - outline of this lecture -- syllabus([https://vos-lc-web01.nagaokaut.ac.jp/]) -- evaluation --- mini report #1 ... 10% --- mini exam #1 ... 10% --- mini report #2 ... 10% --- mini exam #2 ... 10% --- final report ... 60% -- [[schedule2021]] (tentative) -- map &ref(授業/制御工学特論2017/map_v1.1.pdf); for review &ref(授業/制御工学特論2017/map_v1.1_review.pdf); - review : stabilization of SISO unstable plant by classical and modern control theory -- transfer functions / differential equations -- poles / eigenvalues -- impulse response / initial value response -- ... %-- 21/09/02 13:43 --% s = tf('s') P = 1/(s-1) pole(P) impulse(P) k = 2 P help step Tyr = k/(s-1+k) step(Tyr) k = 10 Tyr = k/(s-1+k) step(Tyr) #ref(2021.09.02-1.jpg,left,noimg,whiteboard #1); #ref(2021.09.02-2.jpg,left,noimg,whiteboard #2); #ref(2021.09.02-3.jpg,left,noimg,whiteboard #3); #ref(2021.09.02-4.jpg,left,noimg,whiteboard #4); ** &color(green){[lecture #2]}; 2021.9.9 review of classical and modern control theory (2/3) with introduction of Matlab/Simulink [#k975953a] //+ minute paper + introduction of Matlab and Simulink &ref(授業/制御工学特論2015/text_fixed.pdf); Basic usage of MATLAB and Simulink used for 情報処理演習及び考究II/Consideration and Practice of Information Processing II: Advanced Course of MATLAB -- interactive system (no compilation, no variable definition) -- m file //-- example: stabilization of inverted pendulum (sorry in Japanese) //--- [[derivation of equation of motion>http://c.nagaokaut.ac.jp/~kobayasi/i/Matlab/ex/text.pdf]] //--- [[stabilization of 1-link pendulum>http://c.nagaokaut.ac.jp/~kobayasi/i/Matlab/ex/1link.html]] //--- [[stabilization of 2-link pendulum>http://c.nagaokaut.ac.jp/~kobayasi/i/Matlab/ex/2link.html]] // // + system representation: Transfer Function(TF) / State-Space Representation (SSR) // -- example: mass-spring-damper system -- definition of SSR -- from SSR to TF -- from TF to SSR: controllable canonical form + open-loop characteristic -- open-loop stability: poles and eigenvalues -- Bode plot and frequency response &ref(ex0909_1.m); &ref(mod0909_1.mdl); --- cut off frequency; DC gain; -40dB/dec; variation of c --- relation between P(jw) and steady-state response + closed-loop stability -- Nyquist stability criterion (for L(s):stable) -- Nyquist plot &ref(ex0909_2.m); &ref(mod0909_2.mdl); --- Gain Margin(GM); Phase Margin(PM) %-- 21/09/09 13:05 --% a = 1 a +2 a + 2 a +2 a a + 2 ex0909_1 P sqrt(k/m) sqrt(k/m)/(2*pi) ex0909_2 L ex0909_2 ex0909_1 #ref(2021.09.09-1.jpg,left,noimg,whiteboard #1); #ref(2021.09.09-2.jpg,left,noimg,whiteboard #2); #ref(2021.09.09-3.jpg,left,noimg,whiteboard #3); ** &color(green){[lecture #3]}; 2021.9.23 review of classical and modern control theory (3/3) [#ibe88b53] + LQR problem -- controllability -- cost function J >= 0 -- positive (semi-)definite matrices -- solution of LQR problem -- example &ref(ex0923_1.m); &ref(mod0923_1.mdl); + ARE and quadratic equation -- scalar case (solve by hand) //-- closed loop stability ... Lyapunov criterion //-- Jmin -- matrix case &ref(授業/制御工学特論2015/lqr.pdf); ≒ &ref(授業/制御工学特論2015/proof4.pdf); (from B3「動的システムの解析と制御」) Matlabのコマンド履歴の保存に失敗しました。すみません。 #ref(2021.09.23-1.jpg,left,noimg,whiteboard #1); #ref(2021.09.23-2.jpg,left,noimg,whiteboard #2); #ref(2021.09.23-3.jpg,left,noimg,whiteboard #3); #ref(2021.09.23-4.jpg,left,noimg,whiteboard #4); -Q: 最後の2枚目のホワイトの式と対応をとるとこがよくわからなかった -A: □7のホワイトボードで、fに関する2次方程式とPに関するリカッチ方程式は、fとPの関係式の下で対応します。分からなければまた聞いてください。 ** &color(green){[lecture #4]}; 2021.9.30 relation between LQR and H infinity control problem (1/2) [#v18f2f4a] - GOAL: to learn difference in concepts between LQR problem and H infinity control problem //- review of LQR problem and the simple example + a simple example relating LQR and H infinity control problems -- For given plant G \[ G = \left[\begin{array}{c|c:c} a & 1 & b \\ \hline \sqrt{q} & 0 & 0 \\ 0 & 0 & \sqrt{r} \\ \hdashline 1 & 0 & 0 \end{array} \right] = \left\{ \begin{array}{l} \dot x = ax + bu + w\\ z = \left[ \begin{array}{c} \sqrt{q} x \\ \sqrt{r} u \end{array}\right] \\ x = x \end{array}\right. \] with zero initial state value x(0) = 0, find a state-feedback controller \[ u = -f x \] such that \begin{eqnarray} (i) &&\quad \mbox{closed loop is stable} \\ (ii) &&\quad \mbox{minimize} \left\{\begin{array}{l} \| z \|_2 \mbox{ for } w(t) = \delta(t) \quad \mbox{(LQR)} \\ \| T_{zw} \|_\infty \mbox{($H_\infty$ control problem)}\end{array}\right. \end{eqnarray} -- comparison of norms in (ii) (for a = -1, b = 1, q = 1, r = 1) \[ \begin{array}{|c||c|c|}\hline & \mbox{LQR}: f=-1+\sqrt{2} & \quad \quad H_\infty: f=1\quad\quad \\ \hline\hline J=\|z\|_2^2 & & \\ \hline \|T_{zw}\|_\infty & & \\ \hline \end{array} \] + an alternative description to LQR problem ++ J = (L2 norm of z)^2 ++ impulse resp. with zero initial value = initial value resp. with zero disturbance + definition of H infinity norm (SISO) s = tf('s'); G1 = 1/(s+1); bode(G1); norm(G1, 'inf') G2 = 1/(s^2 + 0.1*s + 1); bode(G2); norm(G2, 'inf') + definition of H infinity norm (SIMO) + solve the problem by hand + solve the problem by tool(hinfsyn) &ref(ex0930_1.m); %-- 2021/09/30 12:51 --% s = tf('s'); G1 = 1/(s+1); bode(G1); norm(G1, 'inf') G2 = 1/(s^2 + 0.1*s + 1); bode(G2); norm(G2, 'inf') #ref(2021.09.30-1.jpg,left,noimg,whiteboard #1); #ref(2021.09.30-2.jpg,left,noimg,whiteboard #2); #ref(2021.09.30-3.jpg,left,noimg,whiteboard #3); #ref(2021.09.30-4.jpg,left,noimg,whiteboard #4); -Q: ホワイトボード前の照明が消えており、多少見ずらかったです。 -A: ウェブカメラで白く反射しないよう消してました。次回、ウェブカメラの方を改善します。 ** &color(green){[lecture #5]}; 2021.10.07 relation between LQR and H infinity control problem (2/2) [#f1862c6a] + cont. -- solve the problem by hand -- solve the problem by tool(hinfsyn) + complete the table in simple example + confirm the cost function J for both controllers by simulation &ref(mod1007.mdl); -- block diagram in the simulink model -- how to approximate impulse disturbance with a step function -- (unit) impulse disturbance resp. with zero initial condition = (unit) initial condition resp. with zero disturbance + confirm the closed-loop H infinity norm for both controllers by simulation -- H infinity norm = L2 induced norm -- review: steady-state response for sinusoidal input signal; how to choose the frequency such that the output amplitude is maximized ? -- the worst-case disturbance w(t) for the simple example ? + general state-feedback case: &ref(授業/制御工学特論2015/hinf.pdf); -- includes the simple example as a special case -- LQR &ref(授業/制御工学特論2015/lqr.pdf); is included as a special case in which gamma -> infinity, w(t) = 0, B2 -> B, and non-zero x(0) are considered %-- 2021/10/07 13:24 --% ex0930_1 K sqrt(2-sqrt(2)) mod1007 x0 x0 = 0 f = -1 + sqrt(2) h h = 0.01 zz h h = 0.001 zz zz(end) sqrt(2)-1 x0 x0 = 1 zz(end) h = 10 x0 x0 = 0 f zz zz(end)/ww(end) sqrt(zz(end)/ww(end)) h h = 100 sqrt(zz(end)/ww(end)) f = 1 sqrt(zz(end)/ww(end)) #ref(2021.10.07-1.jpg,left,noimg,whiteboard #1); #ref(2021.10.07-2.jpg,left,noimg,whiteboard #2); #ref(2021.10.07-3.jpg,left,noimg,whiteboard #3); -Q: 日本語での説明を増やしてほしいです。 -A: 今日は少なめでした。前回並に戻します。 -Q: Hインフィニティも万能じゃないことが意外だった -A: good! ** &color(green){[lecture #6]}; 2021.10.14 Mixed sensitivity problem 1/3 [#tf5064b6] + outline: &ref(授業/制御工学特論2017/map_v1.1_mixedsens1.pdf); -- sensitivity function S and complementary sensitivity function T + H infinity control problem (general case) -- with generalized plant G -- including the state-feedback case + reference tracking problem -- how to translate the condition (ii) into one with H infinity norm ? -- corresponding generalized plant G ? -- introduction of weighting function for sensitivity function in (ii) + design example &ref(ex1014_1.m); &ref(ex1014_2.m); + %%the small gain theorem%% -- %%proof: Nyquist stability criterion%% //+ from performance optimization to robust stabilization %-- 2021/10/14 13:43 --% ex1014_1 P eig(P) ex1014_2 K_hinf eig(K) K eig(K_hinf) #ref(2021.10.14-1.jpg,left,noimg,whiteboard #1); #ref(2021.10.14-2.jpg,left,noimg,whiteboard #2); -Q: ナイキスト線図について復習すべきだと感じた -A: してください! ** &color(green){[lecture #7]}; 2021.10.21 Mixed sensitivity problem 2/3 [#b53a27dd] + outline: from point to set &ref(授業/制御工学特論2017/map_v1.1_mixedsens2.pdf); + the small gain theorem ... robust stability = H infinity norm condition + normalized uncertainty Delta + uncertainty model + how to determine P0 and WT -- example: frequency response of plant with perturbation &ref(ex1021_1.m); -- frequency response based procedure for P0 and WT &ref(ex1021_2.m); + robust stabilization problem and equivalent problem -- design example and simulation &ref(ex1021_3.m); &ref(mod1021.mdl); %-- 2021/10/21 13:39 --% ex1021_1 pwd ls cd MATLAB ex1021_1 ex1021_2 #ref(2021.10.21-1.jpg,left,noimg,whiteboard #1); #ref(2021.10.21-2.jpg,left,noimg,whiteboard #2); #ref(2021.10.21-3.jpg,left,noimg,whiteboard #3); #ref(2021.10.21-4.jpg,left,noimg,whiteboard #4); -Q: 英語の説明が多くて難しかったです -A: 基本的に、英語で説明した後に日本語でも説明しているので大丈夫と思いますが、難しかった所を教えてもらえれば補足します。 -Q: Pチルダの説明が難しかったので復習します。 -A: 復習して分からなかったらまた聞いてください。 ** &color(green){[lecture #8]}; 2021.10.28 Mixed sensitivity problem 3/3 [#s7797d49] //- schedule (no lecture will be given on Nov.31) - review: &ref(授業/制御工学特論2017/map_v1.1_mixedsens2.pdf); (1)robust stabilization and (2)performance optimization - outline: ++ how to design controllers considering both conditions in (1) and (2) ++ gap between NP(nominal performance) and RP(robust performance) + mixed sensitivity problem => (1) and (2) : proof + generalized plant for mixed senstivity problem + design example &ref(ex1028_1.m); minimize gamma by hand + gamma iteration by bisection method &ref(ex1028_2.m); + intro. to RP: weak point of mixed sensitivity problem(problem of NP) &ref(ex1028_3.m); %-- 2021/10/28 13:01 --% ex1021_1 ex1021_2 ex1021_3 K mod1021 c c = 0.8 c = 2 ex1028_1 ex1028_2 ex1028_3 #ref(2021.10.28-1.jpg,left,noimg,whiteboard #1); #ref(2021.10.28-2.jpg,left,noimg,whiteboard #2); -Q: まだ一般化プラントへの変換がぱっとできないなと思いました -A: 時間をかけて考えてみてください。不明な点があればまた聞いてください。 ** &color(green){[lecture #9]}; 2021.11.4 robust performance problem 1/3 [#wfe51bdb] -- [[schedule2021]] + review -- mixed sensitivity problem : N.P. but not R.P. //-- robust performance problem (R.P.) c.f. the last whiteboard, but can not be solved by tool //-- the small gain theorem + robust performance problem (R.P.), but can not be solved by tool + an equivalent robust stability (R.S.) problem to R.P. -- (i) introduction of a fictitious uncertainty Delta_p (for performance) -- (ii) for 2-by-2 uncertainty block Delta hat which includes Delta and Delta_p + definition of H infinity norm for general case (MIMO) -- definition of singular values and the maximum singular value M = [sqrt(2), -1i/sqrt(2); sqrt(2), 1i/sqrt(2)] M' eig(M'*M) svd(M) -- mini report #1 &ref(report1.pdf); ... You will have a mini exam #1 related to this report + proof of ||Delta hat||_inf <= 1 + design example: &ref(ex1104_1.m); -- robust performance is achieved but large gap -- non structured uncertainty is considered ... the design problem is too conservative %-- 2021/11/04 13:03 --% ex1028_1 ex1028_2 ex1028_3 M = [sqrt(2), -1i/sqrt(2); sqrt(2), 1i/sqrt(2)] M' eig(M'*M) svd(M) help svd ex1104_1 #ref(2021.11.04-1.jpg,left,noimg,whiteboard #1); #ref(2021.11.04-2.jpg,left,noimg,whiteboard #2); #ref(2021.11.04-3.jpg,left,noimg,whiteboard #3); ** &color(green){[lecture #10]}; 2021.11.11 Robust performance problem (2/3) [#oa064c8a] + return of mini report #1 //+ review //-- robust performance but too conservative // ex1108_1 //-- robust stability problem for Delta hat and its equivalent problem(?) with Delta tilde //-- structured unertainty Delta hat and unstructured uncertainty Delta tilde + SVD: singular value decomposition -- definition -- meaning of the largest singular value (a property and proof) -- 2 norm of vectors (Euclidean norm) -- SVD for 2-by-2 real matrix &ref(ex1111_1.m); %-- 2021/11/11 13:15 --% M = [j, 0; j, 1] [U, Sigma, V] = svd(M) U*Sigma*V' format long e U*Sigma*V' U fomat short help format format U U'*U U*U' ex1111_1 #ref(2021.11.11-1.jpg,left,noimg,whiteboard #1); #ref(2021.11.11-2.jpg,left,noimg,whiteboard #2); #ref(2021.11.11-3.jpg,left,noimg,whiteboard #3); ** &color(green){[lecture #11]}; 2021.11.18 Robust performance problem (3/3) [#y0d0e432] + review : R.S. problems for structured and unstructured uncertainty + scaled H infinity control problem + relation between three problems + how to determine structure of scaling matrix + design example &ref(ex1118_1.m); ex1104_1 gam2 = gam_opt K2 = K_opt; ex1118_1 gam_opt + mini exam #1 (10 min.) %-- 2021/11/18 12:49 --% ex1104_1 ex1118_1 ex1104_1 gam2 = gam_opt K2 = K_opt; ex1118_1 gam_opt gam2 format long gam2 gam_opt #ref(2021.11.18-1.jpg,left,noimg,whiteboard #1); #ref(2021.11.18-2.jpg,left,noimg,whiteboard #2); -Q: スケーリングが等価に扱えるのは便利だと思った -A: 誤解を与えたかもしれません。「スケーリングが等価に扱える」の意味が分からないので、何と等価か、具体的に教えてもらえると助かります。誤解が無いなら良いです。 ** &color(green){[lecture #12]}; 2021.11.25 Robust performance problem (3/3) (cont.), Control system design for practical system (1/3) [#mc66910a] + return of mini exam #1 + review of scaling &ref(ex1125_1.m); + mini report #2 &ref(report2.pdf); + introduction of a practical system: active noise control in duct -- experimental setup #ref(授業/制御工学特論2020/photo1.jpg,left,noimg); #ref(授業/制御工学特論2020/photo2.jpg,left,noimg); -- objective of control system: to drive control loudspeaker by generating proper driving signal u using reference microphone output y such that the error microphone's output z is attenuated against the disturbance input w -- frequency response experiment #ref(ex1125_2.m); &ref(授業/制御工学特論2020/spk1.dat); &ref(授業/制御工学特論2020/spk2.dat); //-- %%room 157 @ Dept. Mech. Bldg. 2%% %-- 2021/11/25 13:03 --% ex1125_1 ex1125_2 346/(4*162) 346/(4*1.62) #ref(2021.11.25-1.jpg,left,noimg,whiteboard #1); #ref(2021.11.25-2.jpg,left,noimg,whiteboard #2); ** &color(green){[lecture #13]}; 2021.12.2 Control system design for practical system (2/3) [#j3c98032] + return of mini report #2; ... You will have a mini exam #2 related to this report next week -- [[schedule2021]] + review of the experimental system -- closed-loop system of 2-by-2 plant G and controller K -- closed-loop gain is desired to be minimized -- frequency response data of G can be used; how to handle modeling error of G ? + design example (modeling error for Gyu is only considered for simplicity) -- frequency response experiment data&br; [[spk1.dat>/:~exp/seigyokougakutokuron_2021/exp/freqresp/1/spk1.dat]]&br; [[spk2.dat>/:~exp/seigyokougakutokuron_2021/exp/freqresp/1/spk2.dat]]&br; -- determination of plant model(nominal plant and additive uncertainty weight)&br; &ref(nominal.m);&br; &ref(n4sid_replaced.m); ... replacement of n4sid in System Identification Toolbox (not provided in IPC)&br; &ref(weight.m); -- configuration of generalized plant and controller design by scaled H infinity control problem using one-dimensional search on the scaling d&br; &ref(cont.m); -- comparison of closed-loop gain characteristics with and without control&br; &ref(compare.m); -- result of control experiment and evaluation&br; [[result.dat>/:~exp/seigyokougakutokuron_2021/exp/design_example/1/result.dat]]&br; &ref(perf.m); + final report and remote experimental system ++design your controller(s) so that the system performance is improved compared with the design example ++Draw the following figures and explain the difference between two control systems &color(red){(your controller and the design example)};: +++bode diagram of controllers +++gain characteristic of closed-loop system from w to z +++time response of control experiment ++Why is the performance of your system improved(or unfortunately deteriorated)? --&size(30){&color(red){due date: 5th(Wed) Jan 17:00};}; --submit your report(pdf file) by e-mail to kobayasi@nagaokaut.ac.jp --You can use Japanese --maximum controller order is 35 --submit your &size(25){&color(red){controller.dat, controller_order.dat, and controller.mat};}; &color(black){&size(30){at this page:[[participant list2021>/:~exp/seigyokougakutokuron_2021]](download is also possible)};}; &size(30){&color(red){not later than 24th(Fri) Dec};}; --the system will be started until next lecture --You can send up to 10 controllers --&size(30){&color(black){[[control experimental results will be uploaded here>/:~exp/seigyokougakutokuron_2021/exp]]};}; --freqresp ... frequency response will be measured and uploaded everyday + how to improve the performance ? -- order of the nominal plant -- weighting for robust stability //+ detailed explanation of m-files in the previous lecture + specifications of the experimental system ++ experimental equipments --- loudspeakers: FOSTEX FE87E(10W) --- A/D, D/A converters: CONTEC AD12-16(PCI), DA12-4(PCI) --- PC: Dell Dimension 1100 --- OS: Linux kernel 2.4.22 / Real Time Linux 3.2-pre3 ++ program sources for frequency response experiment --- [[freqresp.h>/:~exp/seigyokougakutokuron_2021/freqresp.h]] --- [[freqresp_module.c>/:~exp/seigyokougakutokuron_2021/freqresp_module.c]] --- [[freqresp_app.c>/:~exp/seigyokougakutokuron_2021/freqresp_app.c]] --- format of spk1.dat (u is used instead of w for spk2.dat) 1st column ... frequency (Hz) 2nd column ... gain from w(V) to y(V) (signal's unit is voltage (V)) 3rd column ... phase from w to y 4th column ... gain from w to z 5th column ... phase from w to z ++ program sources for control experiment --- [[hinf.h>/:~exp/seigyokougakutokuron_2021/hinf.h]] --- [[hinf_module.c>/:~exp/seigyokougakutokuron_2021/hinf_module.c]] --- [[hinf_app.c>/:~exp/seigyokougakutokuron_2021/hinf_app.c]] --- format of result.dat 1st column: time (s) 2nd column: z (V) 3rd column: y (V) 4th column: u (V) 5th column: w (V) ++ configuration of control experiment --- disturbance signal w is specified as described in hinf.h and hinf_module.c: //#define AMP 0.5 // amplitude for disturbance #define AMP 1.0 // modified 2021.12.9 w = AMP * (2. * rand() / (RAND_MAX + 1.) - 1.); // uniform random number in [-AMP, AMP] da_conv(V_OFFSET + w, 0); // D/A output to noise source --- control signal u is limited to [-3, 3] as specified in hinf.h and hinf_module.c: #define U_MAX 3.00 if(u > U_MAX) u = U_MAX; if(u < -U_MAX) u = -U_MAX; u is set to 0 for t < 5(s). (controller is operated for 5 <= t < 10) %-- 2021/12/02 13:24 --% nominal G0 size(G0.a) weight cont compare perf #ref(2021.12.02-1.jpg,left,noimg,whiteboard #1); ** &color(green){[lecture #14]}; 2021.12.9 Control system design for practical system (3/3) [#o06f6c6c] - web based remote experiment system -- your password were sent by e-mail -- usage; how to upload controller's -- powered by prof. Takebe, National Institute of Technology, Nagaoka College //--- now you can login after registration - supplemental explanations -- room temperature is displayed and stored in temp.txt (Bosch Sensortec BME280 is used) //-- generating wav file [[filter.c>/:~exp/seigyokougakutokuron_2021/filter.c]] (txt2wav.c is used to convert the text file to wav file) -- c2d() is used to discretize the resultant continuous-time controller in cont.m -- You can send up to 10 controllers (don't fall into trial and error; think always about the reason) -- no strict control objective is given ( there is a freedom to define what is good performance; a frequency dependent weighting function can be introduced to evaluate the performance ) - preparation of your own controller(s) by using the remote experiment system - mini exam #2 (14:10-14:20) //■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ //&color(black,red){&size(20){!!! the remaining page is under construction (the contents below are from last year) !!!};}; // ** &color(green){[lecture #15]}; 2021.12.16 Control system design for practical system (cont.) [#m72f126d] - return of mini exam #2 - [[schedule2021]] no lecture will be given next week //--- the system will be unavailable from %%21(Fri)%% &color(red){7:30 on 22(Sat)}; to &color(red){19:00 on}; 22(Sat) due to electrical construction scheduled on 22(sat) - preparation of your own controller(s) by using the remote experiment system //**related links [#g1a68a2b] //-東ティモール工学部復興支援/support of rehabilitation for faculty of eng. National University of Timor-Leste //--[[How to control objects>/:~kobayasi/easttimor/2009/index.html]] to design, to simulate and to experiment control system by using MATLAB/Simulink with an application of Inverted Pendulum //--[[Prof. Kimura's page>http://sessyu.nagaokaut.ac.jp/~kimuralab/index.php?%C0%A9%B8%E6%B9%A9%B3%D8%C6%C3%CF%C0]]