# 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双模稳定预测模型附Matlab代码.zip
共179个文件
m:98个
js:26个
png:13个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 194 浏览量
2023-04-22
08:49:15
上传
评论
收藏 2.03MB ZIP 举报
温馨提示
1.版本:matlab2014/2019a,内含运行结果,不会运行可私信 2.领域:智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,更多内容可点击博主头像 3.内容:标题所示,对于介绍可点击主页搜索博客 4.适合人群:本科,硕士等教研学习使用 5.博客介绍:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可si信
资源推荐
资源详情
资源评论
收起资源包目录
基于实时迭代的数值鲁棒NMPC双模稳定预测模型附Matlab代码.zip (179个子文件)
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
共 179 条
- 1
- 2
资源评论
Matlab科研辅导帮
- 粉丝: 2w+
- 资源: 7553
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功