Different torque calculation results when using Robotics System Toolbox compared with Peter Corke's toolbox

19 次查看(过去 30 天)
Hi guys,
I am tring to use the Matlab's Robotics System Toolbox to do some dynamics calculation, e.g., the joint torques at given poses. But I found that the generated torques does not coincide with the result from Peter Corke's Robotics Toolbox.
I used transformation matrix to build my manipulator in Robotics System Toolbox, while the corresponding MDH table is used in Peter Corke's toolbox. The interesting thing is: if I specify the joint velocity and joint acceleration as zeros, the two toolboxes will provide me the same results. Once the velocity and acceleration are given, things will be different.
In the Robotics System Toolbox, I found that it uses the Recursive Newton–Euler algorithm to calculated the joint torques. A screenshot below shows how the inertia force and torques are updated in the forward iteration.
Through debugging, I found that the inertial torques at CoM during forward iteration are updated differently (the inertial forces at CoM during forward iteration are the same) in Robotics System Toolbox. If I use the following equation to update the inertial torque at CoM manually after the velocity and acceleration is updated at each iteration, I can get the same results.
while is the inertial torques at CoM of link i, is the inertial forces at CoM of link i and is the position of CoM. This is just the regular equation used in any robotics textbook.
In both methods, the manipulators are given the same physical parameters. I also attached the scripts below. Can anyone tell me what could be the reason?

采纳的回答

Remo Pillat
Remo Pillat 2023-11-30
Hi Haojun,
Peter's toolbox and the Robotics System Toolbox in MATLAB make slightly different assumptions how the inertia matrix is specified.
  1. In MATLAB's Robotics System Toolbox, the Inertia property of the rigidBody object represents the inertia tensor relative to the link frame. This it the convention that is used in Featherstone's Rigid Body Dynamics book.
  2. Peter's toolbox assumes that the I property is the inertia tensor relative to the center of mass (CoM) of the link, but with axes aligned with the link frame. This assumption is also used in URDF.
Given that, you can convert between the two representations with a similarity transform for the rotation and tensor generalization of the parallel axis theorem to account for the translation. The details of the conversion are described in this answer, but the short version is that in your method2_Transformation script, you can do the following to compute the Inertia property from the values you used with Peter's toolbox. Here is an example for the first body:
I_rb = L1.I - L1.m*skew(L1.r)^2;
body1.Inertia = [I_rb(1,1), I_rb(2,2), I_rb(3,3), I_rb(2,3), I_rb(1,3), I_rb(1,2)]; % order is [Ixx Iyy Izz Iyz Ixz Ixy]
Here, L1 is the Link object that is defined in method1_DH, L1.m is the link's mass, L1.r is the position of the link's CoM relative to its frame, and skew is the function in Peter's toolbox that converts the CoM position vector into a skew-symmetric matrix.
If you do the same calculation for all 4 bodies the torque outputs between the 2 different scripts will match.See the attached modified script.
The new edition of Peter's book actually calls out this discrepancy between the toolboxes and we standardize on assumption (1).

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Robotics 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by