1 Type"mpclibdemo'"in the command window 2 Choose one of the tutorial examples 3 Examine the Simulink mdl file and the matlab m file for the demo 4 Try it with your own applications! ly Start The following sections of this document provide tutorial examples and additional details If possible, work through the steps in MATLAB/Simulink as you read
1 Introduction 1-4 Quick Start 1 Type “mpclibdemo” in the command window. 2 Choose one of the tutorial examples. 3 Examine the Simulink MDL file and the Matlab M file for the demo. 4 Try it with your own applications! Leisurely Start The following sections of this document provide tutorial examples and additional details. If possible, work through the steps in MATLAB/Simulink as you read
MPC Fundamentals MPC Fundamentals This section reviews MPC concepts and defines key terms. If you re already familiar with MPC you may prefer to read Chapter 2, "MPC Worksheet Basics"next Overview: single-input, single-output(SISO)MPC Figure 1-l shows a situation in which MPC is trying to hold a single variable, y, at a target value, r, by adjusting the"manipulated variable"(or"")u See Table 1-1 for a brief description of the signals appearing in Figure 1-1 The box labeled"plant"is the real process or mechanism that produces y. It responds to changes in u as well as to two types of disturbance signals: measured, v, and unmeasured, d (Some applications have unmeasured disturbances only; the v signal is optional. The unmeasured disturbance represents the usual mysterious events that upset plant operation, causing variations in y. The only sign that such an event has occured is a change in the measured output,y Measured Disturbance Noise Actuator MPC Plant Disturbance Measured Output( Controlled Variable) Figure 1-1 Block diagram of a single-input, single-output MPC application
MPC Fundamentals 1-5 MPC Fundamentals This section reviews MPC concepts and defines key terms. If you’re already familiar with MPC you may prefer to read Chapter 2, “MPC Worksheet Basics” next. Overview: single-input, single-output (SISO) MPC Figure 1-1 shows a situation in which MPC is trying to hold a single variable, , at a target value, r, by adjusting the “manipulated variable” (or “actuator”) u. See Table 1-1 for a brief description of the signals appearing in Figure 1-1. The box labeled “plant” is the real process or mechanism that produces . It responds to changes in u as well as to two types of disturbance signals: measured, v, and unmeasured, d. (Some applications have unmeasured disturbances only; the v signal is optional.) The unmeasured disturbance represents the usual mysterious events that upset plant operation, causing variations in . The only sign that such an event has occured is a change in the measured output, y. Figure 1-1 Block diagram of a single-input, single-output MPC application. y y y + + MPC Plant v r y d z y y u v Measured Disturbance Measured Output (Controlled Variable) Noise Setpoint Unmeasured Disturbance Actuator Plant Output
ntre Table 1-1 Summary of MPC signals(see also Figure 1-1). Symbol Description d Unmeasured disturbance. a disturbance unknown to MPC that affects the plant output. MPC provides feedback compensation r Setpoint (or reference signal). The target value for the Actuator (or manipulated variable). The signal MPC adjusts in order to achieve its control objectives Measured disturbance(optional). MPC feedforward compensation adjusts for such disturbances as they occur to minimize their impact on the controlled variable Controlled variable( or plant output). The signal to be held at the setpoint. This is the"true"value, uncorrupted by measurement noise Measurement of the controlled variable. Used to estimate the true value, y z Measurement noise Represents electrical noise, sampling errors,drifting calibration, and other effects that reduce the accuracy of the measurement The measured disturbance also affects y. The MPC block includes models of the way in which v and u affect y(symbolically, v-y and u-y). It uses this information to calculate u adjustments that keep y at its setpoint in spite of the(known)disturbance. This calculation considers the effect of any known constraints on the adjustments(e.g,an actuator at its upper or lower bound). If the models are accurate and the plant responds quickly to u, this"feedforward" compensation counteracts the effect of v perfectly
1 Introduction 1-6 The measured disturbance also affects . The MPC block includes models of the way in which v and u affect (symbolically, and ). It uses this information to calculate u adjustments that keep at its setpoint in spite of the (known) disturbance. This calculation considers the effect of any known constraints on the adjustments (e.g., an actuator at its upper or lower bound). If the models are accurate and the plant responds quickly to u, this “feedforward” compensation counteracts the effect of v perfectly. Table 1-1 Summary of MPC signals (see also Figure 1-1). Symbol Description d Unmeasured disturbance. A disturbance unknown to MPC that affects the plant output. MPC provides feedback compensation for such disturbances. r Setpoint (or reference signal). The target value for the controlled variable. u Actuator (or manipulated variable). The signal MPC adjusts in order to achieve its control objectives. v Measured disturbance (optional). MPC feedforward compensation adjusts for such disturbances as they occur to minimize their impact on the controlled variable. Controlled variable (or plant output). The signal to be held at the setpoint. This is the “true” value, uncorrupted by measurement noise. y Measurement of the controlled variable. Used to estimate the true value, . z Measurement noise. Represents electrical noise, sampling errors, drifting calibration, and other effects that reduce the accuracy of the measurement. y y y y v y ® u y ® y
MPC Fundamentals NOTE: One may also specify bounds on y. These constraint-handling properties are a distinguishing feature of MPC and can be particularly valuable when one has multiple control objectives to be achieved via multiple adjustments In reality, however, model imperfections, plant limitations, and unmeasured disturbances cause the measurement, y, to deviate from its expected value. Thus, MPC uses the output measurement and a"disturbance model"(d->y)to predict future changes in y. It then uses its u>y model to calculate appropriate adjustments(a form of feedback compensation). This calculation also considers the known constraints Various types of "noise" can corrupt the measurement. The signal z in Figure 1-1 represents such effects. They may vary randomly about a zero mean or exhibit a non-zero, drifting bias.MPC uses a :>y model in combination with its d-j model to remove the estimated noise component of the measurement("filtering") The above feedforward/feed back actions are mPC's"regulator mode. MPC also has a servo" mode, i.e., it adjusts u such that y tracks a time-varying setpoint. The tracking accuracy depends on the plant characteristics(including constraints), the accuracy of the l-y model, and whether or not future setpoint variations can be anticipated, i.e., known Details: siso case Sampling period and sampling instants MPC operates at discrete intervals of Af time units, the"sampling period. " Suppose that MPC starts at time t=0. The "sampling instants"are the times at which MPC adjusts the manipulated variable, u. They are integer multiples of the sampling period: 0, 4t, 24t, 341, kAt, where the integer index, k, represents the current sampling instant
MPC Fundamentals 1-7 NOTE: One may also specify bounds on . These constraint-handling properties are a distinguishing feature of MPC and can be particularly valuable when one has multiple control objectives to be achieved via multiple adjustments. In reality, however, model imperfections, plant limitations, and unmeasured disturbances cause the measurement, y, to deviate from its expected value. Thus, MPC uses the output measurement and a “disturbance model” ( ) to predict future changes in . It then uses its model to calculate appropriate adjustments (a form of “feedback” compensation). This calculation also considers the known constraints. Various types of “noise” can corrupt the measurement. The signalz in Figure 1-1 represents such effects. They may vary randomly about a zero mean or exhibit a non-zero, drifting bias. MPC uses a model in combination with its model to remove the estimated noise component of the measurement (“filtering”). The above feedforward/feedback actions are MPC’s “regulator” mode. MPC also has a “servo” mode, i.e., it adjusts u such that tracks a time-varying setpoint. The tracking accuracy depends on the plant characteristics (including constraints), the accuracy of the model, and whether or not future setpoint variations can be anticipated, i.e., known in advance. Details: SISO case Sampling period and sampling instants MPC operates at discrete intervals of Dt time units, the “sampling period.” Suppose that MPC starts at time t = 0. The “sampling instants” are the times at which MPC adjusts the manipulated variable, u. They are integer multiples of the sampling period: 0,Dt, 2Dt, 3Dt, ..., kDt, where the integer index, k, represents the current sampling instant. y d y ® y u y ® z y ® d y ® y u y ®
ast t future Reference r(t+k) Predicted outputs y(t+kt) output horizon t+l Manipulated u(t+k Inputs input horizon Figure 1-2 The MPC problem at the the sampling instant t An mPc pling instant for some time; k is the current sampling instant. The current measured output, 3, and a Figure 1-2 shows the state of a hypothetical SISO MPC system which has been operatin previous measurements, yk-l,yk.2,,are known and are the filled circles in Figure 1-2(a) The current measured disturbance, d, and its past values are also known(not shown
1 Introduction 1-8 Figure 1-2 The MPC problem at the the sampling instant t. An MPC sampling instant Figure 1-2 shows the state of a hypothetical SISO MPC system which has been operating for some time; k is the current sampling instant. The current measured output, yk , and previous measurements, yk-1, yk-2, ..., are known and are the filled circles in Figure 1-2 (a). The current measured disturbance, dk , and its past values are also known (not shown). (b) (a) input horizon output horizon t t+1 past future t t+1 t+m t+p Predicted outputs y(t+k|t) t+m t+p Manipulated (t u k+ ) Inputs Reference r(t+k) umin umax