Unit 6: I’m organizing the notes around the planning method, Cartesian straight-line generation, the two-link planar kinematics, and the Orangewood arm implementation. The equations will distinguish Cartesian path generation from joint-space execution, since that distinction is central to obtaining a genuinely straight end-effector path.# Unit 6: Trajectory Planning
I’m organizing the notes around the planning method, Cartesian straight-line generation, the two-link planar kinematics, and the Orangewood arm implementation. The equations will distinguish Cartesian path generation from joint-space execution, since that distinction is central to obtaining a genuinely straight end-effector path.# Unit 6: Trajectory Planning
I. Orientation
Trajectory planning determines how a robot moves from an initial configuration to a desired final configuration while satisfying geometric, kinematic, and actuator constraints. In this laboratory, the required end-effector path is a straight line in the Cartesian plane, and the corresponding joint angles are calculated for a two-axis planar articulated robot before commands are sent to the Orangewood Robotic Arm.
- Governing principle: The desired Cartesian path is generated first, then inverse kinematics converts each Cartesian point into joint coordinates.
- Robot model: The arm is represented as two rigid links connected by two revolute joints in a common plane.
- Coordinate convention: The base joint is located at the origin; the (x)-axis and (y)-axis describe end-effector position.
- Trajectory meaning: A trajectory contains position, velocity, and sometimes acceleration as functions of time.
- Straight-line requirement: Consecutive Cartesian points must lie on one line, even though the individual joints generally move through nonlinear angle profiles.
- Assumptions: Links are rigid, joints are accurately measured, backlash is limited, and the motion remains inside the reachable workspace.
- Practical constraint: The calculated angles must respect joint limits, motor speed limits, and the arm’s mechanical geometry.
II. Trajectory Planning
A. Implementation of trajectory planning algorithm for straight-line motion of two-axis planar articulated robot using Orangewood Robotic Arm
The implementation converts a start point and an end point into a time-ordered sequence of joint commands that makes the arm’s end effector follow a straight Cartesian path.
- Input specification: Define the initial point ((x_s,y_s)), final point ((x_f,y_f)), motion duration (T), number of interpolation points (N), link lengths (L_1,L_2), and sampling interval (\Delta t).
- (x_s,y_s): starting Cartesian coordinates in units such as millimetres.
- (x_f,y_f): target Cartesian coordinates.
- (T): total motion time in seconds.
- (N): number of generated path samples.
- Cartesian interpolation: For sample (i), calculate the interpolation parameter
[
s_i=\frac{i}{N-1}, \qquad i=0,1,\ldots,N-1.
]
The corresponding point is
[
x_i=x_s+s_i(x_f-x_s), \qquad
y_i=y_s+s_i(y_f-y_s).
]
Here, (s_i=0) gives the start and (s_i=1) gives the final point. - Time assignment: If samples are equally spaced in time,
[
t_i=\frac{iT}{N-1}.
]
The approximate command interval is (\Delta t=T/(N-1)). - Inverse-kinematics conversion: Each ((x_i,yi)) is converted to joint angles (\theta{1i}) and (\theta_{2i}).
- Command generation: The angle sequence is converted to the control format accepted by the Orangewood arm, such as servo positions, pulse widths, or calibrated motor commands.
- Execution order: The controller sends ((\theta{1i},\theta{2i})) sequentially with the selected timing interval. Sending only the final joint pair would produce motion to the target, but would not ensure a straight path.
- Verification: Measure or observe intermediate end-effector positions and compare them with the interpolated line. Position error can be expressed as
[
e_i=\sqrt{(xi-x{m,i})^2+(yi-y{m,i})^2},
]
where (x{m,i},y{m,i}) are measured coordinates.
A practical algorithm can be represented as follows:
read L1, L2
read (xs, ys), (xf, yf), T, N
for i = 0 to N - 1:
s = i / (N - 1)
x = xs + s * (xf - xs)
y = ys + s * (yf - ys)
calculate theta1, theta2 using inverse kinematics
check reachability and joint limits
convert theta1, theta2 to calibrated arm commands
send commands to the Orangewood Robotic Arm
wait for T / (N - 1)
stop the armB. Trajectory timing and interpolation
Timing determines how quickly the robot travels between path samples and strongly affects smoothness, accuracy, and motor loading.
- Constant-speed interpolation: Linear interpolation makes (x) and (y) change uniformly with the interpolation parameter (s), so the ideal Cartesian speed is
[
v=\frac{\sqrt{(x_f-x_s)^2+(y_f-y_s)^2}}{T}.
] - Velocity discontinuity: Starting immediately at constant speed and stopping immediately at the target can cause abrupt acceleration changes. Low-cost educational arms may show vibration or overshoot.
- Trapezoidal or smooth timing: A scalar timing function (s(t)) can replace (t/T). A common cubic profile is
[
s(t)=3\left(\frac{t}{T}\right)^2-2\left(\frac{t}{T}\right)^3.
]
This gives zero idealized Cartesian velocity at the start and end. - Sampling resolution: Increasing (N) reduces the spacing between commanded Cartesian points. If (N=101) and (T=10) s, the interval is (0.1) s.
- Control limitation: More samples improve geometric approximation only when the controller and motors can process them at the required rate.
III. Straight-Line Motion
A. Straight-line motion
Straight-line motion means that the end-effector position changes along the line segment joining the start and target points in Cartesian space.
-
Line equation: The desired path can be written parametrically as
[
\mathbf{p}(s)=
\begin{bmatrix}x(s)\y(s)\end{bmatrix}\begin{bmatrix}x_s\y_s\end{bmatrix}
+s
\begin{bmatrix}x_f-x_s\y_f-y_s\end{bmatrix},
\quad 0\leq s\leq1.
]
The vector (\mathbf{p}(s)) is the end-effector position. - Collinearity test: A generated point is on the intended line when
[
(x_i-x_s)(y_f-y_s)-(y_i-y_s)(x_f-x_s)=0.
]
In practice, the value should be close to zero within measurement and numerical tolerance. - Joint-space distinction: A linear change in (\theta_1) and (\theta_2) does not normally create a straight Cartesian path. The robot must interpolate in Cartesian coordinates and solve inverse kinematics at each point.
- Workspace condition: Every point on the line must be reachable. A target may be reachable while an intermediate point is outside the workspace.
- Singularity condition: Near a singular configuration, small Cartesian movements can require large joint movements, reducing accuracy and increasing actuator demand.
For a start point ((180,80)) mm and final point ((220,120)) mm, the midpoint is obtained with (s=0.5):
[
x(0.5)=180+0.5(220-180)=200\text{ mm},
]
[
y(0.5)=80+0.5(120-80)=100\text{ mm}.
]
This midpoint must be converted into joint angles and commanded like every other path point.
B. Applications and limitations
The straight-line trajectory is useful when the tool must approach, place, draw, or transfer an object along a controlled geometric route, but the ideal path is affected by the robot and controller.
- Application in placement: A gripper can move between two locations while maintaining a predictable horizontal or diagonal path.
- Application in drawing: A pen attached to the end effector can reproduce a line only if backlash and position error remain small.
- Geometric limitation: The arm cannot follow the line if any interpolated point violates its reachability or joint-limit conditions.
- Resolution limitation: With few samples, the controller follows a polygonal approximation rather than a visually exact line.
- Mechanical limitation: Gear backlash, flexible links, friction, and motor quantization cause deviations from calculated positions.
- Calibration limitation: An error in (L_1), (L_2), joint zero, or coordinate origin shifts every calculated point.
- Speed limitation: Excessive speed can cause missed positions, vibration, or an unsafe collision.
IV. Two-axis planar articulated robot
A. Two-axis planar articulated robot
A two-axis planar articulated robot has two rotary joints and two links, giving two independent joint variables for positioning the end effector in the (x)-(y) plane.
- Joint variables: (\theta_1) is the base-link angle measured from the positive (x)-axis; (\theta_2) is the relative angle between the first and second links.
- Link parameters: (L_1) is the length of the first link and (L_2) is the length of the second link, both measured in the same unit as (x) and (y).
- Forward kinematics: The end-effector position is
[
x=L_1\cos\theta_1+L_2\cos(\theta_1+\theta_2),
]
[
y=L_1\sin\theta_1+L_2\sin(\theta_1+\theta_2).
] - Reachability condition: For radial distance
[
r=\sqrt{x^2+y^2},
]
a point is reachable when
[
|L_1-L_2|\leq r\leq L_1+L_2.
] - Inverse kinematics: Define
[
D=\frac{x^2+y^2-L_1^2-L_2^2}{2L_1L_2}.
]
Then
[
\theta_2=\operatorname{atan2}\left(\pm\sqrt{1-D^2},D\right),
]
[
\theta_1=\operatorname{atan2}(y,x)
-\operatorname{atan2}\left(L_2\sin\theta_2,\,
L_1+L_2\cos\theta_2\right).
]
The symbols (+) and (-) represent the two possible configurations, commonly called elbow-up and elbow-down. - Numerical protection: Due to rounding, (D) may become slightly larger than (1) or smaller than (-1). A valid implementation clamps it to the interval ([-1,1]) after confirming the point is within tolerance.
- Angle units: Trigonometric functions usually use radians, while the arm interface may require degrees. Conversion is
[
\theta{\text{deg}}=\theta{\text{rad}}\frac{180}{\pi}.
]
B. Configuration selection and joint constraints
Selecting a consistent inverse-kinematics branch prevents sudden changes in posture as the robot follows the path.
- Branch consistency: Use the same sign in (\theta_2) for all path points unless a deliberate configuration change is required.
- Nearest-solution rule: When both solutions are mechanically valid, select the solution closest to the previous joint state:
[
\Delta=\left|\theta1-\theta{1,\text{prev}}\right|
+\left|\theta2-\theta{2,\text{prev}}\right|.
] - Joint limits: For each joint, verify
[
\theta_{j,\min}\leq\thetaj\leq\theta{j,\max}.
]
The limits (j=1,2) must be obtained from the actual arm. - Singularity warning: When (D) approaches (+1) or (-1), the links become nearly fully extended or folded, and the two inverse-kinematics solutions converge.
- Collision checking: A mathematically valid path may still cause a link, gripper, or payload to strike the work surface or another object.
V. Orangewood Robotic Arm
A. Orangewood Robotic Arm
The Orangewood Robotic Arm provides the physical platform on which the calculated two-joint trajectory is calibrated, translated into actuator commands, and experimentally evaluated.
- Mechanical identification: Measure or obtain the effective lengths (L_1) and (L_2) from joint axes to the next joint or tool center point; do not assume the visible arm length equals the kinematic length.
- Zero calibration: Establish the physical pose corresponding to (\theta_1=0) and (\theta2=0). Record any offsets:
[
\theta{j,\text{command}}=a_j\theta_j+b_j,
]
where (a_j) converts direction or scale and (b_j) is the zero offset. - Coordinate calibration: Mark the base origin and positive axes on the work surface. The coordinate frame used in the code must match the frame used during measurement.
- Command conversion: The controller may require degrees, servo ticks, pulse widths, or motor-specific units. The conversion must be tested at several known angles.
- Safe initialization: Move to a known low-speed starting pose before executing the path, and keep the workspace clear of people and obstructions.
- Physical observation: Check whether the measured end-effector position agrees with the model at the start, midpoint, and final point before using the full trajectory.
- Communication timing: A command should not be transmitted faster than the arm can physically respond. Include delays or feedback synchronization where the interface requires it.
- Payload effect: A gripper or object changes the effective tool position and may increase motor error, especially near extended configurations.
B. Experimental evaluation
The laboratory evaluation compares the planned Cartesian trajectory with the motion actually produced by the Orangewood arm.
- Position comparison: Record measured points ((x{m,i},y{m,i})) at selected times and calculate the Euclidean error (e_i).
- Path comparison: Plot planned and measured ((x,y)) coordinates on the same (x)-(y) axes. A bowed or segmented measured path indicates interpolation, calibration, or mechanical error.
- Joint comparison: Inspect (\theta_1(t)) and (\theta_2(t)). Large abrupt changes suggest an inverse-kinematics branch switch or an unsuitable path point.
- Repeatability: Execute the same trajectory several times and compare the final position and intermediate deviations. Repeatability concerns consistency; accuracy concerns closeness to the intended coordinates.
- Error sources: Typical causes include incorrect link lengths, joint-zero offsets, backlash, quantized commands, loose couplings, friction, and inadequate settling time.
- Improvement measures: Increase path samples, reduce speed, recalibrate offsets, choose the less extended configuration, and avoid points close to workspace boundaries or singularities.
- Acceptance criterion: The trajectory is satisfactory when all points remain within joint and workspace limits, the arm moves without unsafe behavior, and measured Cartesian error stays within the laboratory’s specified tolerance.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →