从系列:理解模型预测控制
Melda Ulusoy,MathWorks公司
了解如何设计MPC控制器使用模型预测控制工具箱™自动车辆转向系统。
这部影片将引导您完成MPC控制器的设计过程。使用自带的模型预测控制工具箱中的MPC设计的应用程序,你可以指定MPC的设计参数,如控制器采样时间,预测和控制视野,约束和权重。然后,您可以微调您的控制器,并对其性能进行评估。对于这段视频展示了自主转向车辆例如,使用驱动方案设计的应用程序,这是自动驾驶工具箱™的一部分创建一个自定义的参考轨迹。
在这段视频中,我们将使用MPC设计的应用程序设计的MPC控制器,自主操纵汽车在车道变更操作的情况。让我们先看看这个系统的启动参数。这款车在全球的地位表示相对于X和Y轴。这些载体展现了汽车的纵向和横向运动速度。在此控制问题,我们想要的车跟随参考轨迹。所以,我们在这里需要控制什么是横向位置和横摆角。我们打算通过调整转向角度这样做。对于横向位置和横摆角的参考值相对于水平轴计算。在这个例子中,我们假设为15米/秒的恒定速度纵向和使用表示所述横向车辆动力学线性化的汽车模型。欲了解更多信息,请在视频说明中给出的链接,这将带你到这个模型预测控制工具箱例子。
让我们切换到Simulink中建万博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度,因此我们将输入PI / 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控制器块和运行模拟上。请注意,在我们的Simulink模万博1manbetx型中,我们使用自定义的参考,我们已经为变道方案之前的设计。现在我们可以看一下仿真结果。我们得到满意的跟踪两路输出。和转向角保持在由所述控制器的限制范围内。
在这段视频中,我们已经通过MPC控制器的设计过程中走了,但让我也提到,在推出2018A有一个车道保持辅助系统块,有效地简化了设计流程。看看在视频说明中的链接,了解更多关于这一点。
我们表明,所设计的控制器执行好,但请注意,我们使用工作,为特定的操作条件,这是当我们有15米纵向速度的车动力/秒。然而,如果汽车的纵向速度的变化,因为它行驶时,汽车的动力将发生变化了。所以,如果我们现在的速度更改为35米/秒,这将导致控制器降解。为了解决这个问题,我们需要设计一个自适应MPC控制器将更新不断变化的工作条件,内部设备模型。而这正是我们要在接下来的视频洽谈。
您还可以选择从下面的列表中的网站:
选择最佳的网站性能的中国网站(在中国或英文)。其他MathWorks的国家网站都没有从您的位置访问进行了优化。