1. Introduction
Industry routinely employs simulation tools for product development, manufacturing optimization, and control-system design [
1,
2,
3]. In robotics, simulations play a central role in developing new applications, primarily due to modern simulators’ ability to provide high-fidelity physics and realistic world modeling [
4]. The Industry 4.0 era has further intensified the use of simulation and virtual environments for testing, training, and validating robotic systems [
3,
5].
Automated Guided Vehicles (AGVs) have operated in manufacturing environments for over five decades [
6]. Today, they serve internal logistics systems and industrial shop floors, as well as various non-industrial applications [
7]. AGV control-system performance ensures safe operation and directly impacts production-line efficiency [
1]. Position control represents the core of any AGV system.
Modern simulators reproduce sensor and actuator behavior in far greater detail than numerical control models, enabling more realistic and varied experiments. These virtual environments cut development time and resource costs while offering flexible test conditions that would be impractical to replicate physically. By using simulation tools for control-system design and tuning, engineers can safely evaluate critical scenarios—such as extreme loads or dynamic disturbances—and concurrently run multiple AGV instances, a process that would otherwise demand several physical vehicles and extensive setup.
This paper demonstrates Unity as a simulation platform for developing, tuning, and operating AGV position-control systems. Our research advances beyond traditional simulators that rely solely on kinematic models by using Unity’s dynamic representation capabilities. Although several mobile robot and AGV simulators support physics engines [
8,
9], the literature indicates they are typically applied only for kinematic modeling [
7]. Unity’s native physical components inherently integrate with its physics engine, enabling physically accurate dynamic behavior simulation.
Beyond dynamic modeling, Unity excels in visual fidelity and real-time sensor simulation. Originating from game development, Unity delivers high-quality graphics, scalable environments, and accurate shadow rendering, which can enhance vision-based localization and mapping experiments. Its multithreaded architecture supports real-time 3D LiDAR simulations [
10,
11,
12], while Time-of-Flight cameras benefit from Unity’s precise 3D object modeling and synchronized viewpoints for millimeter-level depth accuracy [
13]. Compared to Gazebo’s strong ROS integration—which can limit rendering performance in large-scale LiDAR scenarios—Unity delivers superior scalability and real-time sensor fidelity [
14]. Moreover, Unity is freely available to academics under the Education Grant License [
15], making it an accessible choice for AGV control strategy analysis under realistic conditions.
While Unity enables accurate physical and visual modeling, effective control remains crucial for ensuring AGV stability and trajectory tracking. PID controllers remain the industry standard, with about 97% of industrial control loops relying on them [
16]. These controllers adjust proportional, integral, and derivative gains to minimize tracking errors, yet poor tuning often results in slow dynamic response, higher energy consumption, and potential safety risks [
17]. In extreme cases, misconfigured gains can destabilize the system. Despite advances in adaptive and intelligent control, line-following AGVs continue to depend on PID schemes for their simplicity and reliability [
7].
This study employs PID tuning strictly as a case study to validate the proposed Unity-based AGV simulation platform, not to advance PID methodology. Two classic tuning approaches—exhaustive search and Ziegler-Nichols—were selected as baseline methods for the following reasons: (i) they are widely adopted in industry for their simplicity and predictable behavior; (ii) they serve as clear reference points to demonstrate Unity’s ability to replicate real-world controller performance under varying payloads and dynamic interactions; and (iii) they establish quantitative performance benchmarks that future research can directly compare when investigating more sophisticated tuning algorithms. Focusing on these baseline methods keeps our emphasis on the physics-based simulation framework rather than PID development.
Commercial line-following AGVs are usually tuned under full-load conditions, since maintaining line adherence at lower loads and slow speeds is rarely problematic. However, physical tuning demands extensive gain adjustments and on-site testing, which can be time-consuming and costly. A virtual environment streamlines this process by allowing rapid evaluation of controller performance across various payload scenarios, and by facilitating feasibility studies for additional sensors—such as load detectors—without hardware modifications.
Tuning AGV controllers on-site often leads to significant delays and costs, requiring weeks of specialized trials and production downtime. Our simulation framework overcomes these challenges by providing a virtual environment for safe parameter exploration, rapid design iterations, and comprehensive performance validation under varied payloads and operating conditions—eliminating risks to personnel and hardware. This capability is particularly valuable in electronics manufacturing, where AGVs navigate narrow aisles with millimeter-level precision to protect sensitive equipment.
Despite growing interest in simulation for AGV development [
18,
19], most research remains confined to numerical models and light-load vehicles [
10,
20,
21,
22,
23,
24,
25,
26]. Popular platforms such as Gazebo, ADAMS with MATLAB/Simulink, and Unity support various validation and trajectory-tracking scenarios, yet they typically employ simplified kinematic models. This gap—between basic numerical approaches and fully dynamic simulators—highlights the need for our physics-based Unity framework, which extends simulation capabilities to heavy-load and dynamic conditions.
Most AGV simulation studies rely on kinematic models in environments like Gazebo [
27,
28,
29], ADAMS with MATLAB/Simulink [
30], or Unity [
31,
32], but they rarely use modern physics engines for true dynamic modeling. A systematic review of 92 papers shows only 3 (3.3%) used physics-based simulators according to [
7], while 34 (37%) depended solely on numerical simulations, with further examples as [
10,
20,
21,
22,
23,
24,
25,
26]. Furthermore, 61 studies (66.3%) limited themselves to kinematic-only models, and just 21 (22.8%) incorporated dynamic effects—an important omission for AGVs facing variable payloads and changing friction conditions.
Unity-based robotics research has largely emphasized visualization and basic motion control [
11,
31,
33,
34,
35,
36,
37]. In contrast, we harness Unity’s NVIDIA PhysX engine to simulate AGV dynamics—capturing load variations, suspension behavior, and realistic wheel-ground interactions. Our systematic review reveals that only 6 of 92 papers (6.5%) explore load variation, 49 (53.3%) lack industrial validation, and just 16 (17.4%) use quantitative performance metrics [
7]. By embedding dynamic modeling at the core of our framework, this work aims to overcome the prevailing reliance on numerical and kinematic-only simulations, enabling realistic AGV controller validation under industrial constraints.
We simulate a lightweight, compact AGV tailored to electronics manufacturing, where small-form-factor vehicles must navigate narrow aisles and handle standard light-load boxes [
6]. This design optimizes storage density while demanding precise position control to prevent collisions, highlighting the need for fine-tuned control parameters in the virtual environment. We implement AGV dynamics with Unity’s NVIDIA PhysX engine, using
RigidBody component, applying forces and torques to replicate realistic robot behavior [
12,
38,
39]. The
WheelCollider component was used to simulate mecanum-wheel traction at 45°. It simulates wheel characteristics—friction, damping, and traction—allowing accurate representation of suspension effects and wheel–ground interactions. This setup makes it possible to reproduce critical dynamic conditions, such as varying load masses, without the complexity and cost of physical prototypes. For line following, a virtual sensor array of 100
BoxCollider elements detects the guidance line—offset slightly above the floor—to emulate optical or magnetic sensor behavior.
Considering the gaps identified in [
7], this paper makes three distinct contributions. First, a physics-driven Unity framework is introduced, integrating NVIDIA PhysX dynamics to model AGV behavior under varying payloads, wheel–ground interactions, suspension effects, and trajectory conditions. Unlike most existing tools, which apply only kinematic models, the proposed platform captures dynamic responses, addressing the fact that only 3.3% of prior studies employed physics-based simulators.
Second, a dual validation methodology is proposed, consisting of (i) a shop-floor support tool that enables technicians to tune PID gains in situ without halting production, and (ii) an optimization module that performs exhaustive parameter searches to identify performance-optimal gains.
Third, an evaluation suite is embedded into the simulation workflow, which provides quantitative performance benchmarks across multiple load scenarios. The possibility of embedding the computation of different performance indicators addresses the omission in 82.6% of previous works that relied solely on graphical or qualitative analyses. Together, these contributions advance Unity-based AGV research beyond mere visualization and enabling practical on-line tuning, systematic parameter exploration, and reproducible performance comparison for future metaheuristic or adaptive control strategies.
The remainder of this paper is organized as follows:
Section 2 reviews related work;
Section 3 describes the implementation of the proposed virtual environment;
Section 4 presents the simulation experiments;
Section 5 analyzes the results; and
Section 6 presents the conclusions.
4. Case Study: PID Controller Tuning Processes
4.1. Exhaustive Search
The exhaustive-search (ES) method systematically explores the solution space by evaluating all combinations of PID gains (, , and ) across different payload masses. Each combination is simulated, performance metrics are computed, and results are filtered according to predefined acceptance criteria.
The main advantage of ES is its exhaustive coverage of parameter combinations, increasing the likelihood of identifying the optimal parameter set. However, this method imposes a significant computational burden, as the number of required simulations grows exponentially with the number of variables considered and the granularity of the search grid.
The search covers nine discrete payload masses—, , , , , , , , kg—added to the AGV’s fixed base mass of . At each total mass, the AGV navigates a straight-line lane while all PID gain combinations are tested.
The proportional gain varies from to , while the integral and derivative gains vary from to . All parameters are incremented in steps of , resulting in a dense grid of possible configurations that are systematically simulated. These ranges and the step size were determined empirically from preliminary tests that identified gain combinations capable of keeping the AGV on track while balancing resolution and computational cost. Using this grid, the exhaustive search required between 60 and 80 h of simulation on our standard hardware.
Each gain triplet (, , ) undergoes two evaluation stages. First, the AGV must maintain lane following for at least 10 s; triplets that fail this test are discarded. The 10 s sustainment criterion requires that the lateral error remain within ±5 cm of the track centerline, sampled every 10 ms, starting from a fixed initial pose .
In the second stage, valid configurations are assessed quantitatively by computing three lateral-deviation metrics: the mean , standard deviation , and maximum absolute value of the lateral deviation over time . This information is stored along with the corresponding PID parameters and the total vehicle mass for each simulation instance. For each stable triplet, the ES simulation script automatically logs the performance metrics. Instantaneous error samples were discarded to limit data volume. For infinity-track trials, besides those metrics, the simulation stores the AGV’s trajectory.
Equation (
12) defines the mean lateral deviation
, calculated as the arithmetic average of the individual displacement errors
over
recorded samples. This metric represents the average deviation of the AGV from the center of the lane throughout the simulation.
Equation (
13) defines the standard deviation
of the lateral deviation, which quantifies the variability of the AGV’s deviation from the center of the lane. It is computed as the square root of the unbiased sample variance, based on the differences between each recorded error
and the mean error
, over
samples.
Finally, Equation (
14) defines the maximum absolute lateral deviation
, calculated as the largest absolute error
observed among all
recorded samples. This metric indicates the greatest deviation of the AGV from the center of the lane during the simulation.
Algorithm 1 presents the pseudocode that describes the procedure adopted to perform the exhaustive search of the PID controller parameters.
Figure 7 illustrates different instances of the simulation performed during the exhaustive search of the PID controller parameters for the AGV. The evaluated gain values appear in the upper-left corner of each image. Although these visuals are not required for the search itself, they offer qualitative insight into the AGV’s lateral behavior throughout the process. This demonstration highlights Unity’s versatility as a simulation platform for systematically investigating control-parameter spaces and observing system responses under different PID settings and load conditions.
| Algorithm 1 Exhaustive search algorithm for PID tuning with varying load masses. |
- Require:
range, range, range, loadMasses, stepSize - 1:
procedureExhaustiveSearch(, , , loadMasses, stepSize) - 2:
for each m in loadMasses do - 3:
for from to with stepSize do - 4:
for from to with stepSize do - 5:
for from to with stepSize do - 6:
simulate AGV with total mass and PID gains - 7:
if AGV remains on track for at least 10 s then - 8:
compute mean error, standard deviation, and maximum error - 9:
store m, , , , mean, std, max error - 10:
end if - 11:
end for - 12:
end for - 13:
end for - 14:
end for - 15:
return list of stable configurations - 16:
end procedure
|
4.2. Ziegler-Nichols Tuning Method
Ziegler–Nichols methods are empirical techniques commonly used to configure PID controllers [
57]. The second method relies on varying the proportional gain
, while keeping
and
and observing the system’s response. The goal is to identify a value of
that leads the system to a condition of sustained oscillation, known as the stability limit. This value is referred to as the critical gain
, and the corresponding oscillation period is called the critical period
. Algorithm 2 presents the pseudocode for applying this tuning method.
| Algorithm 2 Ziegler-Nichols second tuning method algorithm. |
- Require:
increment, stopCriterion - 1:
procedureTuningProcess(increment, stopCriterion) - 2:
- 3:
- 4:
- 5:
while stopCriterion is false do - 6:
- 7:
if output presents a periodic oscillatory signal then - 8:
stopCriterion ← true - 9:
else - 10:
stopCriterion ← false - 11:
end if - 12:
end while - 13:
- 14:
- 15:
if P controller then - 16:
- 17:
- 18:
- 19:
else if PI controller then - 20:
- 21:
- 22:
- 23:
else if PID controller then - 24:
- 25:
- 26:
- 27:
end if - 28:
- 29:
- 30:
return , , - 31:
end procedure
|
Once and are identified, the remaining gains are calculated using Ziegler–Nichols empirical formulas. This approach allows satisfactory controller performance without an explicit mathematical model.
Although the method enables fast tuning, its application may lead to suboptimal performance, particularly in terms of disturbance rejection and settling time. This limitation arises because the sustained oscillation criterion considers only the marginal stability of the system, neglecting other important response characteristics, such as overshoot and steady-state error.
This method also highlights Unity’s value as an interactive simulator: operators can adjust PID gains and immediately observe AGV responses, facilitating hands-on learning and controller configuration.
To simulate the AGV using this tuning method, the parameters , , and are first set to zero. Then, the user increments until sustained oscillations appear. This process is repeated for each load condition to identify .
Two users executed the tuning process using distinct -scanning strategies:
Linear search: the value of is gradually increased from zero using a fixed step size until the system reaches the sustained oscillation condition;
Binary search: a range is defined, and the value of is adjusted using the bisection method until convergence to the critical gain.
After determining and , the PID gains are calculated using classical Ziegler–Nichols formulas based on controller type (P, PI, or PID).
Critical gain was identified via manual peak detection in Unity’s debug output, and critical period was computed as the average interval between consecutive peaks over five cycles. Each user required 20–40 min per load to converge on
, reflecting realistic variability in operator experience.
Figure 8 illustrates a sequence of simulation snapshots demonstrating the application of the Ziegler–Nichols tuning method in the Unity virtual environment.
Tuning was performed across six discrete payloads—, , , , , kg—added to the AGV’s base mass of .
4.3. Experimental Setup
This section describes the experiments conducted to evaluate different PID controller tuning strategies applied to an AGV simulated in a virtual environment on two workstations (Intel Core i7-7700HQ @ 2.80 GHz processor, 16 GB DDR4 2400 MHz RAM, NVIDIA GeForce GTX 1050-4GB GDDR5 GPU, Windows 10 OS and Intel Core i5-8250U CPU @ 1.60 GHz processor, 8 GB DDR4 2400 MHz RAM, NVIDIA GeForce 930MX 2 GB GDDR5 GPU, Windows 10 OS) with a fixed time step of s and default PhysX solver settings. The experiments were organized into two main stages: the controller tuning stage and the evaluation stage, which assessed the performance of the tuned controllers under varying operating conditions. Each trial on the infinity-shaped track consisted of a single complete lap. Since no noise sources were introduced and preliminary checks confirmed negligible variability, each gain configuration was tested only once per load condition.
In the first approach, an exhaustive search was performed to identify combinations of gains , , and that maintained lane following for at least 10 s. Each combination within the defined parameter ranges was tested on a straight-line lane, and only those resulting in stable behavior were retained.
To simulate different system operating points, the mass of the load transported by the AGV was varied. For each stable combination, the mean, standard deviation, and maximum value of the lateral error with respect to the guide track were recorded. The objective of this experiment was to obtain, for each load condition, a set of gain values that ensured system stability.
The second experiment involved applying the second Ziegler–Nichols empirical tuning method, based on identifying the critical proportional gain and the corresponding oscillation period , both obtained from sustained oscillations. The parameters and were initially set to zero, and was gradually adjusted until the AGV response reached the marginal stability condition.
Two operators—both Computer Engineering students with basic control-systems knowledge and prior Unity experience—independently applied the Ziegler–Nichols tuning procedure to assess user variability. Each operator performed one tuning trial per payload, visually judging the onset of sustained oscillations. Final PID gains were then computed using classical Ziegler–Nichols formulas. This experiment evaluated Unity’s utility as an interactive tuning platform and quantified the impact of subjective judgment on empirical controller tuning.
After determining the PID gains using both strategies, the controllers were tested on a infinity-shaped lane, under the same load conditions used during tuning. The goal was to analyze controller performance in a more complex scenario than the straight track, considering metrics such as position error and the duration of stable operation. The evaluation recorded gain values, payload mass, and motor torque limits. Motor torque was limited to 5 Nm.
To further assess controller robustness, simulations were also performed under conditions different from those used during tuning. Each controller was tested with its original load value plus three distinct payload variations. This setup enabled analysis of how changes in the transported mass affect system performance, with the aim of evaluating the controller’s ability to handle variations in the system’s dynamic behavior.
The simulation results underscore the limitations of fixed-gain PID controllers when operating under variable payloads, suggesting the need for adaptive or gain-scheduled control strategies in AGVs with dynamic loads. We emphasize that Unity was used primarily as a development and simulation platform, not as an optimizer for AGV performance. Both exhaustive-search and Ziegler–Nichols methods were applied to demonstrate how Unity enables systematic exploration of controller-parameter spaces, revealing how load variations affect controller performance. This case study illustrates Unity’s potential for in-depth analysis and testing of control strategies in a fully virtual environment.
Likewise, the Ziegler–Nichols tuning procedure showcases Unity’s value as an interactive support tool that allows operators to adjust controller parameters and visualize AGV responses in real time. Controlled experiments with multiple operators reveal how Unity facilitates both theoretical learning and hands-on tuning, bridging the gap between design methods and practical implementation. Overall, this case study underscores Unity’s flexibility for developing, testing, and understanding control strategies in a virtual environment, emphasizing its role as a learning and experimentation platform rather than as a definitive PID tuning solution.
5. Results and Discussions
The comparative study of exhaustive search and Ziegler–Nichols tuning demonstrates that Unity is an effective platform for validating AGV control systems. Exhaustive search yields more consistent performance and lower sensitivity to load variations across all tested conditions.
Although we compare PID tuning methods, the main objective is to showcase Unity as a simulation environment for control systems. It enables testing different controllers under varying load conditions, collecting detailed performance metrics, and analyzing complex trajectories, providing a safe, repeatable, and visually verifiable tool. Our results confirm its ability to provide performance, stability, and sensitivity data, underscoring Unity’s value for validation and optimization before physical testing.
From an Industry 4.0 perspective, Unity offers multiple integration pathways. First, as a digital twin for operator training, it lets technicians explore AGV behavior without halting production. Second, the shop-floor support module interfaces directly with PLCs via EtherCAT or Modbus, allowing on-site tuning and validation before controller deployment. Third, simulation results export to standard formats (e.g., OPC UA, MTConnect), facilitating integration with MES and WMS. This multi-layered approach makes Unity a practical tool for AGV lifecycle management, from controller design to post-deployment optimization.
Mean error values from exhaustive search remained consistently closer to zero across all load levels, see
Table 1, indicating better trajectory tracking. Although the empirical method occasionally yielded smaller absolute errors (e.g., at 15 kg), the overall trend favored exhaustive search, which showed greater precision and reduced variation across loads.
Moreover, system variability, measured by error standard deviation, was substantially lower with exhaustive-search tuning. For instance, under no-load conditions (0 kg), Ziegler–Nichols produced a standard deviation of cm versus cm for exhaustive search; at 50 kg, this metric dropped from cm to cm. These results confirm that exhaustive search yields more stable trajectories with reduced oscillations.
Lap times showed negligible differences between methods for loads up to 20 kg, varying by at most three seconds. At 50 kg, both methods resulted in identical lap times (98 s), suggesting that, in this case, the lap duration is constrained by the system’s inherent inertia rather than the tuning method employed.
We selected the best gains per load by first identifying triplets with the lowest maximum absolute error, then ranking them by mean absolute error, resulting in controller configurations with optimal peak and average performance.
Table 2 presents the best set of gains for each load condition. The controller identifiers use the letter B to indicate the best-performing configurations. For comparison purposes,
Table 3 shows the worst results from the same simulations, identified by the letter W in the Controller ID. Although the mean error values may be similar to those in
Table 2, the standard deviation and absolute maximum error reveal significant differences in vehicle performance.
The superior performance of exhaustive-search controllers can be attributed to their ability to systematically explore the parameter space under specific load conditions, resulting in gain combinations that better compensate for system inertia variations. For instance, controllers tuned at moderate loads (e.g., B8 at 50 kg) exhibited higher integral gains () compared to lighter-load configurations (), enabling improved steady-state error correction when vehicle mass increased. This suggests that tuning under representative operational loads produces controllers with inherent robustness to load variations—a critical requirement for industrial AGVs that frequently transport payloads of varying masses.
These differences reveal a key trade-off: exhaustive search demands computational resources but delivers more reliable, reproducible results than empirical methods—particularly for systems with variable loads, where consistency is critical in industrial settings.
This study used classical methods to establish performance baselines. Future work will integrate modern heuristic algorithms—such as genetic algorithms and particle swarm optimization—within Unity. These could accelerate convergence and enable adaptive tuning for real-time load changes. The Unity platform’s modular architecture inherently supports such extensions, enabling direct comparative analysis of classical versus metaheuristic methods under identical simulation conditions.
Two operators applied the Ziegler–Nichols method to tune the AGV’s position controller.
Table 4 and
Table 5 show the results obtained for the different load conditions. From the determination of the critical gain and critical oscillation period, the gains of the P, PI, and PID controllers were computed according to Algorithm 2.
Table 4 and
Table 5 reveal that operator subjectivity significantly affects Ziegler–Nichols PID tuning, even in a virtual environment. It can be observed that the critical gains
calculated using the empirical Ziegler–Nichols method did not vary significantly between operators. However, variations in the measured oscillation period
caused large discrepancies in computed PID gains.
The differences observed in the tuned parameters reveal key limitations of the Ziegler–Nichols method in terms of its reliability and reproducibility. As it relies on the accurate identification of specific conditions—such as the critical gain and critical period —the method is highly vulnerable to operator-dependent interpretation. In systems with higher dynamic complexity, such as those involving heavier loads, this vulnerability becomes even more pronounced, resulting in significantly different parameter sets for the same system. This variability undermines the quality of the tuning and, consequently, the performance of the controlled system. It is also noteworthy that, although the proportional gain calculated by the empirical method was similar to that obtained via exhaustive search, the integral and derivative gains exhibited significant discrepancies, which led to instability in all simulations using the PI and PID controllers tuned empirically.
Table 6 compares the PID controller gain values obtained by the operators and through exhaustive search. A trend of increasing divergence in the operator-tuned parameters is observed as the load applied to the AGV increases. The gains
,
, and
exhibited small discrepancies for light loads (0 to 20 kg), with small and consistent absolute differences. However, for higher loads, particularly at 100 kg, these differences became substantial. The proportional gain
differed by 0.516 between operators, while the integral gain
reached a discrepancy of
. This sharp increase in divergence suggests that the dynamic complexity of the system compromises the consistency of the empirical tuning method. Notably, the integral and proportional gains were the most sensitive to variation between operators, indicating that these components are particularly susceptible to subjective interpretations during the identification of the sustained oscillation point.
In light of these findings, the adoption of more robust tuning strategies becomes essential. Automated methods or simulation-based exhaustive search techniques are capable of minimizing subjective interference and ensuring greater consistency and standardization in the tuning results.
The current implementation relies on a discretized line sensor model and a differential-drive kinematic constraint, which may introduce biases in reported metrics. For instance, the sensor’s discrete resolution (100 elements) could underestimate small-amplitude oscillations, while the absence of external disturbances (e.g., floor irregularities, wheel slippage) limits the generalizability of tuning results to real-world environments. Future work will validate these findings with physical AGV prototypes and incorporate sensor noise models to assess controller robustness under non-ideal conditions.
From an industrial perspective, the operator-dependent variability observed in Ziegler-Nichols tuning presents significant challenges for standardization and quality assurance in automated manufacturing environments, reinforcing the value of simulation-based optimization approaches that minimize human subjectivity.
After identifying the best gains obtained through the exhaustive search, the controllers tuned to each load condition on the straight-line lane were tested on the infinity-shaped lane. The results, based on the defined performance metrics, are shown in
Table 7. Although there is a slight change in the average error values (
change < 0.05 cm), the standard deviation
increases by up to 50% compared to
Table 2—for example, rising from 0.28 cm to 0.42 cm at 20 kg—highlighting reduced precision on curved tracks. An important aspect of this difference is that the tuning was performed on a track without curves. When the controller is tested on the infinity-shaped lane, its curves force the vehicle to operate under different conditions than those present during the tuning phase.
Table 7 also presents the time required for the vehicle to complete a lap. From these values, it can be seen that, for the AGV configuration in the virtual environment, the difference in lap time becomes significant only for loads of 50 kg or more, which reduce the vehicle’s speed and consequently increase the time needed to complete a lap. For loads of 20 kg or less, the lap times remain very similar. These data will also serve as a basis for future comparisons with other controllers.
The results of the simulations conducted by Operator A are presented in
Table 8. Based on the data collected from the infinity-shaped lane, a direct comparison between the controllers tuned using the Ziegler–Nichols method applied by Operator A and those obtained through exhaustive search, shown in
Table 7, reveals notable differences in performance. High integral and derivative gains caused PI and PID controllers to fail—only P controllers remained on track, except at 100 kg where even P control lost the lane.
For equivalent load conditions (0, 10, 15, 20, and 50 kg), the controllers tuned via exhaustive search consistently exhibited lower mean errors and smaller standard deviations compared to those obtained through empirical tuning, while maintaining comparable lap times.
Four controllers tuned using the exhaustive search method—B1, B7, B8, and B9—and four controllers tuned by Operator A—A0-P, A20-P, A50-P, and A100-P—were included in the analysis, see
Table 9. These eight controllers were evaluated under four distinct load conditions to assess the impact of load variation on control performance. Controller B1 failed to maintain the vehicle on track under the 100 kg load condition. Meanwhile, controller A100-P was unable to ensure vehicle stability across all tested load conditions.
Controller B9, tuned for 100 kg, also performed consistently across all tested load conditions, with mean errors close to zero and low standard deviations—for example, cm at 50 kg and only cm at 100 kg. The lap time under the design condition was 2852 s, which is comparable to those of the other controllers tested at this load. The consistent performance under lighter loads, such as 0 and 20 kg, reinforces the idea that tuning at full-load conditions can yield controllers capable of maintaining both stability and accuracy across diverse operating scenarios.
In contrast, the empirically tuned controllers, which employed purely proportional action, exhibited greater variability and lower adaptability to load variations. Controller A0-P, tuned for zero load, showed increasing mean error and high standard deviation as the load increased. At 100 kg, although the average error was small ( cm), the lap time was the highest among all configurations (2885 s), indicating a severe limitation in dynamic performance. Controller A20-P demonstrated slightly more stable performance, including at 100 kg (mean error of cm and standard deviation of cm), though the lap time remained excessively high. Controller A50-P, tuned for high load, followed a similar trend, but delivered inferior performance compared to B8, which was tuned for the same condition. These results indicate that, despite its simplicity, pure proportional control exhibits poor adaptability outside its nominal tuning condition, particularly under heavy loads, where stronger integral and derivative actions are needed to ensure control precision and system stability.
The controllers obtained through exhaustive search exhibited lower sensitivity to load variation. For example, controller B1, tuned for zero load, maintained acceptable performance up to 50 kg, with relatively low mean errors and standard deviations, and lap times comparable to those of controllers tuned for specific load points. Controller B7, tuned for 20 kg, showed stable behavior across all load levels, including 100 kg, where it achieved a nearly zero mean error ( cm), a standard deviation of only cm, and a lap time of 2847 s. This high lap time—similar to those observed with B9 and A0-P—indicates that the system remained on track but moved more slowly due to the vehicle’s increased inertia under heavy load. Controller B8, tuned for 50 kg, achieved the best overall performance, with mean errors close to zero and the lowest standard deviations across all load conditions—for instance, cm at 50 kg and cm at 100 kg. The lap time for 100 kg was also significantly lower (2779 s) compared to the other controllers. These findings imply that tuning at moderate loads yields controllers with broad adaptability.
To analyze the results graphically, the paths followed by the vehicle for each controller and load condition are shown in
Figure 9. Since the error, although noticeable, is not entirely measurable at the scale of
Figure 9,
Figure 10 provides detailed views of the paths at specific points on the track.
Figure 10a shows the central intersection, a point of disturbance for the vehicle due to the abnormal lane width at that location, which may cause the sensor to be triggered in an unintended manner. The graph shows that path disturbances occur, especially in the case of higher loads (starting at 20 kg), although some disturbance is also observed when the AGV operates without load.
The results on the track curves are illustrated in
Figure 10b,c. The vehicle’s behavior in both directions of the curve is similar across all load ranges. For heavier loads, starting at 50 kg, the error becomes more pronounced.
Finally,
Figure 10d highlights one of the curve sections where the straight segment transitions into an arc, representing a nonlinearity on the track. In this segment, the behavior of all controllers is similar, although controllers under heavier loads again show slightly greater deviations.
Figure 11 graphically presents the results of the path followed by the AGV during the simulations on the infinity-shaped lane, while
Figure 12 provides detailed views of specific segments of the route.
Figure 12a focuses on the central intersection, where a slight deviation from the path is observed under the 20 kg load condition, whereas the 50 kg load caused a more pronounced disturbance near the end of the route.
Figure 12b,c illustrate the AGV’s behavior along curved sections of the track, and the results closely resemble those presented in
Figure 10b,c. Similarly,
Figure 12d depicts the transition between a straight and a curved section of the track, also showing results consistent with those of
Figure 10d.
Although our virtual line sensor and kinematic model enabled efficient controller testing, they omit several real-world physical effects that can bias performance metrics. First, the sensor’s discrete detection array and perfect trigger behavior ignore sensor noise, ambient lighting variations, and imperfect alignment, all of which in practice introduce measurement jitter and delay. This likely underestimates the true mean error and variability observed in physical AGVs. Second, modeling the vehicle as a rigid differential-drive unit without wheel slip or suspension dynamics neglects traction loss, chassis flexibility, and drivetrain backlash; these factors can degrade controller stability and increase overshoot in curves, meaning our simulated trajectories may appear smoother than real-world behavior. Finally, absence of external disturbances—such as floor friction variability or dynamic obstacles—removes nonrepeatable perturbations that would challenge controller robustness.
We also indicate the need to study incorporation of realistic disturbances—such as sensor noise, wheel slip, and surface friction variability—into the virtual environment. Prototype AGV tests under identical loads and trajectories would then inform the magnitude of simulation-to-reality discrepancies, guiding adjustments to the Unity model.
6. Conclusions
This study aimed to demonstrate Unity 3D as a physics-based simulation platform for AGV control-system development, explicitly addressing dynamic modeling under varying payloads—a capability absent in 96.7% of reviewed AGV simulations works. Through a systematic comparison of two PID tuning methods across nine load conditions (0–100 kg), we quantified Unity’s effectiveness in replicating realistic vehicle dynamics and controller performance.
The proposal was implemented by creating a Unity-based simulation of an industrial setting, where the AGV follows predefined tracks. Within this virtual environment, PID controllers were tuned using two approaches: Exhaustive Search and the Ziegler–Nichols method. These approaches differ in parameter selection—Exhaustive Search systematically scans the entire parameter space for optimal values, while Ziegler–Nichols relies on sustained oscillation tests—enabling a direct comparison between an idealized, data-driven search and a classical, trial-based tuning process.
Quantitative results showed that Exhaustive Search achieved 58% lower standard deviation in lateral error (1.33 cm vs. 2.99 cm at 50 kg) and a 35% reduction in mean absolute error compared to Ziegler–Nichols tuning. However, this performance came at the expense of 60–80 h of computational time, whereas operator-driven Ziegler–Nichols tuning required only 20–40 min per load condition. Inter-operator variability in critical-gain identification reached 84% for integral gain () at 100 kg, underscoring the need for automated parameter-search methods in industrial deployment.
The contributions of this work include: (i) a Unity-based AGV simulation framework that specifically addresses the physics-modeling gap identified in current literature. Unlike the predominant use of kinematic-only models found in our systematic review, this framework leverages the NVIDIA PhysX engine to capture realistic load variations, wheel–ground interactions, and suspension effects typically simplified or omitted in conventional AGV simulations; (ii) a dual-perspective validation methodology bridging the gap between academic simulation and industrial application requirements. In response to our finding that most studies present only simulated results, we offer both a shop-floor support tool for in-situ controller tuning without removing vehicles from production lines and an exhaustive-search optimization platform for thorough parameter-space exploration—both critical for industrial AGV deployment where tuning represents a major bottleneck; and (iii) a flexible performance-evaluation environment within Unity that enables measurement of diverse indicators during simulation. While the present study reports general metrics (mean error, standard deviation, and maximum absolute error), the same data-generation pipeline supports calculation of advanced metrics—such as settling time, overshoot, RMSE, IAE, and ISE—across varying load conditions, facilitating comprehensive, quantitative comparisons of any controller design.
Despite these contributions, several limitations must be acknowledged. First, the virtual line sensor employs a discrete 100-element trigger array that does not replicate sensor noise, ambient interference, or calibration drift present in physical optical or magnetic sensors. Second, the dynamic model omits wheel slip, suspension compliance, and drivetrain backlash—factors that can degrade real-world controller. Third, validation was conducted exclusively in simulation; comprehensive validation against motion-capture data from the physical AGV prototype remains pending. These simplifications limit the direct transferability of tuned parameters to physical systems and highlight the need for hybrid simulation–physical tuning workflows.
Future work will extend beyond classical PID tuning by integrating modern heuristic algorithms—such as Genetic Algorithms and Particle Swarm Optimization—directly within the Unity framework. Leveraging Unity’s modular architecture, these metaheuristic methods can be compared side by side with traditional approaches under identical simulation conditions. Moreover, real-time adaptive tuning will be explored by coupling load-variation sensing with online optimization, enabling the AGV to adjust controller parameters on the fly as payloads change. This platform-centric strategy will facilitate a systematic evaluation of classical versus metaheuristic control techniques within a unified virtual environment.