Professional Documents
Culture Documents
Lab Report
Trajectory planning by cubic polynomial equation
BS Electrical Engineering
Session 2017-21
Section-A (Electronics)
Equipment:
Computer / laptop
MATLAB
Procedure:
In this lab we will plan he uprooting and speed and speed increase of the
direction by utilizing the quadratic condition.
After planning of the condition we will utilize the MATLAB to take the graphical
perspective on these condition.
Then we will utilize the converse kinematics to execute the direction condition in
MATLAB.
Case I:
In the case we have to plan the trajectory of the tool from the defined
initial point to the final pint by using the Cubic Polynomial.
MATLAB CODE:
%%%%%Wle come to the planning of trajectory of the robot
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(3,3,1);
plot(t,dis_d)
title('Dispalcement graph Of X Coordianate of Tool')
xlabel('Time')
ylabel('Angular Displacement ')
subplot(3,3,2);
plot(t,veloc_v)
title('Velovity graph Of X Coordianate of Tool')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(3,3,3);
plot(t,accel_a)
title(' Acceleration graph Of X Coordianate of Tool')
xlabel('Time')
ylabel('Angular Acceleration ')
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(3,3,4);
plot(t,dis_d)
title('Dispalcement graph Of Y Coordianate of Tool')
xlabel('Time')
ylabel('Angular Displacement')
subplot(3,3,5);
plot(t,veloc_v)
title('Velovity graph Of Y Coordianate of Tool')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(3,3,6);
plot(t,accel_a)
title(' Acceleration graph Of Y Coordianate of Tool')
xlabel('Time')
ylabel('Angular Acceleration ')
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(3,3,7);
plot(t,dis_d)
title('Dispalcement graph Of Z Coordianate of Tool')
xlabel('Time')
ylabel('Angular Displacement')
subplot(3,3,8);
plot(t,veloc_v)
title('Velovity graph Of Z Coordianate of Tool')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(3,3,9);
plot(t,accel_a)
title(' Acceleration graph Of Z Coordianate of Tool')
xlabel('Time')
ylabel('Angular Acceleration ')
Output:
MATLAB CODE:
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(5,3,1);
plot(t,dis_d)
title('Dispalcement graph Of q1 of Rihino')
xlabel('Time')
ylabel('Angular Displacement ')
subplot(5,3,2);
plot(t,veloc_v)
title('Velovity graph Of q1 of Rihino')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(5,3,3);
plot(t,accel_a)
title(' Acceleration graph Of q1 of Rihino')
xlabel('Time')
ylabel('Angular Acceleration ')
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(5,3,4);
plot(t,dis_d)
title('Dispalcement graph Of q2 of Rihino')
xlabel('Time')
ylabel('Angular Displacement')
subplot(5,3,5);
plot(t,veloc_v)
title('Velovity graph Of q2 of Rihino')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(5,3,6);
plot(t,accel_a)
title(' Acceleration graph Of q2 of Rihino')
xlabel('Time')
ylabel('Angular Acceleration ')
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(5,3,7);
plot(t,dis_d)
title('Dispalcement graph Of q3 of Rihino')
xlabel('Time')
ylabel('Angular Displacement')
subplot(5,3,8);
plot(t,veloc_v)
title('Velovity graph Of q3 of Rihino')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(5,3,9);
plot(t,accel_a)
title(' Acceleration graph Of q3 of Rihino')
xlabel('Time')
ylabel('Angular Acceleration ')
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(5,3,10);
plot(t,dis_d)
title('Dispalcement graph Of q4 of Rihino')
xlabel('Time')
ylabel('Angular Displacement ')
subplot(5,3,11);
plot(t,veloc_v)
title('Velovity graph Of Of q4 of Rihino')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(5,3,12);
plot(t,accel_a)
title(' Acceleration graph Of q4 of Rihino')
xlabel('Time')
ylabel('Angular Acceleration ')
t=0:.1:3;
stat='please enter the initial condition at T0:';
stat1='please enter the initial condition at Tf:';
di=input(stat);
df=input(stat1);
a0=di;
a1=0;
tf=3;
a2=(3./tf.^2).*(df-di);
a3=(-2./tf.^3).*(df-di);
dis_d=a0+a1.*t+a2.*t.^2+a3.*t.^3;
veloc_v=a1+2.*a2.*t+3.*a3.*t.^2;
accel_a=2.*a2+6.*a3.*t.^1;
subplot(5,3,13);
plot(t,dis_d)
title('Dispalcement graph Of q5 of Rihino')
xlabel('Time')
ylabel('Angular Displacement ')
subplot(5,3,14);
plot(t,veloc_v)
title('Velovity graph Of q5 of Rihino')
xlabel('Time')
ylabel('Angular Velocity ')
subplot(5,3,15);
plot(t,accel_a)
title(' Acceleration graph Of q5 of Rihino')
xlabel('Time')
ylabel('Angular Acceleration ')
Output:
Conclusion:
In this lab we have execute the cubic polynomial direction. We have break down an
opportunity to execute the direction. We have break down the speed increase for each
kind of the direction. We have additionally examine the uprooting chart for each joint.