模型预测控制(Model predictive control,MPC)

模型预测控制MPC ) 是一种先进的过程控制方法,用于在满足一组约束条件的同时控制过程。自 1980 年代以来,它一直在化工厂炼油厂的加工工业中使用。近年来,它还被用于电力系统平衡模型[1]电力电子学中。[2]模型预测控制器依赖于过程的动态模型,通常是通过系统识别获得的线性经验模型. MPC 的主要优势在于它允许优化当前时隙,同时考虑未来时隙。这是通过优化有限时间范围来实现的,但仅实现当前时隙,然后再次反复优化,因此与线性二次调节器 ( LQR ) 不同。MPC 还具有预测未来事件的能力,并可以相应地采取控制措施。PID控制器不具备这种预测能力。MPC 几乎普遍作为数字控制实现,尽管有研究通过专门设计的模拟电路实现更快的响应时间。[3]

广义预测控制(GPC) 和动态矩阵控制(DMC) 是 MPC 的经典示例。

MPC 与 LQR 

模型预测控制和线性二次调节器都是最优控制的表达,具有不同的设置优化成本的方案。

模型预测控制器通常着眼于固定长度、通常逐渐加权的误差函数集,而线性二次调节器则着眼于所有线性系统输入并提供传递函数,该传递函数将减少整个频谱的总误差,权衡状态误差针对输入频率。

由于这些根本差异,LQR 具有更好的全局稳定性属性,但 MPC 通常具有更多的局部最优 [?] 和复杂性能。

MPC 和LQR之间的主要区别在于LQR 在整个时间窗口(水平)上进行优化,而 MPC 在后退时间窗口中进行优化,[4]并且使用 MPC 经常计算新的解决方案,而 LQR 使用相同的单个(最佳)整个时间范围的解决方案。因此,MPC 通常在比整个范围更小的时间窗口内解决优化问题,因此可能会获得次优解决方案。然而,由于 MPC 不对线性度做任何假设,它可以处理硬约束以及非线性系统从其线性化操作点的迁移,这两者都是 LQR 的主要缺点。

这意味着 LQR 在远离稳定不动点运行时会变弱。MPC 可以在这些固定点之间绘制一条路径,但不能保证解决方案的收敛性,特别是如果考虑到问题空间的凸性和复杂性已被忽略。

def main():
    # Define x0 -a [1x4] array and then transpose it to be a [4x1]
    x0 = np.array([[0.0, 0.0, 0.0, 0.0]]).T  # [x,y,v theta]
    # Print x0. It's our initial state- [xPos, yPos, Velocity and Angle in radians w.r.t +yPos]
    # Customise this as an input to see how different initial trajectories converge to the optimised path
    #
    print(x0)
    x = x0

    # Define Input - [2x1] array
    # u - [accelerator, steering_wheel_rate]
    u = np.array([[0.0, 0.0]]).T  # [a,beta]
    plt.figure(num=None, figsize=(12, 12))

    mincost = 100000

    for i in range(1000):
        A, B, C = LinealizeCarModel(x, u, dt, lr)
        ustar, xstar, cost = CalcInput(A, B, C, x, u)

        u[0, 0] = GetListFromMatrix(ustar.value[0, :])[0]
        u[1, 0] = float(ustar[1, 0].value)

        x = A @ x + B @ u

        plt.subplot(3, 1, 1)
        plt.plot(target[0], target[1], "xb")
        plt.plot(x[0], x[1], ".r")
        plt.plot(GetListFromMatrix(xstar.value[0, :]), GetListFromMatrix(
            xstar.value[1, :]), "-b")
        plt.axis("equal")
        plt.xlabel("x[m]")
        plt.ylabel("y[m]")
        plt.grid(True)

        plt.subplot(3, 1, 2)
        plt.cla()
        plt.plot(GetListFromMatrix(xstar.value[2, :]), "-b")
        plt.plot(GetListFromMatrix(xstar.value[3, :]), "-r")
        plt.ylim([-1.0, 1.0])
        plt.ylabel("velocity[m/s]")
        plt.xlabel("horizon")
        plt.grid(True)

        plt.subplot(3, 1, 3)
        plt.cla()
        plt.plot(GetListFromMatrix(ustar.value[0, :]), "-r", label="a")
        plt.plot(GetListFromMatrix(ustar.value[1, :]), "-b", label="b")
        plt.ylim([-0.5, 0.5])
        plt.legend()
        plt.grid(True)

        #  plt.pause(0.0001)

        #  raw_input()

        # check goal
        dis = np.linalg.norm([x[0] - target[0], x[1] - target[1]])
        if dis < 0.1:
            print("Goal")
            break

Model predictive controller - MATLAB- MathWorks 中国A model predictive controller uses linear plant, disturbance, and noise models to estimate the controller state and predict future plant outputs.icon-default.png?t=M85Bhttps://ww2.mathworks.cn/help/mpc/ref/mpc.html?searchHighlight=MPC&s_tid=srchtitle_MPC_1

Design and simulate model predictive controllers - MATLAB- MathWorks 中国The MPC Designer app lets you design and simulate model predictive controllers in MATLAB and Simulink.icon-default.png?t=M85Bhttps://ww2.mathworks.cn/help/mpc/ref/mpcdesigner-app.html?searchHighlight=MPC&s_tid=srchtitle_MPC_2

Simulate model predictive controller - Simulink- MathWorks 中国The MPC Controller block receives the current measured output signal (mo), reference signal (ref), and optional measured disturbance signal (md).icon-default.png?t=M85Bhttps://ww2.mathworks.cn/help/mpc/ref/mpccontroller.html?searchHighlight=MPC&s_tid=srchtitle_MPC_3

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Model Predictive Control:Theory, Computation, and Design,2nd Edition. James B. Rawlings, David Q. Mayne, Moritz M. Diehl. Chapter 1 is introductory. It is intended for graduate students in engineering who have not yet had a systems course. But it serves a second purpose for those who have already taken the first graduate systems course. It derives all the results of the linear quadratic regulator and optimal Kalman filter using only those arguments that extend to the nonlinear and constrained cases to be covered in the later chapters. Instructors may find that this tailored treatment of the introductory systems material serves both as a review and a preview of arguments to come in the later chapters. Chapters 2-4 are foundational and should probably be covered in any graduate level MPC course. Chapter 2 covers regulation to the origin for nonlinear and constrained systems. This material presents in a unified fashion many of the major research advances in MPC that took place during the last 20 years. It also includes more recent topics such as regulation to an unreachable setpoint that are only now appearing in the research literature. Chapter 3 addresses MPC design for robustness, with a focus on MPC using tubes or bundles of trajectories in place of the single nominal trajectory. This chapter again unifies a large body of research literature concerned with robust MPC. Chapter 4 covers state estimation with an emphasis on moving horizon estimation, but also covers extended and unscented Kalman filtering, and particle filtering. Chapters 5-7 present more specialized topics. Chapter 5 addressesthe special requirements of MPC based on output measurement instead of state measurement. Chapter 6 discusses how to design distributed MPC controllers for large-scale systems that are decomposed into many smaller, interacting subsystems. Chapter 7 covers the explicit optimal control of constrained linear systems. The choice of coverage of these three chapters may vary depending on the instructor's or student's own research interests. Three appendices are included, again, so that the reader is not sent off to search a large research literature for the fundamental arguments used in the text. Appendix A covers the required mathematical background. Appendix B summarizes the results used for stability analysis including the various types of stability and Lyapunov function theory. Since MPC is an optimization-based controller, Appendix C covers the relevant results from optimization theory.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值