理解模型预测控制,第7部分:货币政策委员会自适应设计与仿真软件和模型预测控制工具箱万博1manbetx
从系列:理解模型预测控制
Melda Ulusoy, MathWorks
在这个视频中,您将学习如何设计一个自适应MPC控制器自主驾驶车辆系统的动力学变化对纵向速度。
后为最可能的操作条件设计一个MPC控制器的控制系统,可以实现基于自适应MPC控制器的设计。货币政策委员会在每个时间步,自适应更新植物模型和名义条件为当前操作条件。在这个视频中,您将学习如何计算和更新所需的离散植物模型自适应MPC块。您还将了解如何从自适应MPC控制器生成代码,你会看到一个例子显示一个真正的无人驾驶汽车,使用MPC控制和图像处理算法本身在其道。
在这个视频中,我们将使用自适应MPC自动引导车的车辆横向动力学改变随着时间的推移,由于不同的纵向速度。在前面的视频中,我们讨论了线性横向车辆动力学和假定汽车有一个常数纵向速度。所以,植物动力没有改变,状态矩阵A,是常数。来控制该系统,我们使用传统的MPC控制器。但现在我们将让纵向速度不同的汽车旅行。因此,状态矩阵将发生变化。传统MPC控制器不是有效地处理不同的动力,因为它使用一个常数内部工厂模型。所以,我们如何处理植物动力学的变化?第4部分视频中,我们讨论了自适应MPC可以提供一种新的线性植物模型在每个时间步的操作条件改变,因此在新的操作条件更准确的预测。处理植物动力学的变化,我们要用自适应MPC。
我们打开一个新的仿真软件模型万博1manbetx,开始通过增加植物从这个自定义库。在之前的视频,开发植物状态空间系统的转向角的输入和输出侧位置和偏航角。这一次与纵向速度的动态变化。因此,现在变成了一个植物块的输入。我们要连接一个常数块的纵向速度我们最初设置为15米/秒,后来更改到另一个值。另一个输出是我们将使用后的状态。如果你想看看块下面,看看他们,你可以下载这个仿真软件模型中给出的链接视频描述。万博1manbetx接下来,我们将连接下的自适应MPC块模型预测控制工具箱。这一块相同的输入和输出普通MPC块除了它也需要工厂更新模型,在每个时间步长为当前操作条件。以前,我们设计了一个自定义参考横向位置和偏航角。 We’ll first connect this reference to the controller. Then we connect the plant output to the measured outputs and the steering angle to the controller output. To implement the adaptive MPC, we can simply start with the MPC controller that we designed in the previous video for a longitudinal velocity of 15 m/s. We already have the MPC controller object in our workspace. By typing it in the command window, we can see the design parameters such as the prediction and control horizons, constraints and weights. One thing to note is that the adaptive MPC block requires a discrete plant model. So, we need to convert the continuous time state space model used by mpc1 to discrete time. There are different ways to do it. Here, we use the c2d command and update the plant model of the MPC object with the discretized plant. Now, we go back to the adaptive MPC block and type in the MPC object. Next, we need to provide the controller with a plant model that is updated at each time step for the current operating condition. The pre-built update plant model block takes care of this calculation. When we double click on it, we see that it has been implemented as a MATLAB function. As inputs, this function takes Vx, u and x and first calculates the state space matrices. It then computes the discrete model and also updates the nominal conditions with the current operating conditions. Now it’s time to connect the inputs and outputs for this block. We already have all the inputs here, longitudinal velocity, the steering angle and the states. The “model” input of the adaptive MPC control block requires the discrete-time model and nominal conditions in this order that we’ve created in the MATLAB function. To connect the outputs to the controller, we select the block, and create a bus signal. Now, we’re ready to try different longitudinal velocities and see how the controller handles the varying plant dynamics. In the previous video, the traditional MPC controller designed for an operating condition of 15 m/s had worked well while it failed to control the system at a different longitudinal velocity of 35 m/s. With adaptive MPC, we get a good controller performance when longitudinal velocity is 15 m/s. If we now change it to 35 m/s, we still get a good tracking of the lateral position and the yaw angle. We can even replace this constant block with a continuously changing signal such a sine wave and see that adaptive MPC still can deal with the changing plant dynamics and successfully control the system. We designed an adaptive MPC controller, ran several simulations to evaluate the controller performance. Now if you want to run your controller on your autonomous car, you can simply generate code using Embedded Coder and deploy it to your car. Here’s the generated C code. You can call the MPC controller code from your real-time scheduler using the entry points shown in the code interface report. Embedded Coder also lets you customize the call interfaces as required by your software framework and architecture.
这个视频展示了一个示例如何生成的代码的MPC控制器和一个图像处理算法运行在一个无人驾驶汽车保持在车道内。图像处理和车道检测算法开发了仿真软件,提供这些输入MPC控制器。万博1manbetx这是这些算法是如何工作的。汽车的前视图捕捉的相机安装在车的顶部。图像处理算法确定固体和虚线标记,并检测车道的车旅行。中间的车道中心线和它用于计算汽车的抵消从这条线的位置以及偏航角。使用这些信息MPC控制器试图保持中线上的汽车。左边的图展示了汽车从中心线的偏差与绿色红色和偏航角而右边的图显示了转向角。
在这个视频中,我们讨论了如何使用自适应MPC与变化的动力学和控制你的植物也谈到了如何生成C代码并将其部署为实时控制。关于模型预测控制的更多信息,请查看我们之前的技术演讲视频。
相关产品s manbetx 845
了解更多
你也可以从下面的列表中选择一个网站:
表现最好的网站怎么走吗
选择中国网站(中文或英文)最佳站点的性能。其他MathWorks国家网站不优化的访问你的位置。