MPC-maltab----MPC的参数

In this video, we’ll talk about MPC design parameters. Choosing proper values for these parameters is important as they affect not only the controller performance but also the computational complexity of the MPC algorithm that solves an online optimization problem at each time step. Here, we’ll give you some recommendations on how to choose the controller sample time, prediction and control horizons, constraints, and weights. By choosing the sample time, we determine the rate at which the controller executes the control algorithm. If it’s too big, when a disturbance comes in, the controller won’t be able to react to the disturbance fast enough. On the contrary, if the sample time is too small, the controller can react much faster to disturbances and setpoint changes, but this causes an excessive computational load. To find the right balance between performance and computational effort, the recommendation is to fit 10 to 20 samples within the rise time of the open-loop system response.  

在本视频中,我们将讨论MPC设计参数。为这些参数选择合适的值很重要,因为它们不仅影响控制器性能,而且还影响MPC算法的计算复杂度,MPC算法在每个时间步解决在线优化问题。在这里,我们将为您提供一些关于如何选择控制器采样时间、预测和控制范围、约束和权重的建议。通过选择采样时间,我们确定控制器执行控制算法的速率。如果干扰太大,当干扰进来时,控制器将无法对干扰做出足够快的反应。相反,如果采样时间太小,控制器可以对干扰和设定点变化做出更快的反应,但这会导致计算负载过大。为了在性能和计算工作量之间找到正确的平衡,建议在开环系统响应的上升时间内拟合10到20个样本。

As we’ve discussed previously, at each time step, the MPC controller makes predictions about the future plant output, and the optimizer finds the optimal sequence of control inputs that drives the predicted plant output as close to the setpoint as possible. The number of predicted future time steps is called the prediction horizon and shows how far the controller predicts into the future. What happens if it’s too short? Think of the following example. While going at 50 mph, you know that it will take your car 5 seconds to stop if you press on the brake pedal. If your prediction horizon is 2 seconds, by the time you see the traffic lights, it will be too late to apply the brakes. The car will only be able to stop after passing the traffic lights. So, we should choose a prediction horizon that will cover the significant dynamics of the system. Why don’t we select a much longer prediction horizon, then? Say you’ve predicted your speed far into the future in order to try to get to your destination on time. Unexpected things can happen, such as boxes falling from the back of a truck, pedestrians crossing the road, or a change in the road profile; these all may affect your speed and you may need to throw away a significant part of your planning, wasting your computations. Assuming the sample time is chosen based on what we’ve discussed before, the recommendation for choosing the prediction horizon is to have 20 to 30 samples covering the open-loop transient system response.  

正如我们前面所讨论的,在每个时间步,MPC控制器都会对未来的电厂输出进行预测,优化器会找到控制输入的最佳顺序,从而使预测的电厂输出尽可能接近设定点。预测的未来时间步数称为预测视界,显示控制器预测未来的距离。如果太短怎么办?想想下面的例子。当你以每小时50英里的速度行驶时,你知道如果你踩下制动踏板,你的车需要5秒钟才能停下来。如果你的预测范围是2秒,当你看到交通信号灯时,踩刹车就太晚了。汽车只有在通过交通灯后才能停下来。因此,我们应该选择一个涵盖系统重大动态的预测范围。那么,我们为什么不选择一个更长的预测期呢?假设你已经预测了你在未来很长一段时间内的速度,以便准时到达目的地。意外事件可能发生,例如箱子从卡车后部掉落、行人横穿道路或道路轮廓发生变化;这些都可能会影响你的速度,你可能需要扔掉计划中的一大部分,浪费你的计算。假设采样时间是根据我们之前讨论的内容选择的,选择预测范围的建议是有20到30个样本覆盖开环瞬态系统响应。

Another design parameter is the control horizon. If this is the set of future control actions leading to this predicted plant output, the number of control moves to time step m are called the control horizon. The rest of the inputs are held constant. Each control move in the control horizon can be thought of as a free variable that needs to be computed by the optimizer. So, the smaller the control horizon, the fewer the computations. Why don’t we always choose a control horizon of 1 then? We can, but it might not give us the best possible maneuver. And by increasing the control horizon, we can get better predictions but at the cost of increasing the complexity. We can even choose to make the control horizon the same as the prediction horizon. However, note that usually only the first couple of control moves have a significant effect on the predicted output behavior, while the remaining moves have only a minor effect. Therefore, choosing a really large control horizon only increases computational complexity. A good rule of thumb for choosing the control horizon is setting it to 10 to 20% of the prediction horizon and having minimum 2-3 steps. 

另一个设计参数是控制范围。如果这是导致该预测电厂输出的未来控制措施集,则移动到时间步长m的控制数量称为控制范围。其余的输入保持不变。控制范围内的每个控制移动都可以看作是一个自由变量,需要由优化器计算。因此,控制范围越小,计算就越少。那么为什么我们不总是选择1作为控制范围呢?我们可以,但它可能不会给我们最好的策略。通过增加控制范围,我们可以得到更好的预测,但代价是增加复杂性。我们甚至可以选择使控制范围与预测范围相同。但是,请注意,通常只有前两个控件移动对预测的输出行为有显著影响,而其余移动的影响较小。因此,选择一个非常大的控制范围只会增加计算复杂性。选择控制范围的一个很好的经验法则是将其设置为预测范围的10%到20%,并且至少有2-3个步骤。

MPC can incorporate constraints on the inputs, the rate of change of inputs, and the outputs. These can be either soft or hard constraints. Hard constraints cannot be violated, whereas soft constraints can be violated. Let’s say that an MPC controller controls the speed of this car by adjusting the gas pedal. Since there’s a physical limit on how much the gas pedal can be moved, we want to have a hard constraint so that the gas pedal position stays within this range. We may also want to enforce the speed to stay between certain values. However,  having hard constraints on both inputs and outputs is not a good idea because these constraints may conflict with each other, leading to an unfeasible solution for the optimization problem. Here’s a scenario to demonstrate such a situation. Assume that the car is going 50 mph on the highway, where the speed limits are as shown. When the car starts climbing a hill, its speed will decrease. The controller will apply more throttle to increase the speed. But due to the heavy load on top of the car, the speed will keep decreasing even though the controller applies full throttle. So, if the speed constraint is hard, the optimizer won’t be able to find a feasible solution that meets both input and output constraints. However, if the speed constraint is soft, the controller will allow violating it until the car overcomes the hill and the conflict won’t occur. Note that to keep the violation of the soft constraint small, it is being minimized by the optimization problem. The recommendation is to set output constraints as soft and avoid having hard constraints both on the inputs and the rate of change of the inputs.  

MPC可以包含对输入、输入变化率和输出的约束。这些约束可以是软约束,也可以是硬约束。不能违反硬约束,而可以违反软约束。假设MPC控制器通过调节油门来控制这辆车的速度。由于油门的移动量有一个物理限制,我们希望有一个硬约束,使油门位置保持在这个范围内。我们可能还希望强制速度保持在特定值之间。然而,对输入和输出都有硬约束不是一个好主意,因为这些约束可能相互冲突,导致优化问题的不可行解决方案。下面是一个演示这种情况的场景。假设汽车在高速公路上以每小时50英里的速度行驶,限速如图所示。当汽车开始爬山时,速度会降低。控制器将施加更多油门以提高速度。但由于车顶负载过重,即使控制器开足油门,速度也会持续下降。因此,如果速度约束很难,优化器将无法找到同时满足输入和输出约束的可行解决方案。然而,如果速度限制是软的,控制器将允许违反它,直到汽车越过山坡,冲突不会发生。注意,为了保持对软约束的违反较小,通过优化问题将其最小化。建议将输出约束设置为软约束,避免对输入和输入的变化率都有硬约束。

We have multiple goals in life. Some of them might be sleeping, eating, hanging out with friends, and earning money. How would do you manage your time to complete all these goals? You can assign weights. If, for example, sleeping is more important to you than eating, then you would weigh sleeping higher against eating. Similarly, MPC has multiple goals. We want the outputs to track as close as possible to their setpoints, but at the same time we want to have smooth control moves to avoid aggressive control maneuvers. The way to achieve a balanced performance between these competing goals is to weigh the input rates and outputs relative to each other. We not only weigh these two groups relative to each other but we also adjust relative weights within the groups as well. For example, if, in this 2x2 system, it is more critical to perform reference tracking of the first output than the second output, we assign a larger weight to the first output and the ratio between the outputs is greater than 1.

 我们在生活中有多重目标。他们中的一些人可能在睡觉、吃饭、和朋友出去玩、挣钱。你将如何管理你的时间来完成所有这些目标?可以指定权重。例如,如果睡觉对你来说比吃饭更重要,那么你会把睡觉和吃饭放在更高的位置。类似地,MPC有多个目标。我们希望输出跟踪尽可能接近其设定点,但同时我们希望控制动作平稳,以避免激进的控制动作。在这些相互竞争的目标之间实现平衡绩效的方法是权衡相互之间的输入率和输出。我们不仅对这两组进行相对称重,而且还调整组内的相对权重。例如,如果在这个2x2系统中,对第一个输出执行参考跟踪比对第二个输出执行参考跟踪更为关键,则我们为第一个输出分配更大的权重,并且输出之间的比率大于1。

In this video, we’ve explained the parameters that need to be selected for designing MPC controllers. For more information, you can check out Professor Bemporad’s video on how to design model predictive controllers and the links given in the video descriptions. In the next video, we’ll discuss what methods you can use when you’re dealing with nonlinearity either in the plant or the constraints, and the cost function. 

在本视频中,我们解释了设计MPC控制器时需要选择的参数。有关更多信息,您可以查看Bemporad教授关于如何设计模型预测控制器的视频以及视频描述中给出的链接。在下一个视频中,我们将讨论在处理工厂或约束中的非线性以及成本函数时可以使用的方法。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值