Abstract
In robotics we have to be very precise because all mechanical components will be required to align perfectly to perform functions such as scoring rings on wall stakes as in VEX robotics competitions. In these competitions the wall stakes are tall vertical posts that are positioned along the field walls, where the robots must place the rings accurately to win points. In addition, this experiment is using code for rotation sensor calibration, documents PID control logic it applies and tunes the PID constants directly in the code to minimize error. The results show that PID reinforces a stabilized condition and damps down oscillations, which can help aid in improving robotic performance in real time scenarios. We conducted thirty trials and examined the data to demonstrate the experimental result. Results show a statistically significant reduction in mean absolute error (MAE=0.65°), root mean square error (RMSE=0.74°), and stabilization time (1.35 s) with PID. Our findings demonstrate that PID control, when properly tuned, enables rapid and precise alignment, supporting its adoption in high-stakes robotic tasks1,2.
Introduction
Competitions such as VEX High Stakes require a high level of accuracy in autonomous behavior and mechanisms. The wall stake mechanism is fundamental to accurate ring scoring. PID control in robotics is one of the most widely used algorithms and it is set to converge to zero error to give desired performance of the system1 In this study wall stake-positioning is done by PID control with a rotation sensor. However, despite the widespread use of PID in general robotics, there is limited documentation of PID tuning that specifically addresses VEX V5 mechanisms under game-specific conditions such as VEX High Stakes. Current resources tend to offer generic PID tuning advice but do not address problems such as overshooting, latency or instability unique to fast-paced, competitive scoring tasks using V5 rotation sensors. This study fills that gap by experimentally evaluating how PID tuning affects wall stake accuracy, stabilization time and reliability during repeated trials compared to open-loop control. By offering statistically validated results and a replicable testing protocol, this work aims to provide practical insights for robotics teams optimizing autonomous scoring routines.
Background and Context
PID control is utilized to calculate the motor outputs based on error values in a combined way (i.e., so called combined PID control), PID stands for the proportional, integral and derivative components. The PID algorithm implementations allow handling of competitive robots which can move smoothly and precisely1 PID controllers are used in a wide variety of applications, including robotics, because of their ease of use and ability to obtain stable control with high precision1,2. Many recent developments of PID control focus on auto-tuning methods, adaptive control strategies, as well as the integration of machine learning methods with the goal of enhancing its performance and robustness in complex robotic systems3,4,5,6. These gains offer opportunities to address restrictions of the conventional PID control and better cope with the precision and flexibility requirements of robotic systems7.
Problem Statement
The problem comes from keeping the robot’s mechanism aligned with wall stakes in any situation. If not tightly controlled, the mechanism may overshoot or overwork to reach a stable position, which would influence the accuracy and efficiency of the scoring8 This is particularly critical in competitions like VEX Robotics, where rapid and repeated scoring demands sub-degree positioning accuracy to avoid penalties or missed scores. Recent studies and community based documentation often emphasize PID as a default solution, but lack comparative testing against non-PID or open-loop baselines in game specific scenarios. This study addresses that gap by comparing PID-controlled positioning to open-loop control, using metrics such as Mean Absolute Error(MAE), Root Mean Square Error(RMSE) and stabilization time. An improved level of accuracy in this context is defined as maintaining error within +/-1° of the target position across repeated trials, while stabilizing in under 1.5 seconds-benchmarks derived from both competitive performance expectations and sensor resolution limitations.
Significance and Purpose
In the experiment we will evaluate the impact of implementing a PID controller on the rotation sensors performance on function of the wall stake mechanism of the robot. We will tune the PID values to allow our robot to be more stable on positioning the wall stake and reach precision9.
Objectives
- Improving the accuracy of the wall stake mechanism by calibration of the rotator sensor.
- The precision of the robot’s wall-stake mechanism is enhanced by PID controllers.
- Gather the information from the test and examine the pattern of improvement.
Research Method
Design
Rotation sensor has been used and will be calibrated, PID controls will be used and tuning done for optimal performance of the wall stake mechanism of the robot10 The wall stake mechanism consists of a hinged vertical arm driven by a VEX motor, designed to press scoring rings onto field stakes placed along the walls. The arm’s motion is rotational and must settle at precise angles with minimal overshoot or delay. We will then compare the performance of the system with and without PID. We will have a control group that will function without PID. PID tuning was performed using the Ziegler-Nichols heuristic method. The proportional gain was increased until sustained oscillations were observed. Then the PID constants were derived based on that critical gain and period. Manual fine-tuning followed to eliminate overshoot and improve settling time. Integral windup was mitigated by implementing a cap on the accumulated integral term, preventing oversaturation during prolonged error. The final PID formula used was u(t)=kP* e(t) + kl* ∫e(t)dt + kD * de(t)/dt.
Experimental Setup
The wall stake mechanism consists of a VEX motor-driven arm equipped with a high resolution rotation sensor(+/-0.1°accuracy). Experiments were conducted on a standardized VEX field with controlled lighting and power supply (12V regulated)9. The target angle was set at 50° with a PID-controlled group and open-loop group. The robot remained stationary during all tests and only the wall stake mechanism was activated for angular positioning. A stopwatch was started at motion initiation and stopped when the sensor reading remained within +/-0.5° of the target for 2 consecutive seconds. A consistent operator workflow and field layout ensured repeatability and minimized human error.
Variables
| Variable Type | Name | Description |
| Independent | Control Algorithm | PID vs open loop(no feedback) |
| Dependent | Final Error, Time | Alignment error(degrees), stabilization time |
| Controlled | Voltage, Field | 12V supply, Field environment, Target angle |
These variables were selected to isolate the role of PID control. The target angle(50°) was held constant to ensure consistent test conditions. Environmental and voltage variables were actively monitored and regulated.
Procedure
Sensor Calibration: We Calibrate and reset the rotation sensor to start fresh. We rotate the mechanism by known angles, so it can then calculate the correction factors for more accuracy.
PID Implementation: PID control code using the following tuned constants:
Const double kP = 1.5;
Const double kI = 0.01;
Const double kD = 0.18;
The controller output is given by:
u(t) = kP * e(t) + kl * ∫e(t)dt + kD * de(t)/dt
Where:
- u(t): motor command
- e(t): error(setpoint-measured angle)
- kP, kl, kD: proportional, integral and derivative gains
PID constants were manually tuned using step-response testing, following the Ziegler-Nichols heuristic11,8. Integral windup was mitigated by capping the integral term12. All PID logic was implemented in VEX code using a real-time control loop with a 20 ms sampling interval.
Testing Protocol
- 30 trials per control method(PID and Open-loop)
- Target angle 50°
- Data collected: time to stabilize(within +/-0.5°), final error, number of oscillations.
- Sensor recalibrated every 10 trials; no significant drift observed
- Voltage monitored and held at 12 V throughout
To maintain a consistent 12 V supply throughout we started each session with a fully charged battery and checked the voltage using the robots built in voltage monitoring features. Between the trial we recharged the battery as needed to ensure that voltage stayed at 12 V thereby minimizing any drop that could affect the performance so the results are kept reliable. During each trial angular position data and timestamps were logged to a CSV file using the brains data port and later analyzed in Python for statistical consistency. All testing was performed on the same field tile layout to minimize environmental variance.
Measurements and Data Collection:
We recorded the stabilization time, final error and number of oscillations for each of the 30 trials for both PID and open-loop control.
Results
| Trial | Target Position (°) | Final Position (°)(With PID) | Stabilization Time(s)(With PID) | Target Position (°)(With PID) | Final Position (°)(No PID) | Stabilization Time(s)(No PID) | Oscillations(No PID) |
| 1 | 50 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| 1 |
| 26 | 50 | 50 | 1.3 | 0 | 50.3 | 2.5 | 3 |
| 27 | 50 | 49.6 | 1.4 | 1 | 47.1 | 1.9 | 3 |
| 28 | 50 | 50.2 | 1.2 | 0 | 50.9 | 2.1 | 2 |
| 29 | 50 | 49.4 | 1.3 | 1 | 48.5 | 2.3 | 2 |
| 30 | 50 | 50.4 | 1.4 | 0 | 49.3 | 2.5 | 1 |
Data Analysis
- The following statistical measures will be calculated: Mean Absolute Error MAE: Reflects the average magnitude of errors.
- Root Mean Square Error RMSE: Provides a quadratic measure of the average magnitude of error.
- Standard Deviation: Measures the dispersion of data points.
- Confidence Intervals (e.g., 95% CI: Provides a range within which the true population means is likely to fall.
- Perform t-tests or ANOVA to compare results with and without PID control to demonstrate statistical significance.
All statistical analyses were conducted using the full set of 30 trials per group (PID and open-loop), totalling 60 trials. Calculations were based on raw position readings recorded from the rotation sensor for each trial. MAE was computed as the mean of the absolute differences between the target angle (50°) and the final measured angle across each trial. RMSE was calculated as the square root of the average of the squared differences between the same two values. These metrics were computed separately for both PID and open-loop groups to enable direct comparison. The open-loop group served as the baseline condition to isolate the effect of PID control. Oscillations were defined as any reversal in direction of movement that exceeded +/-0.5° from the target angle after initial convergence. These were recorded as binary values per trial: 1 if one or more oscillations occurred, 0 if the mechanism settled without reversal, All overshoots exceeding the defined threshold were counted equally regardless of magnitude. The VEX rotation sensor used has a resolution of +/-0.1° which justifies the precision level reported in final error metrics and stabilization time detection.
| Metric | ValueWith PID | ValueNo PID |
| Mean Final Position (°) | 49.81° | 49.52° |
| Mean Absolute Error (MAE)(°) | 0.65° | 1.83° |
| Root Mean Square Error (RMSE)(°) | 0.74° | 2.26° |
| Standard Deviation of Final Position (°) | 0.67° | 2.25° |
| Average Stabilization Time(s) | 1.35 | 2.17 |
The data shows that using PID constants lowered the stabilization time and lowered the oscillations.
- PID control reduced MAE to 0.65°, RMSE to 0.74° and average stabilization time to 1.35 s.
- Open-loop control exhibited higher error(MAE =1.83°, RMSE = 2.26° and longer stabilization(2.17 s)
- T-test based on absolute position error confirmed that the PID significantly outperformed open-loop (t(33) = -5.35. p<0.001).
- Step-response plots(Figure 1) show reduced overshoot and oscillation with PID.
- Bar graphs(Figure 2) compare stabilization time across trials; error bars indicate standard deviation13,14.
Data Visualization
Segments representing the number of oscillations in each trial.

X-axis: Target Position 50°, Y-axis: MAE with error bars representing standard deviation
Discussion
The results from this experiment confirmed that the wall stake mechanism was consistently positioned at the desired level to enable optimal performance due to PID control calibration. The low MAE 0.65° and RMSE 0.74° indicate high precision, while the average stabilization time of 1.35 seconds shows a quick response. The t-Test revealed a statistically significant improvement in the final position of the PID controlled system compared to the non-PID control group (t (33) = -5.35, p < 0.001. This conclusion was based on 30 repeated trials per group (PID and non-PID) and MAE/RMSE were calculated from the deviation between final measured position and the fixed 50° target angle for each period. The open-loop system served as the baseline condition allowing the improvements from PID control to be isolated and quantified. Oscillations were defined as post-settle reversals greater that +/-0,5° and their presence or absence was logged as binary outcomes. The rotation sensor used has a resolution of +/-0.1° which supports fine grained accuracy measurement and validates the subdegree error reporting. These measures validate the effectiveness of PID control for robotic applications, aligning with the claim that PID is instrumental in enhancing the accuracy and reliability of robotic tasks13. Effective PID tuning is critical for enhancing robot performance14, and it is worth noting that adaptive control methods will maximize robot capabilities8. The results were positive and are indicative of a functional and effective robotic task. One limitation is that testing was only done on one target position. Further studies would incorporate various target positions and explore additional control methods beyond PID and open-loop for comprehensive performance benchmarking.
Recommendations
PID calibration can be used by robotics teams to improve the accuracy and precision of the robot. Robotics teams can use the described PID calibration protocol to: Improve autonomous alignment and scoring accuracy in competitions. Reduce wear on mechanical components by minimizing oscillatory movements. Adapt to environmental changes by periodically recalibrating sensors and re-tuning PID gains. Incorporate Adaptive Control Strategies. Explore adaptive control methods to manage nonlinear dynamics and complex scenarios8,5,6.
Limitations
While this study included a non-PID control group for comparison, performance may also be affected by the environment over time. There is a need for robust methods for PID tuning that do not rely on trial-and-error but use more systematic approaches15). Consider environmental factors in future testing protocols. To improve on this test, implement environmental sensors9.
Closing Thought
Robotics tasks precision can be significantly improved by using PID control so the device can be more consistent and perform optimally16,17.
References
- K.J Ã…ström, R. M. Murray, Feedback systems: An introduction for scientists and engineers. Princeton University Press (2008). [↩] [↩] [↩] [↩]
- K.H. Ang, G. C. Y. Chong, PID control system analysis, design, and technology. IEEE Transactions on Control Systems Technology, 13(4), 559–576 (2005). [↩] [↩]
- Y. Li, D. Wang, Q. Wang, Y, C, Soh, A survey on PID auto-tuning methods. Journal of Process Control, 52, 33–45 ,(2017). [↩]
- D.E. Rivera, M. Morari & S. Skogestad, Internal model control: PID controller design. Industrial & Engineering Chemistry Process Design and Development, 25(1), 252–265. (1986). [↩]
- J. Smith, A. Lee, M. Patel, Adaptive PID control in educational robotics. Robotics Education Journal, 15(2), 45–59 (2022). [↩] [↩]
- S. Lee, R. Kumar, Machine learning for PID parameter optimization. IEEE Robot Lett. *, 112-119 (2023). [↩] [↩]
- S. Skogestad, I. Postlewaite, Multivariable feedback control: Analysis and design. Wiley (2005. [↩]
- A. Visioli, Practical PID control. John Wiley & Sons (2006). [↩] [↩] [↩] [↩]
- VEX Robotics Documentation. Using the rotation sensor with V5.https://kb.vex.com/hc/en-us/articles/360035595872-Using-the-Rotation-Sensor-with-V5 (2019). [↩] [↩] [↩]
- VEX Robotics,UsingtherotationsensorwithV5,https://kb.vex.com/hc/en-us/articles/360035595872-Using-the-Rotation-Sensor-with-V5 (2019). [↩]
- Y. Li, D. Wang, Q. Wang, Y. C. Soh, A survey on PID auto-tuning methods. J Process Control. 52, 33–45 (2017). [↩]
- F. L. Lewis, Applied optimal control and estimation: Digital design and implementation. Prentice Hall (2003). [↩]
- M. Tavakoli, A. Vivas, K. Y. Pettersen, A tutorial on modeling, identification, and control of robot manipulators. IEEE Control Systems Magazine, 38(6), 18–47 (2018). [↩] [↩]
- J. Wagner, B. D. O. Anderson, Robust PID control. Springer (2003). [↩] [↩]
- Tan, Lee, & Shim, Adaptive PID control. Springer (2013 [↩]
- Lewis, Applied optimal control and estimation: Digital design and implementation. Prentice Hall (2003 [↩]
- Skogestad & Postlethwaite, Multivariable feedback control: Analysis and design. Wiley (2005). [↩]








