基本信息
源码名称:Matlab模型预测控制工具箱官方指导手册.pdf
源码大小:18.95M
文件格式:.pdf
开发语言:MATLAB
更新时间:2021-04-23
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
本书为MATLAB官方给出的模型预测控制工具箱使用指南,包括代码介绍和模型实例。可供相关研究人员及MPC初学者进行参考。
Contents Control of an Inverted Pendulum on a Cart ...................... 1-117 Thermo-Mechanical Pulping Process with Multiple Control Objectives ........................................................ 1-125 Aircraft with Unstable Poles ................................... 1-133 Model Predictive Control Basics 2 Controller State Estimation ..................................... 2-2 Controller State Variables ..................................... 2-2 State Observer ............................................. 2-3 State Estimation ............................................ 2-3 Built-in Steady-State Kalman Gains Calculation .................... 2-4 Output Variable Prediction .................................... 2-5 Optimization Problem .......................................... 2-7 Overview ................................................. 2-7 Standard Cost Function ...................................... 2-7 Alternative Cost Function ..................................... 2-9 Constraints ............................................... 2-10 QP Matrices .............................................. 2-11 Unconstrained Model Predictive Control ......................... 2-15 QP Solvers .................................................. 2-17 Built-In QP Solvers ......................................... 2-17 Custom QP Solver .......................................... 2-19 Integration with FORCES PRO Solver ........................... 2-22 Controller Refinement 3 Setting Targets for Manipulated Variables ......................... 3-2 Time-Varying Weights and Constraints ............................ 3-5 Time-Varying Weights ........................................ 3-5 Time-Varying Constraints ..................................... 3-6 Constraints on Linear Combinations of Inputs and Outputs ........... 3-7 Use Custom Constraints in Blending Process ...................... 3-11 Terminal Weights and Constraints ............................... 3-20 Provide LQR Performance Using Terminal Penalty Weights .......... 3-22 Adjust Disturbance and Noise Models ............................ 3-27 Overview ................................................ 3-27 vi Contents Output Disturbance Model ................................... 3-27 Measurement Noise Model ................................... 3-29 Input Disturbance Model .................................... 3-30 Restrictions .............................................. 3-32 Disturbance Rejection Tuning ................................. 3-32 Custom State Estimation ...................................... 3-34 Manipulated Variable Blocking ................................. 3-39 Specify Blocking Interval Lengths .............................. 3-39 Interpolate Block Moves for Nonlinear MPC ...................... 3-41 Specifying Alternative Cost Function with 2ffDLDJonDl Weight Matrices ......................................................... 3-43 Controller Analysis 4 Review Model Predictive Controller for Stability and Robustness Issues .......................................................... 4-2 Test Controller Robustness ..................................... 4-17 Compute Steady-State Gain .................................... 4-26 Extract Controller ............................................ 4-28 Compare Multiple Controller Responses Using MPC Designer ........ 4-30 Adjust Input and Output Weights Based on Sensitivity Analysis ....... 4-39 Understanding Control Behavior by Examining Optimal Control Sequence ......................................................... 4-44 Controller Simulation 5 Simulate Controller with Nonlinear Plant .......................... 5-2 Nonlinear CSTR Application ................................... 5-2 Example Code for Successive Linearization ........................ 5-2 CSTR Results and Discussion .................................. 5-4 Test an Existing Controller ...................................... 5-7 Generate Simulink Model from MPC Designer ..................... 5-10 Signal Previewing ............................................ 5-12 vii Improving Control Performance with Look-Ahead (Previewing) ....... 5-13 Simulating Model Predictive Controller with Plant Model Mismatch . . 5-20 Update Constraints at Run Time ................................ 5-23 Update Bounds on Input and Output Signals at Run Time ............ 5-23 Update Mixed Input/Output Constraints at Run Time ............... 5-24 Vary Input and Output Bounds at Run Time ....................... 5-26 Tune Weights at Run Time ..................................... 5-31 Tuning Controller Weights ..................................... 5-32 Adjust Horizons at Run Time ................................... 5-37 Adjust Horizons in MATLAB .................................. 5-37 Adjust Horizons in Simulink .................................. 5-37 Code Generation ........................................... 5-37 Effect on Time-Varying Controller Parameters ..................... 5-38 Evaluate Control Performance Using Run-Time Horizon Adjustment ... 5-40 Switch Controller Online and 2Lne with Bumpless Transfer ........ 5-49 Switching Controllers Based on Optimal Costs .................... 5-59 Monitoring Optimization Status to Detect Controller Failures ........ 5-65 Simulate MPC Controller with a Custom QP Solver ................. 5-69 Use Suboptimal Solution in Fast MPC Applications ................. 5-78 Design and Cosimulate Control of High-Fidelity Distillation Tower with Aspen Plus Dynamics ....................................... 5-85 Adaptive MPC Design 6 Adaptive MPC ................................................. 6-2 When to Use Adaptive MPC ................................... 6-2 Plant Model ............................................... 6-2 Nominal Operating Point ..................................... 6-3 State Estimation ............................................ 6-3 Model Updating Strategy ....................................... 6-5 Overview ................................................. 6-5 Other Considerations ........................................ 6-5 Adaptive MPC Control of Nonlinear Chemical Reactor Using Successive Linearization ............................................... 6-7 viii Contents Adaptive MPC Control of Nonlinear Chemical Reactor Using Online Model Estimation .......................................... 6-17 Adaptive MPC Control of Nonlinear Chemical Reactor Using Linear Parameter-Varying System ................................... 6-27 Obstacle Avoidance Using Adaptive Model Predictive Control ........ 6-38 Time-Varying MPC ............................................ 6-49 When to Use Time-Varying MPC ............................... 6-49 Time-Varying Prediction Models ............................... 6-49 Time-Varying Nominal Conditions .............................. 6-50 State Estimation ........................................... 6-51 Time-Varying MPC Control of a Time-Varying Plant ................. 6-52 Time-Varying MPC Control of an Inverted Pendulum on a Cart ....... 6-58 Explicit MPC Design 7 Explicit MPC .................................................. 7-2 Design WorkfloZ for Explicit MPC ................................ 7-4 Traditional (Implicit) MPC Design ............................... 7-4 Explicit MPC Generation ..................................... 7-4 Explicit MPC Simplification ................................... 7-5 Implementation ............................................ 7-5 Simulation ................................................ 7-6 Explicit MPC Control of a Single-Input-Single-Output Plant .......... 7-7 Explicit MPC Control of an Aircraft with Unstable Poles ............. 7-17 Explicit MPC Control of DC Servomotor with Constraint on Unmeasured Output ................................................... 7-24 Explicit MPC Control of an Inverted Pendulum on a Cart ............ 7-33 Gain Scheduling MPC Design 8 Gain-Scheduled MPC ........................................... 8-2 Design Workflow ............................................ 8-2 Schedule Controllers at Multiple Operating Points .................. 8-4 Gain-Scheduled MPC Control of Nonlinear Chemical Reactor ........ 8-22 ix Gain-Scheduled Implicit and Explicit MPC Control of Mass-Spring System ......................................................... 8-42 Gain-Scheduled MPC Control of an Inverted Pendulum on a Cart ..... 8-58 Code Generation 9 Generate Code and Deploy Controller to Real-Time Targets ........... 9-2 Code Generation in MATLAB .................................. 9-2 Code Generation in Simulink .................................. 9-2 Sampling Rate in Real-Time Environment ......................... 9-3 QP Problem Construction for Generated C Code .................... 9-4 Code Generation for Custom QP Solvers .......................... 9-5 Simulation and Code Generation Using Simulink Coder .............. 9-7 Simulation and Structured Text Generation Using Simulink PLC Coder ......................................................... 9-14 Using MPC Controller Block Inside Function-Call and Triggered Subsystems ................................................ 9-21 Generate Code to Compute Optimal MPC Moves in MATLAB ......... 9-33 Solve Custom MPC Quadratic Programming Problem and Generate Code ......................................................... 9-39 Simulate and Generate Code for MPC Controller with Custom QP Solver ......................................................... 9-49 Real-Time Control with OPC Toolbox ............................. 9-56 Implement MPC Controllers using Embotech FORCES PRO Solvers ... 9-60 Embotech Quadratic Programming (QP) Solver .................... 9-60 Embotech Nonlinear Programming (NLP) Solver .................. 9-61 Nonlinear MPC 10 Nonlinear MPC .............................................. 10-2 Specify Prediction Model for Nonlinear MPC ...................... 10-4 State Function ............................................ 10-4 Output Function ........................................... 10-7 Specify Optional Model Parameters ............................ 10-9 Augment Prediction Model with Unmeasured Disturbances .......... 10-9 x Contents Specify Cost Function for Nonlinear MPC ........................ 10-11 Custom Cost Function ..................................... 10-11 Cost Function Jacobian ..................................... 10-15 Specify Constraints for Nonlinear MPC .......................... 10-18 Standard Linear Constraints ................................. 10-18 Custom Constraints ....................................... 10-19 Custom Constraint Jacobians ................................ 10-23 ConfiJure Optimization Solver for Nonlinear MPC ................ 10-26 Solver Decision Variables ................................... 10-26 Specify Initial Guesses ..................................... 10-26 Configure fmincon Options .................................. 10-26 Specify Custom Solver ..................................... 10-27 Trajectory Optimization and Control of Flying Robot Using Nonlinear MPC .................................................... 10-31 Swing-up Control of a Pendulum Using Nonlinear Model Predictive Control .................................................. 10-42 Nonlinear Model Predictive Control of an Exothermic Chemical Reactor ........................................................ 10-55 Optimizing Tuberculosis Treatment Using Nonlinear MPC with a Custom Solver ................................................... 10-62 Nonlinear and Gain-Scheduled MPC Control of an Ethylene Oxidation Plant .................................................... 10-70 Optimization and Control of a Fed-Batch Reactor Using Nonlinear MPC ........................................................ 10-79 Lane Following Using Nonlinear Model Predictive Control .......... 10-89 Lane Change Assist Using Nonlinear Model Predictive Control ...... 10-96 Control of Quadrotor Using Nonlinear Model Predictive Control .... 10-106 Economic MPC ............................................. 10-112 Economic MPC Control of Ethylene Oxide Production ............. 10-114 Automated Driving Applications 11 Automated Driving Using Model Predictive Control ................ 11-2 Simulation in Simulink ...................................... 11-3 Controller Customization .................................... 11-3 Integration with Automated Driving Toolbox ...................... 11-4 xi Adaptive Cruise Control System Using Model Predictive Control ...... 11-5 Adaptive Cruise Control with Sensor Fusion ...................... 11-10 Lane Keeping Assist System Using Model Predictive Control ........ 11-28 Lane Keeping Assist with Lane Detection ........................ 11-33 Lane Following Control with Sensor Fusion and Lane Detection ..... 11-47 Highway Lane Following ...................................... 11-57 Highway Lane Change ........................................ 11-72 Automate Testing for Highway Lane Following .................... 11-91 Highway Lane Following with Intelligent Vehicles ................ 11-101 Parking Valet Using Nonlinear Model Predictive Control .......... 11-119 Parallel Parking Using Nonlinear Model Predictive Control ........ 11-128 Parallel Parking Using RRT Planner and MPC Tracking Controller . . 11-141 TrDffLc Light Negotiation .................................... 11-150 TrDffLc Light Negotiation with Unreal Engine Visualization ........ 11-164