Chapter 7 Forward Dynamics

% 正向动力学是在给定关节位置、速度以及力矩的情况下计算其加速度?

>> mdl_puma560

%

假定

puma

位于


qz


位置

,该臂形下关节力矩为0

,此时各关节加速度可计算。

% zeros

用于建立一个零矩阵

,zeros(m,n)



mxn

零矩阵

>> p560.accel(qz, zeros(1,6), zeros(1,6))

ans =

-0.2462

-8.6829

3.1462

0.0021

0.0603

0.0001

% 整合机器人动力学,并计时, fdyn(

时间间隔

,用户提供的控制功能 ,起始臂形

)

>> tic

>> [t q qd] = p560.nofriction().fdyn(10, [], qz);

>> toc

% 输出运动与时间关系

>> subplot(3,1,1)

>> plot(t,q(:,1))

>> xlabel(‘Time (s)’);

>> ylabel(‘Joint 1 (rad)’)

>> subplot(3,1,2)

>> plot(t,q(:,2))

>> xlabel(‘Time (s)’);

>> ylabel(‘Joint 2 (rad)’)

>> subplot(3,1,3)

>> plot(t,q(:,3))

>> xlabel(‘Time (s)’);

>> ylabel(‘Joint 3 (rad)’)

% 单受重力影响下机械臂的运动

>> p560.plot(q)