You are on page 1of 9

Fundamental of Robotics

Lab Report
Trajectory planning by cubic polynomial equation

Name: Jawad Naseer


Roll number: 08

BS Electrical Engineering
Session 2017-21
Section-A (Electronics)

Pakistan Institute of Engineering and Applied Sciences,


Islamabad, Pakistan
Trajectory planning by cubic polynomial equation
Objectives:
 In this lab we get comfortable with direction arranging
 In this lab we will plan the straightforward cubic polynomial direction.
 In this lab we will utilize introductory and last position point of the apparatus
vector to draw the direction.

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.

What is Trajectory planning:


Trajectory planning gives a path from a starting configuration S to a goal configuration G
avoiding collisions in a 2D or 3D space.
A configuration is the pose of a robot describing its position. Configuration Space C, is
the set of all configurations. For instance, in two dimensions a robot's configuration
would be described by coordinates (x, y) and angle θ. Whereas in three dimensions a
robot's configuration would be described by coordinates (x, y, z) and angles (α, β, γ).
Free space Cfree is the set of all configurations that are collision-free. Computing the
shape of Cfree is not efficient, however, computing if a given configuration is a collision
free is by simply using kinematics and collision detection from sensors.
Target space is a linear subspace of free space which we want robot go there. In global
motion planning, target space is observable by robot's sensors. However, in local
motion planning, robot cannot observe the target space in some states. To solve
problem, robot assume several virtual target space which is located in observable area
(around robot). The virtual target space is called sub-goal.
Equation:

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:

Fig 1.1 (trajectory of any manipulator)


Case II:
In this case we have to plan the trajectory for the Rhino robot through
the inverse kinematics.

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:

Fig 1.1 (Trajectory planning for the Rhino XR-3)

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.

You might also like