MGRobotStanfordArmKinematicsOnly.html (MotionGenesis input/output).
(1) NewtonianFrame N
(2) RigidBody A, B, C
(3) Point Q
(4) %--------------------------------------------
(5) Constant LA = 0.4 m, LB = 0.3 m, LC = 0.2 m
(6) qA = sin(t)
-> (7) qA = sin(t)
(8) qB = sin(2*t)
-> (9) qB = sin(2*t)
(10) qC = sin(3*t)
-> (11) qC = sin(3*t)
(12) %--------------------------------------------
(13) % Rotational and translational kinematics
(14) A.RotateZ( N, qA )
-> (15) A_N = [cos(qA), sin(qA), 0; -sin(qA), cos(qA), 0; 0, 0, 1]
-> (16) w_A_N> = cos(t)*Az>
-> (17) alf_A_N> = -sin(t)*Az>
(18) B.RotateX( A, qB )
-> (19) B_A = [1, 0, 0; 0, cos(qB), sin(qB); 0, -sin(qB), cos(qB)]
-> (20) w_B_A> = 2*cos(2*t)*Bx>
-> (21) w_B_N> = cos(t)*Az> + 2*cos(2*t)*Bx>
-> (22) alf_B_A> = -4*sin(2*t)*Bx>
-> (23) alf_B_N> = 2*cos(t)*cos(2*t)*Ay> - sin(t)*Az> - 4*sin(2*t)*Bx>
(24) C.RotateX( B, qC )
-> (25) C_B = [1, 0, 0; 0, cos(qC), sin(qC); 0, -sin(qC), cos(qC)]
-> (26) w_C_B> = 3*cos(3*t)*Cx>
-> (27) w_C_N> = cos(t)*Az> + (2*cos(2*t)+3*cos(3*t))*Bx>
-> (28) alf_C_B> = -9*sin(3*t)*Cx>
-> (29) alf_C_N> = 2*cos(t)*(cos(2*t)+1.5*cos(3*t))*Ay> - sin(t)*Az> + (-9*sin(
3*t)-4*sin(2*t))*Bx>
(30) Q.Translate( No, LA*Az> + LB*By> + LC*Cy> )
-> (31) p_No_Q> = LA*Az> + LB*By> + LC*Cy>
-> (32) v_Q_N> = -cos(t)*(LB*cos(qB)+LC*cos(qB+qC))*Bx> + 2*LB*cos(2*t)*Bz>
+ 2*LC*(cos(2*t)+1.5*cos(3*t))*Cz>
-> (33) a_Q_N> = -cos(t)^2*(LB*cos(qB)+LC*cos(qB+qC))*Ay> + (4*LB*cos(t)*cos(2*
t)*sin(qB)+sin(t)*(LB*cos(qB)+LC*cos(qB+qC))+4*LC*cos(t)*(cos(2*t)+1.5*
cos(3*t))*sin(qB+qC))*Bx> - 4*LB*cos(2*t)^2*By> - 4*LB*sin(2*t)*Bz>
- 4*LC*(cos(2*t)+1.5*cos(3*t))^2*Cy> - 4*LC*(sin(2*t)+2.25*sin(3*t))*Cz>
(34) %--------------------------------------------
(35) % Magnitudes of Q's position, velocity, and acceleration at time t = 1.
(36) PositionMagnitude = EvaluateToNumber( Q.GetDistance(No), t = 1 )
-> (37) PositionMagnitude = 0.8584902
(38) VelocityMagnitude = EvaluateToNumber( Q.GetSpeed(N), t = 1 )
-> (39) VelocityMagnitude = 1.01986
(40) AccelerationMagnitude = EvaluateToNumber( Magnitude( Q.GetAcceleration(N) ), t = 1 )
-> (41) AccelerationMagnitude = 3.892646
Saved by Motion Genesis LLC. MotionGenesis 6.4 Professional. Command names and syntax: Copyright (c) 2024 Motion Genesis LLC. All rights reserved.