# Joint angle control of the 7 DOF robot manipulator KUKA LBR iiwa 14
![image]( https://github.com/ideaDeng/Gifs/blob/master/lbr8s.gif)
## Description
This example demonstrates how to use ParNMPC to control a 7 DOF robot manipulator using user-defined dynamics and derivatives.
The robot manipulator's dynamics and derivatives are computed using Pinocchio (https://stack-of-tasks.github.io/pinocchio/), which is a very efficient C++ library for rigid multi-body dynamics computations. Since Pinocchio currently only supports Mac and Linux, we here demonstrate how to do the simulation on Ubuntu 18.04.
The task is to control the manipulator to its desired reference under the constraints of the input torques and velocities.
- Input constraint: |tau| < 10 N
- Velocity constraint: |qdot| < pi/2 rad/s
- Initial position: [0,0,0,0,0,0,0]
- Setpoint in 0 to 4 s: [0,pi/2,0,pi/2,0,pi/2,0]
- Setpoint in 4 to 8 s: [pi/2,0,pi/2,0,pi/2,0,pi/2]
- Zero gravity
## How to generate code?
1. Open `NMPC_Problem_Formulation.m` and run.
2. Open `Simu_Matlab_Codegen.m` and run.
The closed-loop simulation C++ files will be generated to `./codegen/lib/Simu_Matlab` and `./codegen/lib/Simu_Matlab/examples`.
The Pinocchio interface is in `./iiwa_pinocchio` (very simple).
The urdf file of the manipulator is in `./iiwa_description` (from MATLAB).
## How to run the generated C++ code?
1. Install Pinocchio on Ubuntu (https://stack-of-tasks.github.io/pinocchio/).
**Make sure that you can run successfully the two C++ examples in https://gepettoweb.laas.fr/doc/stack-of-tasks/pinocchio/master/doxygen-html/index.html.**
2. Compile and run (supposing the current directory is RobotManipulator).
Type the following commands in terminal sequentially:
```
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ../bin
$ ./iiwa14_NMPC
```
## Computation time
In our setup (T = 1 s, N = 18, DOP = 6, i7-8950HK@2.9 GHz), the computation time is about 170 us/iteration.
A sampling rate of 1 KHz can be achieved in real time.
## Contributors
- Thank [Xuanchen Zhang](https://github.com/xuhuairuogu) (USTC) for providing the wonderful build interface.
## Path following (coming soon)
Similarly, you can use ParNMPC to control the end effector to follow a straight line or a sine path ([reference](https://ieeexplore.ieee.org/abstract/document/7575680)):
![image]( https://github.com/ideaDeng/Gifs/blob/master/pose_nmpc_pf_line.gif)
![image]( https://github.com/ideaDeng/Gifs/blob/master/pose_nmpc_pf_sine.gif)
没有合适的资源?快使用搜索试试~ 我知道了~
一种用于非线性模型预测控制的并行优化工具包(NMPC)
共177个文件
m:98个
js:26个
html:12个
需积分: 5 1 下载量 107 浏览量
2024-05-19
13:22:34
上传
评论
收藏 1.55MB RAR 举报
温馨提示
介绍了一种专为非线性模型预测控制(NMPC)设计的并行优化工具包。内容涉及该工具包的功能特点、使用方法以及在解决非线性控制问题中的应用实例。通过对比分析,突出了并行优化在提高NMPC计算效率和实时性方面的重要作用。适合控制工程师、算法研究员和对高性能计算感兴趣的专业人士。使用场景包括复杂系统控制、实时仿真和工业自动化。目标是推广这一工具包的使用,助力非线性控制系统的研究与开发。 关键词标签: 非线性模型预测控制 NMPC 并行优化 工具包 实时控制
资源推荐
资源详情
资源评论
收起资源包目录
一种用于非线性模型预测控制的并行优化工具包(NMPC) (177个子文件)
codeGen.asv 5KB
iiwa.cpp 3KB
application.1b62728e.css 76KB
application-palette.a8b3c06d.css 38KB
font-awesome.css 30KB
material-icons.css 873B
sitemap.xml.gz 202B
tmwtypes.h 6KB
iiwa14.h 625B
index.html 38KB
index.html 34KB
index.html 23KB
index.html 21KB
index.html 21KB
index.html 20KB
index.html 19KB
index.html 18KB
index.html 18KB
index.html 16KB
index.html 16KB
404.html 11KB
wordcut.js 542KB
application.808e90bb.js 78KB
tinyseg.js 18KB
lunr.ar.js 17KB
lunr.tr.js 14KB
lunr.es.js 11KB
lunr.it.js 11KB
lunr.ro.js 11KB
lunr.fr.js 10KB
lunr.ru.js 10KB
lunr.pt.js 10KB
lunr.hu.js 9KB
lunr.fi.js 9KB
modernizr.268332fc.js 7KB
lunr.du.js 6KB
lunr.de.js 6KB
lunr.nl.js 6KB
lunr.no.js 5KB
lunr.da.js 5KB
lunr.sv.js 4KB
lunr.stemmer.support.js 4KB
lunr.ja.js 3KB
lunr.th.js 1KB
lunr.vi.js 1KB
lunr.multi.js 817B
lunr.jp.js 36B
search_index.json 62KB
LICENSE 1KB
coarse_update_func.m 7KB
NMPC_Solve_SearchDirection.m 7KB
NMPC_Solve.m 7KB
codeGen.m 5KB
Simu_Matlab.m 5KB
Simu_Matlab.m 4KB
Simu_Matlab.m 4KB
Simu_Matlab.m 4KB
Simu_Matlab.m 4KB
NMPC_Problem_Formulation.m 4KB
NMPC_Solve_CodeGen.m 4KB
NMPC_Problem_Formulation.m 3KB
NMPC_SolveOffline.m 3KB
NMPC_LineSearch_Filter.m 3KB
NMPC_Problem_Formulation.m 3KB
OptimalControlProblem.m 3KB
KKT_error_func.m 3KB
NMPC_LineSearch_Merit.m 3KB
NMPC_Problem_Formulation.m 2KB
codeGen.m 2KB
OCP_F_Fu_Fx.m 2KB
NMPC_Problem_Formulation.m 2KB
NMPC_LineSearch_Filter_PairEval.m 2KB
NMPC_KKTError.m 2KB
NMPC_LineSearch_Merit_MeritEval.m 2KB
fraction_to_boundary_parallel_func.m 2KB
setHessianApproximation.m 1KB
DynamicSystem.m 1KB
Simu_Matlab_Codegen.m 1KB
Simu_Matlab_Codegen.m 1KB
Simu_Matlab_Codegen.m 1KB
Simu_Simulink_Setup.m 1KB
createOptions.m 1KB
codeGen.m 1KB
Simu_Simulink_Setup.m 1KB
Simu_Simulink_Setup.m 1KB
Simu_Simulink_Setup.m 1KB
setC.m 1KB
NMPCSolver.m 995B
Simu_Matlab_Codegen.m 980B
OCP_F.m 966B
Simu_Matlab_Codegen.m 943B
showInfo.m 919B
setG.m 908B
OCP_GEN_fdt_fudt_fxdt_FuncGen.m 834B
showInfo.m 755B
createNonemptySolution_FuncGen.m 745B
f_fu_fx_Wrapper.m 712B
f_Wrapper.m 640B
C_Cu_Cx_Wrapper.m 630B
f_fu_fx_Wrapper.m 623B
共 177 条
- 1
- 2
资源评论
拙_言
- 粉丝: 905
- 资源: 233
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功