2. Abstract
The two link robotic arm manipulator analyzed in this report is required to be accurate and achieve great precision when
moving from the home position (position 1) to reachable positions within the workspace. The applications of two link
robots are continuously developing. For example they are utilized in the medical field and manufacturing which are
very different industries. In this study the two link manipulator was analyzed to develop the relationship between the
ideal motion as it relates to the actual motion of the joints and end effector in the xy plane. Linearized equations of
motion (EOM) were used to develop proportional controllers for each joint. The full EOM are used to simulate the
manipulator as it moves in the xy plane. Using the coefficients of the cubic polynomial that moves the manipulator from
position 1 to position 2, plots were generated to visualize the changes in the robot’s position, velocity and acceleration
over 0.5 seconds. The polynomials of the two-segment continuous-acceleration trajectory were found and used to
compare the desired x versus y path to the actual x versus y path. It was found that the error occurred when the end
effector reached position 2 which was outside of the linearized region around position 1. The inertial and mass effects
significantly influenced the end effectors precision. It is observed that the end effector’s error is large as it moves from
position 3 to the via point and increase to the position once the end effector reaches its stopping position 5 it entirely
missed the desired location.
Purpose
This two link robotic arm study is intended to analyze
the relationship between the desired and actual motion
and path taken by the robot during operation. Using the
linearized EOM and the coefficients of the cubic
polynomial, the simulation of the manipulator to move
from position 1 to position 2. The polynomials for the
two-segment continuous-acceleration trajectory of the
manipulator can be used to analyze the comparison
between the desired and actual x versus y path. The
analysis in this study creates a visualization of the
robot’s physical constraints and how they affect its
operation. One can employ this analysis to understand
when and why error associated with the manipulator
occurs during the robot’s operation.
Approach
Using the MATLAB program a code was written to
analyze the robot’s motion in the xy plane and changes
in the angular velocity and acceleration of both joints
and the end effector. The MATLAB code is designed to
develop the various graphs that follow to simulate the
location on both joints and end effector with respect to
time and determine the true effects of the robot’s
physical constraints as they relate to the actual motion
versus the ideal motion of the robot. The transformation
matrices are designed to capture the relationship
between the reference frames of the links of the robot.
The associated kinematic equations of the robot are used
to determine the joint parameters that provide a desired
position for the end effector. The positions of motion,
constant variables, gains of each joint’s proportional
controller and transfer functions are defined prior to the
development of the linear and nonlinear EOM. The
respective plots which follow are developed to illustrate
how the two link robot moves in 2D space and what
region in its workspace does it encounter error
associated with the end effector not reaching the desired
end position. Some plots are developed to identify
causes of error related to the robot’s operation and
physical constraints.
Results
The two-link manipulator shown is motionless at the
home position P1 = (θ1=15o
, θ2=135o
).
-
The objective of this project is to model a two link
robot using MATLAB.
Use linearized EOM for the manipulator and
develop proportional controllers for each
joint. Use position 1 (θ1 = 15o
, θ2 = 135o)
Using EOM to simulate the manipulator as it
moves from rest to position two.
Determine the coefficients of the cubic
polynomial that move the manipulator from
rest at position one to position 2 in 0.5 sec.
3. Find the two-segment continuous-
acceleration trajectory desired polynomials
for the motion from position 3 through a “via
point” at position 4 to the final position 5.
Parts 1 & 2: Plot θ1 vs Time and θ2 vs Time
Graph 1 below plots θ1 and θ1 versus time. The desired
plot was developed using the link parameters and
proportional controller’s joint constraints of ωn = 3 Hz
and ζ = 0.707. The angles provided can be seen in
Graph 3. When developing this graph, proportional
controllers were utilized for each joint together with the
full equation of motion (EOM).
Graph 1: Simulated Thetas vs Time
Part 3: Plot X vs Y Path
The previous graph is useful to see how the angles
respond over time. To observe how the robot moves in
space, it is necessary to look at graph 2 that plots the X
versus Y position of the end effector as it moves from
rest at position 1 to the destination at position 2. When
comparing (actual motion) graph 2 with (desired
motion) graph 6 it is observed that they don’t follow the
same path. Their stopping position is roughly at the
same. They don’t have the same path because of the
physical constraints of the robot’s links. This is due to
the fact that the robot’s links have inertia and mass that
needs to be taken into account. The end position error is
a result of the fact the proportional controller is designed
to work in the linearized region around position 1. The
error will increase the farther the end position is from
that area at position 1. Position 2 is close enough to
position 1 that the error is very small, but larger errors
are expected at larger extensions of the arm.
Graph 2: Trace of X vs Y Path
Part 4: Plot Desired Position vs Time
Graph 3 below shows the desired position versus time
in joint space. After finding the coefficients of the cubic
polynomial that moves the manipulator from rest at
position 1 to position 2 (θ1 = 90o
θ2 = 10o
) change in both
angles was plotted with respect to time. It creates a
visualization of a smooth continuous curve. This was
generated using positions 1 and 2 with the cubic
polynomial and a time of 0.5 seconds.
Graph 3: Desired Angles of Theta vs. Time
Part 5: Plot Angular Velocity vs Time
Graph 4 below demonstrates the desired angular
velocity versus time for the two joints. These joints are
moving from position 1 to position 2 (θ1 = 90o
θ2 = 10o
)
in 0.5 sec. The coefficients of the cubic polynomial
4. were found to create the visualization of how the
angular velocities of both joints change over time.
Graph 4: Desired Velocities of Thetas versus Time
Part 6: Plot Desired Acceleration vs Time
Graph 5 below shows the desired acceleration versus
time for the robot in joint space. The straight line
suggests a constant jerk on both joints. It is a derivative
of the velocity curve that was developed with taking the
derivative of the velocity equation.
Graph 5: Desired Acceleration of Thetas vs. Time
The desired x y path is shown in Graph 6 below. This is
the desired path generated from the cubic polynomial
displayed in Cartesian space.
Graph 6: Desired Path Trace
Graph 7 below is a visualization of what motion the
robot actually performed when moving from position 1
to position 2 (θ1 = 90o
θ2 = 10o
). Graph 7 takes into
account the errors in the controls.
Graph 7: Simulated Trace of Path
Part 7: Plot Desired Position vs Time
Graph 8 below shows in Cartesian space the desired
position vs time of x and y of the manipulator from
position 1 to position 2 over a time of 0.5 sec.
5. Graph 8: Position Y vs Time and Position X vs Time
Graph 9 below shows the step response. The lines that
represent theory (green and purple) would be the
electrical impulses that drive the robot’s motors. Due to
losses, gravity and errors the electrical impulses needed
are larger than the theory. The blue and red lines on the
step response graph represent the electrical impulse
applied. They are intended to create a visualization of
the actual movement of the robot in MATLAB.
Graph 9: Step Responses
Part 8: Plot the Desired X vs Y and the Actual X vs
Y Moving from Position 3 - Position 4 – Position 5
Graph 10 below demonstrates the desired X vs Y path
of the robot’s end effector. The curves are smooth and
efficient with some arcs connecting the start position,
via point and stop position.
Graph 10: Desired XY Path Trace (P3-P5)
Graph 11 below demonstrates the actual path of the
robot in the xy plane of the robot’s end effector. The
error deviation from the desired path starts out rather
large as the end effector moves from position 3 (θ1 =
90o
, θ2 = 45o) in the lead up to the “via point” to position
4 (θ1 = 60o
, θ2 = 60o). As the end effector moves farther
away from the via point the error increases. Once the
end effector reaches position 5 (θ1 = 30o
, θ2 = 20o) the
error is so large that the robot misses the final position
that is desired.
Graph 11: Simulated XY Path Trace (P3-P5)
6. Future Work
The proportional controller should be replaced by a
proportional-integral-derivative (PID) controller. This
type of a controller is a control loop feedback controller.
They are designed to continuously calculate an error
value as the difference between a desired set point and
the process variable measured. The PID controller over
time works to minimize the error by adjusting the
control variable.
Conclusion
Comparing graph 2 (actual motion) to graph 6 (desired
motion) the two link robot’s path is not equivalent. The
ending position is roughly the same, but the path they
follow is not because the robots links have inertia and
mass that should be considered. Although, those
physical characteristics are not know. There is
significant end position error because the proportional
controller is designed to work in the linearized region
around position 1 (θ1 = 15o
θ2 = 135o
). The error is
expected to increase the farther the end position is
laterally from the area at position 1. The inertial and
mass effects do not influence the error as severe because
the distance from position 1 to position 2 is only 20 cm.
The absolute value of angular velocity and angular
acceleration for joint 2 was larger than that of joint 1.
When considering the error associated with the controls
it is clear that graph 7 (actual path) demonstrates how
the robot’s path differs from graph 6 (desired path).
Graph 8 demonstrates the need for a larger input of
electrical impulses than the theoretical requirements to
meet the power requirement. Finally, graph 10 and 11
simulate the path taken by the robot from position 3 (θ1
= 90o
, θ2 = 45o
) through the “via point” position 4 (θ1 =
60o
, θ2 = 60o
) and stopping at position 5 (θ1 = 30o
, θ2 =
20o
). When designing a two link robot the physical
constraints associated with the motors and the inertia
and mass of the components must be considered to
ensure optimal precision of the robot’s end effector. A
major design consideration when selecting motors for
the robot is determining the linearization constraints
associated with different motors. As seen in this study
there were significant errors associated with the
proportional controller because it is designed to operate
in the linearized region around position 1.
7. Two Link Robot MATLAB Code
%% Travis John Heidrich
%% Two Link Robot Analysis
%% May 1, 2016
%% Clean Up
clear all
close all
clc
%% Define Parameters
% Define Robot Dimensions
Izz1 = 0; %N*m*s^2
Izz2 = 0; %N*m*s^2
% this is the motor armature inertia, already reflected thru the gear ratio
M1 = 0.035; % kg
M2 = 0.067; % kg
L1 = 0.2; % m
L2 = 0.3; % m
% Create Transforms
syms ai alphai di thetai theta1temp theta2temp
Tx=[1 0 0 0;0 cos(alphai) -sin(alphai) 0;0 sin(alphai) cos(alphai) 0;0 0 0 1];
Dx=[1 0 0 ai;0 1 0 0;0 0 1 0;0 0 0 1];
Tz=[cos(thetai) -sin(thetai) 0 0;sin(thetai) cos(thetai) 0 0;0 0 1 0 ;0 0 0 1];
Dz=[1 0 0 0;0 1 0 0;0 0 1 di;0 0 0 1];
%Concatenate in one homogeneous transform
AtB=Tx*Dx*Tz*Dz;
ai = 0;
alphai = 0;
thetai = theta1temp;
di = 0;
T01 = subs(AtB);
ai = L1;
alphai = 0;
thetai = theta2temp;
di = 0;
T12 = subs(AtB);
ai = L2;
alphai = 0;
thetai = 0;
di = 0;
T2E = subs(AtB);
T02 = T01*T12;
T0E = T01*T12*T2E;
% Define Motor Variables
Km1 = 0.00767;
Km2 = 0.0053;
Kg1 = 14;
Kg2 = 262;
Ke1 = 0.804*(60/(2*pi))*(1/1000);
Ke2 = 0.555*(60/(2*pi))*(1/1000);
Rm1 = 2.6;
Rm2 = 9.1;
Jm1 = 3.87e-7;
Jm2 = 6.8e-8;
g = 9.81; % m/s^2