Home » PythonRobotics机器人算法库 » PythonRobotics机器人算法库-倒立摆控制

PythonRobotics机器人算法库-倒立摆控制

说明:

步骤:

  • 小车上的倒立摆由质量块组成m在一根长度的杆的顶部l如旁边所示,在水平移动的底座上旋转

  • 控制系统的目的是通过向连接摆锤的小车施加力来平衡倒立摆锤

模型

请输入图片描述

M:购物车的质量
m:杆顶部的负载质量
l:杆的长度
u: 作用在小车上的力
x: 购物车位置坐标
θ:与垂直方向的摆角

请输入图片描述

请输入图片描述

LQR控制

请输入图片描述

请输入图片描述

MPC控制

请输入图片描述

  • 进入目录PythonRobotics/Control/inverted_pendulum

  • 执行文件

python3 inverted_pendulum_lqr_control.py

python3 inverted_pendulum_mpc_control.py

请输入图片描述

  • 结果如下:
calc time:0.074798 [sec]
calc time:0.079020 [sec]
calc time:0.071127 [sec]
calc time:0.072449 [sec]
calc time:0.070014 [sec]
calc time:0.096413 [sec]
calc time:0.077080 [sec]
calc time:0.070803 [sec]
calc time:0.069509 [sec]
calc time:0.074037 [sec]
calc time:0.074032 [sec]
calc time:0.069972 [sec]
calc time:0.070727 [sec]
calc time:0.070657 [sec]
calc time:0.100196 [sec]
calc time:0.073944 [sec]
calc time:0.070494 [sec]
calc time:0.074903 [sec]
calc time:0.069723 [sec]
calc time:0.106297 [sec]
calc time:0.072978 [sec]
calc time:0.073794 [sec]
calc time:0.075836 [sec]
calc time:0.068974 [sec]
calc time:0.075633 [sec]
calc time:0.071358 [sec]
calc time:0.069283 [sec]
calc time:0.071636 [sec]
calc time:0.100222 [sec]
calc time:0.067865 [sec]
calc time:0.069376 [sec]
calc time:0.072994 [sec]
calc time:0.068123 [sec]
calc time:0.070868 [sec]
calc time:0.068594 [sec]
calc time:0.067688 [sec]
calc time:0.073450 [sec]
calc time:0.101252 [sec]
calc time:0.068972 [sec]
calc time:0.071774 [sec]
calc time:0.073246 [sec]
calc time:0.068583 [sec]
calc time:0.103493 [sec]
calc time:0.069759 [sec]
calc time:0.070850 [sec]
calc time:0.072444 [sec]
calc time:0.073969 [sec]
calc time:0.071262 [sec]
calc time:0.078928 [sec]
calc time:0.069212 [sec]
calc time:0.071355 [sec]

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: none