AdvancedElectricalControlLab.DepartmentofElectricalEngineeringNationalChung-HsingUniversityAdvancedElectricalControlLab.DepartmentofElectricalEngineeringNationalChung-HsingUniversityAdvancedElectricalControlLab.DepartmentofElectricalEngineAdvancedElectricalControlLab.DepartmentofElectricalEngineeringNationalChungeringNationalChung--HsingUniversityHsingUniversityPID控制器設計(一)~時域規格控制與MATLAB模擬~自動控制實驗Lecture09DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.章節目的本章節旨在介紹最為廣泛應用的PID控制器及其應用課程內容除了介紹控制器外,並針對如何設計並使用控制器調整系統輸出,使系統能吻合目標之暫態/穩態之時域/頻域規格。實驗主要是將PID控制器應用於常見的一階及二階閉迴路系統進行控制藉由分別觀察P、I、D控制器的組合對閉迴路系統的影響,學習上述幾種控制器之使用DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.課程綱要控制器簡介時域規格分析(複習)PID控制器PID參數調整設計範例隨堂演練[補充]PIV控制DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.控制器簡介控制器(controller)是一個調整發送至致動器(actuator)的輸出信號,用以改變受控體(plant)狀況的裝置可依據感測器(sensor)信號回授之有無區分為開路與閉迴路控制回授控制器依設計方式區分,可列出下列常見之架構:PID控制器(時域)PhaseLead-Lag控制器(頻域)狀態控制器(狀態空間回授)(此處將針對PID控制器進行介紹)DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.閉迴路(反饋)控制閉迴路控制中,主要又可分為前饋與反饋兩大類控制器把輸出物理量的值與所給的命令值(目標值)相比較,求其差,由控制器產生控制命令,使輸出物理量的值與所給的命令值一致。DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.時域響應分析與暫態規格(複習)系統響應是指系統針對其輸入而產生相對應的輸出結果對於系統的暫態響應,可以使用暫態規格條件來描述其暫態響應當系統的響應無法達到目標時,此時會再加上控制器進行設計,以使系統能達到控制目標常見的暫態規格包括:上升時間(risetime,tr):系統由終值的10%上升至90%所需的時間延遲時間(delaytime,td):系統上升至終值的50%所需的時間安定時間(settlingtime,ts):系統震盪小於終值特定百分比所需時間最大超越量(maximumpercentageovershoot,Mo):最大峰值百分比尖峰時間(peaktime,tp):最大峰值所在的時間點DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.標準一階系統的暫態規格(複習)2.20.69rdtataaGssaDepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.標準二階系統的暫態規格(複習)2211.83(5%)4(2%)4.6(1%)1100%10.7rnsnnnPnOdntttMet2222nnnGsssDepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.cosn21dnn0j21nnsjDepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.系統的穩態誤差(複習)在穩定狀態下,穩定輸出與控制輸入的差值定義為穩態誤差(Steadystateerror)L00limlimlimlim1ssttsssseetrtytsesEsRsGs∞∞斜坡訊號0∞步階訊號00脈衝訊號210Type輸入訊號11PK1VK1aK0200limlimPVsasKGKsGsKsGsDepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.PID控制器(1/2)PID控制器(Proportional-Integral-Derivativecontroller/比例-積分-微分控制器),由比例控制單元P、積分控制單元I和微分控制單元D組成,是工業上最常用之控制器主要通過KP、KI和KD三個參數的設定來調整系統特性PID控制器主要適用於線性、非時變之系統(LTISystem)2ICPDPIDKGsKKssKsKKss其中KP、KI、KD分別代表了位置、積分與微分控制器的可調參數數學模型(轉移函數)DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.PID控制器(2/2)主要有三個可調參數,各參數都可作為獨立控制器使用位置(P)控制器可使響應速度變快,稍微改善穩態誤差積分(I)控制器可改善穩態誤差,但過大會造成響應峰值變大過小會使系統之響應速度變慢微分(D)控制器相當於一個高通濾波器,可改善暫態響應加入微分控制器後,對步階輸入而言,系統之響應在起始瞬間會有一個很大的峰值;而隨著時間增加,系統響應將遞減至0一般而言,位置、積分與微分控制器都會混合搭配使用DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.系統架構假設取一階閉迴路系統如下:此時閉迴路系統轉移函數可表示為:()b()s(ab)oiVsVs下面將針對加入不同控制器的情形來進行探討。DepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.I、比例控制器P-controllerPK此時閉迴路系統轉移函數可表示為:()b()s(ab)oPiPVsKVsKDepartmentofElectricalEngineeringNationalChungHsingUniverDepartmentofElectricalEngineeringNationalChungHsingUniversitysityAdvancedElectricalControlLab.AdvancedElectricalControlLab.加上比例控制器後,極點(Pole)會由變為也就是時間常數(timeconstant)將由變為當控制參數Kp越大時,時間常數也就越小、響應也就越快比例控制器除了能使響應加速之外,也能使穩態誤差(steadystateerror)由變為,當KP1時,Kp越大則越小綜合上面所述,可以得到下面的結論:加上P-controller可使響應速度變快加上P-controller可以改善穩態誤差,但仍存在()ab()PabK1()ab1()PabKaabPaabKPaabKDepartmentofElectricalEngineeringNationalChu