如何设计一个MPC控制器与模型和模型预测控制工具箱|理解模型预测控制,第6万博1manbetx部分
从系列:理解模型预测控制
Melda Ulusoy, MathWorks
学习如何设计一个MPC控制器自主车辆转向系统使用模型预测控制工具箱™。
这个视频将引导您完成一个MPC控制器的设计过程。使用的MPC设计师应用模型预测控制工具箱,您可以指定MPC控制器等设计参数样本,预测和控制视野,约束和权重。然后您可以微调控制器和评价其性能。自主驾驶车辆的例子演示了在这个视频中,一个自定义的参考轨迹是使用驾驶场景设计师创建的应用程序,这是自动驾驶的工具箱™的一部分。
看看这个参考的例子有关车辆横向动力学的更多信息和MPC控制设计。
在这个视频中,我们将使用货币政策委员会设计师自主设计一个MPC控制器应用引导车在车道改变操作的情况下。让我们先看这个系统的参数。汽车的全球地位表示对X和Y轴。这些向量显示汽车的纵向和横向速度。在这个控制问题,我们希望汽车跟踪参考轨迹。所以,我们需要控制的是横向位置和偏航角。我们要通过调整转向角。引用值横向位置和偏航角计算的水平轴。在这个例子中,我们假设一个常数纵向15 m / s的速度和使用线性化汽车代表车辆横向动力学模型。有关更多信息,请查看链接的视频描述,这将带你到这个模型预测控制工具箱的例子。
让我们切换到仿真软件构建自动转向万博1manbetx控制系统。这是标准的MPC控制图,我们想构建。我们开始通过增加植物模型。在这里,我有一个自定义库,其中包括我以前创建的块。植物是其中之一,已被开发为一个代表车辆横向动力学的状态空间模型。植物的输入是转向角,两个输出是侧卧位和偏航角。现在,我们将连接MPC控制器,你可以找到在模型预测控制工具箱。第一个输入块的测量输出。所以,我们这里的输出连接。和第二个输入参考。 In this example, we want to simulate a car changing lanes. To create a custom reference trajectory for such a scenario, I’m going to use the Driving Scenario Designer that is part of Automated Driving Toolbox. Using this app, I create a road with two lanes that are 4 meters wide, then add a car and add waypoints to generate the lane-change maneuver. You can adjust the waypoints manually from the side panel if needed. The car’s speed is set to 15 m/s. If I now simulate this scenario step by step, the app shows me how the yaw angle changes. I exported this scenario as a MATLAB function and created a block that outputs the reference lateral position and yaw angle values. I add this custom reference to my model and connect it to the controller. Here, we assume there are no measured disturbances, so we’ll remove the third input. Now that we connected all system components, we’ll continue designing the MPC controller. For this, we open the MPC block and click on “Design,” which opens up the MPC Designer. The MPC Designer is an interactive tool that lets you design MPC controllers and is shipped as part of Model Predictive Control Toolbox. Remember in the previous videos we talked about MPC design parameters such as sample time, prediction and control horizons, and constraints and weights. You can specify all these parameters in the MPC Designer, tune the controller, and then evaluate the controller’s performance. Now, we’ll go back to the MPC Designer and start by defining the MPC structure. We’ll enter the number of manipulated variables and measured outputs, and set the controller sample time to 0.1s. Then we click “define and linearize.” Remember that MPC uses an internal plant model to make predictions and an optimizer to find the optimal control action. Now, when we click “define and linearize,” the app imports and linearizes the plant from the Simulink model and uses it as the internal plant model. It also runs the default simulation scenario and displays the input and output responses. Next, we click on the I/O Attributes to type in the signal labels and units. Note that if these signals differ too much in magnitude, for example, say one is around 1 and the other one is around 1000, then you can use scale factors to bring them to similar scale. We’ll keep the default values for this example as the magnitude difference is not too much. Next, we’ll edit the default scenario. We can choose different types of reference signals from these options. The closest to our lane change scenario would be a ramp input for the lateral position reference and a constant reference of zero for the yaw angle to minimize it. We click OK and this updates the responses. Next, we’ll switch to the tuning tab where we can specify MPC design parameters. These are the default values for prediction and control horizons. Let’s see how the system behavior changes for a larger prediction horizon. For 15 and 20, the response looks more sluggish, so we will set it back to 10. Next, we’ll play with the control horizon. Increasing it to 3 provides a better control of the lateral position. If we increase it further, it doesn’t affect the response significantly, so we settle on a control horizon of 3.
接下来,我们将设置约束。输入约束是由车辆的物理限制。在这个例子中,我们假设指导可以最多30度,所以我们会输入π/ 6弧度的约束。司机安慰,我们将限制的变化率转向角度15度/秒。请注意,所有的输入和输出约束是软约束是很难的违约。我们会尽量保持这些值之间的输出。接下来,我们将指定权重。如果我们想要的输入和输出有一个目标,我们需要将权重设置为非零值。对于转向角,我们将保持默认的重量为零,因为它不需要跟踪一个目标。我们还将保持默认重量的输入速度。 You can increase this weight if you want to have even smaller input increments. And for the outputs, we’ll set the weight for the lateral position to 1 and the yaw angle weight to 0.1, as position tracking is our primary objective. After setting all these parameters, you can fine tune your controller by using this slider. We’ll slide it right for a more aggressive control. And the response looks good.
现在我们满意控制器性能,我们点击“出口控制器”,更新MPC控制器块和仿真运行。请注意,在我们的仿真软件模型,我们万博1manbetx使用自定义参考我们之前设计的车道改变情况。现在我们可以看仿真结果。我们得到满意的跟踪输出。保持和转向角范围内的控制器。
在这个视频中,我们走过一个MPC控制器的设计过程但我也提到,在2018年发布一块有一个车道保持辅助系统,有效地简化了设计过程。查看视频描述中的链接了解更多。
我们表明,设计的控制器运行良好,但是请注意,我们使用汽车动态为一个特定的操作条件工作,当我们有一个纵向15米/秒的速度。然而,如果汽车的纵向速度变化的旅行,汽车的动力将会改变。所以,如果我们现在改变到35米/秒的速度,这将导致控制器降解。为了解决这一问题,我们需要设计一个自适应MPC控制器将更新的内部植物模型改变操作条件。这就是我们要讨论下一节。
你也可以从下面的列表中选择一个网站
表现最好的网站怎么走吗
选择中国网站(中文或英文)最佳站点的性能。其他MathWorks国家网站不优化的访问你的位置。
欧洲