Object Pick-up and Placement Application with a
Two-Degree-of-Freedom Servo-Driven Robot
Manipulator
210106106051 - Murat KAPUCU - 210106106082 - Emir Baran KAYABAŞI
Elektrik Elektronik Mühendisliği Bölümü, Zonguldak Bülent Ecevit Üniversitesi, Zonguldak, Türkiye
[Link]@[Link]
[Link]@[Link]
Abstract—This comprehensive study presents the mathematical manipulators must interact with their environment
modeling, control system design, and simulation-based dynamically, making real-
performance evaluation of a two-degree-of-freedom (2-DOF)
servo-driven robotic manipulator specifically developed for
time decisions based on sensor or logic inputs. To address
automated pick-and-place applications. In order to elevate the
system from a simple repetitive mechanism to an intelligent
these requirements, this project focuses on a 2-DOF planar
automation unit, a color sorting algorithm was integrated during robotic manipulator operating in the X-Z plane, modeled and
the final development stage. This enhancement grants the robot simulated comprehensively within the MATLAB
the capability to visually detect and physically transport only the environment. For the final iteration of this project, a cognitive
boxes that match a predefined target color from a randomized task was introduced: the robot must identify a randomly
array of four objects. At the actuator level, each joint is assigned "target color" among a set of Red, Green, Blue, and
independently driven by a Permanent Magnet Synchronous Yellow boxes. It is tasked with evaluating each box, skipping
Motor (PMSM). These motors are governed by a sophisticated the mismatched ones, and securely transporting only the
cascaded control architecture utilizing Field Oriented Control
matching objects to a designated delivery zone. The robust
(FOC). The simulation incorporates realistic electrical and
mechanical constraints, demonstrating that the proposed and precise drive dynamics facilitated by the FOC cascade
structure provides highly accurate position tracking, stable drive control ensure that the physical execution of this logical
behavior, and successful execution of the high-level decision- sorting task is both smooth and highly reliable.
making process required for color-selective sorting.
Keywords— 2-DOF robotic arm, pick-and-place robot, PMSM 2. Method
servo drive, Field Oriented Control (FOC), cascaded PI control,
inverse kinematics, SVPWM, MATLAB simulation 2.1. Robot Structure and Color Sorting Task Definition
1. Introduction The mechanical framework of the system is based on a two-
link planar serial manipulator configuration. The primary link
Robotic manipulators form the backbone of modern industrial is connected to the base via the first rotational joint, while the
automation, being extensively deployed for high-speed and secondary link, carrying the end-effector, is actuated by the
precise pick-and-place operations in assembly lines, packaging second joint. The physical dimensions of the links are
facilities, and manufacturing plants. While traditional established as L1 = 0.35 meters and L2 = 0.25 meters,
academic studies often simplify robotic joints by modeling providing an adequate and compact workspace for object
them solely with ideal position controllers, practical industrial manipulation.
applications demand a much deeper integration. Real-world
robotic performance is heavily dictated by actuator dynamics, Unlike continuous path applications such as welding, the task
current constraints, torque generation limits, and the trajectory in this pick-and-place scenario is divided into
interaction between mechanical inertia and electrical power sequential, dynamically replanned phases. The robotic
converters. operation cycle includes: approaching and hovering over a
target box, executing a vertical descent, entering a dwell phase
Furthermore, contemporary automation systems are expected to evaluate color congruence, grasping the object if a match is
to move beyond blind trajectory tracking. Modern confirmed, lifting it, traversing horizontally to the predefined
1
drop zone, and finally descending to release the payload. must generate sufficient torque to support and accelerate the
Crucially, if the cognitive algorithm determines a color combined structural mass of both linkages, the end-effector,
mismatch during the dwell phase, the end-effector abstains and the payload. Conversely, Joint 2 primarily handles the
from grasping, safely retreats, and proceeds to evaluate the inertial mass of the distal link and the end-effector itself. This
next box in the sequence. realistic parameterization inherently causes distinct torque
demands and varying positional tracking profiles between the
2.2. Inverse and Forward Kinematics two joints, particularly during rapid acceleration and
deceleration phases, thereby validating the need for robust
Because the automated color sorting task is executed within a control algorithms to maintain synchronized movement.
defined Cartesian workspace, the desired operational
coordinates $(x_d, z_d)$ of the end-effector must be 2.4. PMSM Servo Drive and Cascaded FOC Control
continuously and accurately mapped to the corresponding joint
reference angles $(\theta_1, \theta_2)$. This critical To accurately replicate the high-performance behavior of
transformation is achieved through robust inverse kinematics authentic industrial servo systems—such as those required for
equations. A geometric approach is utilized to compute these rapid mechatronic tasks like automated boxing—the robotic
angles, intentionally defaulting to a physically feasible elbow joints are actuated by independent Permanent Magnet
configuration (such as an elbow-up posture). This constraint is Synchronous Motors (PMSM). These motors are
vital to prevent singularity issues, such as infinite joint mathematically modeled within the rotating synchronous $d-
velocities, and to avoid mechanical collisions during the q$ reference frame using continuous Park and Clarke
continuous pick-and-place motion. transformations.
To verify and visualize the actual trajectory executed by the The overarching control strategy employs a robust cascaded
robotic arm, forward kinematics equations are systematically Proportional-Integral (PI) architecture, meticulously structured
implemented within the main control loop. While the inverse into three distinct, bandwidth-separated layers. The outermost
kinematics generate the target references, the actual end- position tracking loop generates the necessary velocity
effector position is dynamically reconstructed from real-time references based on spatial trajectory errors. This feeds into
joint angle measurements provided by the system's feedback the intermediate speed regulation loop, which subsequently
mechanisms. calculates the required torque commands. Finally, the inner
$d-q$ current control loops actively regulate the electrical
This dual-kinematic implementation establishes a closed-loop dynamics, operating at a significantly higher sampling
self-verification mechanism. It continuously minimizes the frequency to successfully manage the rapid electrical time
error between the targeted visual coordinates and the physical constants.
mechanical positioning, providing the precise coordinate
mapping necessary to seamlessly align the robot's physical By utilizing the principles of Field Oriented Control (FOC),
workspace with the dynamic parameters of the color sorting the direct-axis current ($i_d$) is strictly maintained near zero.
process. This magnetic decoupling ensures that the quadrature-axis
current ($i_q$) efficiently and exclusively dominates
2.3. Mechanical Dynamics of the Joints electromagnetic torque production, effectively maximizing
torque per ampere. Ultimately, this multi-loop hierarchical
From a comprehensive dynamic perspective, each robotic joint structure effectively isolates the relatively slow mechanical
is mathematically modeled using second-order rotational tracking dynamics (inertia and friction) from the ultra-fast
mechanical differential equations. These governing equations electrical sub-iterations (inductance and resistance), ensuring
accurately account for the total equivalent mechanical inertia tight, responsive trajectory control and sustained system
reflected on the motor shaft, dynamic viscous friction stability even under dynamically changing operational states
coefficients, and nonlinear Coulomb friction components. and computational loads.
Furthermore, they compute the precise electromagnetic torque
production required from the actuators to successfully
overcome these mechanical impedances across varying
operational phases—specifically distinguishing between the 2.5. Voltage Saturation, Anti-Windup, and Drive Non-
loaded state (actively carrying a sorted box) and the unloaded Idealities
state (rapidly moving to the search or home position).
To bridge the critical gap between ideal mathematical models
To ensure the simulation strictly mirrors the behavior of a and physical mechatronic reality, several non-idealities and
physical mechatronic system, asymmetrical dynamic constraints are deliberately injected into the simulation
parameters are deliberately applied to the joints. Joint 1 is environment. Specifically, the dynamic $d-q$ voltage vector
subjected to a significantly larger effective load, as its actuator generated by the inner current controllers is strictly
2
constrained according to the physical limitations of the the precise timing characteristics and processing constraints of
inverter's DC bus voltage ($V_{dc}$) and its modulation real-world industrial hardware, a multi-rate solver topology is
limits. Whenever the control effort demands a voltage strategically deployed. In this configuration, the overarching
exceeding this saturation threshold—often during aggressive mechanical dynamics and kinematic trajectory loops operate at
acceleration phases or sudden payload shifts—advanced anti- a base sampling interval of 5 milliseconds ($T_s = 0.005$ s).
windup logic is immediately triggered. This critical Conversely, the highly dynamic electrical current loops are
mechanism dynamically halts the integration of tracking sub-sampled at a proportionally higher frequency to capture
errors, effectively preventing severe controller overshoot and rapid, microsecond-level electromagnetic transients without
ensuring a rapid, stable transient recovery once the system burdening the macro-level kinematic calculations.
returns to its linear operating region.
The physical operational workspace is continuously visualized
Furthermore, the motor drive model comprehensively and validated through a dynamic 3D simulation environment,
accounts for practical hardware limitations by incorporating as illustrated in Figure 1. Within this virtual testbed, an array
simplified inverter dead-time distortion, feedback encoder of four distinctly colored workpieces (e.g., a randomized
quantization effects, and measurement noise. Dead-time, while sequence such as Yellow, Yellow, Red, Blue) is automatically
absolutely essential to prevent shoot-through short circuits generated and aligned along the primary X-axis. A designated
across the inverter legs, introduces subtle but impactful non- "DROP" zone, functioning as the sorting or packaging
linear voltage disturbances and harmonic distortions. destination, is established on the opposing end of the
Simultaneously, the finite resolution constraints of the optical manipulator's workspace.
encoders generate discrete angular steps, which inherently
translate into high-frequency ripples in the estimated velocity During continuous execution, the visual interface dynamically
feedback, particularly during low-speed maneuvers. confirms the intelligent behavior of the robotic arm. The
Introducing these combined non-idealities rigorously tests the system logically scans and evaluates each workpiece in
true robustness of the cascaded control loop, ensuring the sequence, bypassing and rejecting non-matching units. Upon
algorithm can maintain precision in demanding industrial identifying a workpiece that strictly matches the predefined
applications, such as synchronized multi-axis automated "TARGET" color, the manipulator seamlessly executes the
boxing. complete, multi-stage "pick-lift-transfer-place" cycle. This
final stage visually and mathematically demonstrates the
system's successful integration of kinematic precision,
dynamic stability, and autonomous decision-making
2. Simulation Environment capabilities.
4. Experimental Results and Graphical Analysis
Figure 2
Figure 1
The entire electromechanical architecture and its underlying The upper-left plot shows the position tracking performance of
logical control framework are rigorously implemented within Joint 1. The dashed black line represents the reference angle,
the MATLAB environment, utilizing a high-fidelity, time- while the blue line represents the actual response. It can be
domain numerical simulation approach. To accurately emulate seen that the actual trajectory follows the reference closely
throughout the 12-second cycle. During the intervals around
3
3–5 s and 8–10 s, the joint undergoes relatively sharp
directional changes corresponding to the descent and
placement phases. In these regions, small transient deviations
appear, but the controller quickly restores alignment.
The largest dynamic mismatch occurs near the rapid transition
around 8–9 s, where the position error temporarily increases
due to the combined effect of direction reversal, increased
torque demand, and measurement noise. Even in this region,
the response remains stable and returns to the reference
without sustained oscillation. This indicates that the outer
position loop and the inner torque-producing loops are
coordinated effectively.
Figure 4
The upper-right plot presents the electromagnetic torque of
Joint 1. The torque waveform is noisy but bounded, which is
consistent with the presence of encoder noise, inverter dead-
time distortion, and rapidly changing dynamic demands. Since
Joint 1 carries the dominant mechanical load, its torque
fluctuations are larger than those of Joint [Link] torque signal
frequently changes sign, reflecting acceleration and
deceleration events during the pick-and-place cycle. Positive
torque is associated with active acceleration or load support,
whereas negative torque corresponds to braking or reversal
behavior. The waveform remains mostly within approximately
± 3.5 N\cdotpm , which indicates that the joint is driven
within a controlled operating range. This confirms that the
Figure 3 cascaded structure is able to generate sufficient actuation
authority while preserving stability.
The upper-middle plot shows the d-axis and q-axis current
responses for Joint 1. The q-axis current i qexhibits the larger
variation, which is expected because it is the primary torque-
producing component in the adopted FOC strategy. The d-axis
current i d remains centered around zero with relatively smaller
amplitude, confirming that the controller maintains a near-zero
flux-axis current [Link] the manipulator enters more
demanding motion phases, especially during the large angular
transitions, the amplitude of i qincreases. This demonstrates
that the servo drive automatically raises current demand to
generate the required torque. The currents remain within the
indicated current limits and do not show prolonged saturation.
This is an important result because it confirms that the
controller achieves trajectory tracking without relying on
physically unrealistic current excursions. Figure 5
The middle-left plot shows the position tracking of Joint 2.
The actual response, shown in red, follows the reference very
closely over the full task duration. Compared with Joint 1, the
Joint 2 trajectory contains a larger absolute angular sweep,
especially in the transition toward the placement region where
the angle moves from approximately −90 ∘toward −160∘ .
Despite this large motion, the actual and reference curves
remain almost visually overlapping for most of the simulation.
4
This strong tracking performance indicates that the second The middle-right plot shows the electromagnetic torque of
joint controller is well tuned for the commanded motion. Joint 2. The torque magnitude is generally smaller than that of
Because the second link directly influences end-effector reach Joint 1, which is expected because Joint 2 drives a smaller
and vertical placement precision, accurate tracking of Joint 2 effective inertia and shorter moment arm. Even so, the torque
is particularly important for successful pick-and-place clearly responds to task-dependent motion changes. During
behavior. The plot shows that the controller maintains this periods of steady or slowly varying motion, the torque remains
precision even during large-angle transitions. closer to zero, while during aggressive transitions it becomes
more oscillatory.
The signal is mostly confined within approximately
−2 N\cdotpm to +1.5 N\cdotpm . This range is physically
reasonable for the second joint and demonstrates that the
controller generates sufficient torque without excessive stress.
The correspondence between increased current activity and
increased torque magnitude also confirms that the FOC-like
current regulation is functioning consistently.
Figure 6
The middle plot in the second row shows the d–q current
behavior of Joint 2. Similar to Joint 1, the q-axis current is the
dominant torque-producing component, while the d-axis
current oscillates around zero. However, the current
amplitudes of Joint 2 appear somewhat lower and more
structured in certain intervals, which is consistent with its
lower torque requirement and different effective inertia.
A notable feature is the change in current activity during the Figure 8
mid-to-late portion of the simulation, where the joint executes
its largest angular transition. During this interval, the current The lower-left plot shows the position tracking error of Joint
amplitude increases, indicating that the controller is 1. The error remains centered around zero for most of the
compensating for the higher torque demand associated with simulation, with moderate fluctuations caused by quantization,
the rapid movement and load redistribution. The currents noise, and fast reference transitions. In general, the error stays
remain bounded within the specified range, confirming that within approximately ± 0.5∘, except for a brief transient
the drive limits are respected. region around 8–9 s where the magnitude approaches about
∘
−1 .This brief increase coincides with the most demanding
segment of the trajectory and is consistent with the behavior
observed in the Joint 1 position plot. Importantly, the error
does not diverge and does not exhibit long-duration oscillatory
growth. Instead, it is quickly reduced after the transient event.
This indicates that the closed-loop system has sufficient
damping and recovery capability.
Figure 7
5
A key observation is that the voltage commands frequently
approach the upper and lower bounds visible in the plot,
especially during dynamic intervals. This suggests that the
drive is operating near its available voltage limit during rapid
motion changes. However, the waveform remains bounded
and does not exhibit uncontrolled divergence, which confirms
that the saturation and anti-windup mechanisms are
functioning correctly. In practical terms, this means the
controller is using a large portion of the inverter capability
during demanding segments while still maintaining stable
operation.
5. Conclusion
Figure 9
This study presented the design and MATLAB-based
The lower-middle plot shows the position tracking error of simulation of a two-degree-of-freedom servo-driven robotic
Joint 2. Compared with Joint 1, the error is smaller in manipulator developed for automated pick-and-place
magnitude and remains more tightly bounded around zero for applications. The proposed system combines a planar robot
most of the cycle. The observed error is typically within arm model, segmented Cartesian trajectory generation, inverse
kinematics, simplified joint dynamics, and PMSM-based servo
approximately ± 0.2∘, with short excursions reaching about
actuation within a unified simulation framework. Unlike
∘
−0.4 during the most dynamic portions of the motion. purely kinematic robot studies, the present work explicitly
models the internal behavior of the actuator drives through a
This result is particularly significant because Joint 2 executes cascaded FOC architecture consisting of position, speed, and
a large angular displacement yet still preserves a relatively d–q current control loops.
small tracking error. The error pattern suggests that the
controller is responsive enough to handle large commanded The simulation results demonstrate that the manipulator
movements without accumulating substantial lag. The successfully follows the commanded pick-and-place trajectory
smoother error envelope also indicates that the second joint with stable and accurate performance. Both joints track their
dynamics and controller tuning are well matched. reference angles closely, and the corresponding tracking errors
remain small and bounded throughout the operation. The
current and torque responses show physically meaningful
behavior that changes according to motion demand, while the
voltage commands remain constrained within realistic drive
limits due to saturation and anti-windup protection. These
findings confirm that the proposed control structure is capable
of producing coordinated electromechanical behavior under
dynamic operating [Link] important contribution
of the study is its educational value. By presenting position,
current, torque, error, and voltage variables simultaneously,
the model makes the interaction between robot motion and
servo-drive dynamics directly observable. This allows the user
to understand how trajectory changes propagate through the
control hierarchy and ultimately affect the physical actuation
process. For this reason, the developed model can be
considered a practical bridge between theoretical robot
kinematics and real-world servo system behavior.
Figure 10
As future work, the model can be extended by adding a full
The lower-right plot shows the d-axis and q-axis voltage
three-phase inverter model, more detailed PMSM parameter
commands for Joint 1, labeled as SVPWM-related drive
identification, payload variation scenarios, fault-tolerant
voltages. The red v qcomponent dominates the plot, which is control strategies, and a Simulink-based real-time
expected because the q-axis is the main torque-producing implementation. In addition, the same framework can be
channel. The blue v dcomponent is smaller and appears adapted for trajectory optimization, energy-aware motion
intermittently, consistent with the control objective of planning, or experimental validation on a laboratory-scale
maintaining i d near zero. robotic manipulator.
6
References
[1] J. J. Craig, Introduction to Robotics: Mechanics and
Control, 3rd ed. Upper Saddle River, NJ, USA: Pearson, 2005.
[2] M. W. Spong, S. Hutchinson, and M. Vidyasagar, Robot
Modeling and Control. Hoboken, NJ, USA: Wiley, 2006.
[3] R. Krishnan, Permanent Magnet Synchronous and
Brushless DC Motor Drives. Boca Raton, FL, USA: CRC
Press, 2010.
[4] B. K. Bose, Modern Power Electronics and AC Drives.
Upper Saddle River, NJ, USA: Prentice Hall, 2002.
[5] D. W. Novotny and T. A. Lipo, Vector Control and
Dynamics of AC Drives. Oxford, U.K.: Oxford Univ. Press,
1996.
[6] MathWorks, “MATLAB Documentation,” MathWorks,
Natick, MA, USA.
[7] MathWorks, “Control System Toolbox Documentation,”
MathWorks, Natick, MA, USA.
[8] MathWorks, “Motor Control Blockset Documentation,”
MathWorks, Natick, MA, USA.
[9] MathWorks, “Robotics System Toolbox Documentation,”
MathWorks, Natick, MA, USA.