Inverse dynamics block to forward dynamics block
3 views (last 30 days)
Show older comments
Denizhan AKINCI
on 26 Feb 2024
Commented: Denizhan AKINCI
on 10 Jun 2024
Hello, I am currently facing an issue related to the joint positions of a 6-axis robotic arm. My objective is to visualize these joint accelerations without using a controller(That will be done later). Here's my approach: I generate a trajectory using a minimum jerk polynomial trajectory, obtaining joint positions (q), velocities (qd), and accelerations (qdd). I then use these values along with an external force (fexterior) as inputs for the Inverse Dynamics block, resulting in joint torques.
Now, with these obtained joint torques, along with the initial joint positions (q), velocities (qd), and the external force (fext) used earlier, I attempt to regenerate the joint positions using the Forward Dynamics block. However, I observe that the joint accelerations remain constant even when I vary the external force (Fext). This is perplexing, especially considering that when I use the Inverse Dynamics block with different Fext values, I obtain distinct joint torques for each payload. Yet, the results from the Forward Dynamics block remain the same.
Could you provide insights into why the joint accelerations from the Forward Dynamics block are not varying with changes in the external force, despite the distinct joint torques obtained from the Inverse Dynamics block for different payloads? Your assistance is highly appreciated. Thank you!
0 Comments
Accepted Answer
Karsh Tharyani
on 4 Mar 2024
Edited: Karsh Tharyani
on 4 Mar 2024
Hi Denizhan,
Let's use the following as a starter code
% A 6 axis robot
rbt=loadrobot("abbirb120",DataFormat="column");
% Assume a gravitational acceleration in the Z direction of the Base frame.
rbt.Gravity=[0,0,-9.81];
% Generate a minimum jerk profile between some random waypoints and time
% points.
s=rng(100);
nwpts=10;
wpts=rand(nwpts,6);
tpts=linspace(0,1,nwpts);
[q,qd,qdd]=minjerkpolytraj(wpts',tpts,100);
% Inverse dynamics on the first set of joint states. Additionally, assume
% a non-zero external force acting on the end-effector body "tool0".
FIRST_JOINT_STATE_IDX=1;
Q=q(:,FIRST_JOINT_STATE_IDX);
QD=qd(:,FIRST_JOINT_STATE_IDX);
QDD=qdd(:,FIRST_JOINT_STATE_IDX);
eename='tool0';
fext=externalForce(rbt,eename,rand(1,6),Q);
tau=inverseDynamics(rbt,Q,QD,QDD,fext);
disp(tau)
% Feed this system state to the forward dynamics function
QDD_calc=forwardDynamics(rbt,Q,QD,tau,fext);
disp(QDD_calc)
Do you see why QDD_calc is zero? It is zero because the joint torque tau along with the joint state Q, QD and the external force fext balances the system.
Let me know if you have any questions or if I didn't get your question correctly.
Best,
Karsh
More Answers (0)
See Also
Categories
Find more on Robotics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!