Assembly Design Iteration
To design and build an interactive mechatronic system that balances a steel ball on a resistive touchscreen using two servo motors and a PID controller. The project followed a staged approach: mechanical assembly with 3D-printed parts, touchscreen input programming, PID-based motion control, and wireless communication for remote input. This work was completed for MAE 3185: Mechatronics at the University of Texas at Arlington.
Project Type: Team
Team Member: Dylan A Dean
Duration: Semester-long (4 progressive exercises)
Tools: SolidWorks, Raspberry Pi Pico (C++ SDK), UART, PWM, I²C
Focus Areas: CAD design, touchscreen interfacing, servo motor control, embedded systems, PID tuning, wireless communication
Outcome: Built a fully functional ball balancing system using real-time touchscreen input and remote laptop commands over UART.
Designed and modeled a 3D-printed mechanical system in SolidWorks, including base, rotating arms, and corkscrew-style platform
Programmed resistive touchscreen input via I²C; processed and calibrated raw coordinate readings for accurate ball tracking
Developed PWM control logic for dual servo motors using Raspberry Pi Pico and C++
Tuned and implemented a PID controller for real-time ball stabilization based on touchscreen feedback
Enabled wireless setpoint control via UART interface; parsed command strings from remote laptop input
Debugged system using hardware interrupts, serial feedback, and iterative hands-on testing
System Architecture: Steel ball balanced on resistive touchscreen mounted to a servo-actuated gimbal frame
Input Modes: Local touchscreen sensing and remote UART-based setpoint commands
Hardware Components: Raspberry Pi Pico microcontroller, two hobby servo motors, 4-wire resistive touchscreen
Control Method: PID-based angle control with real-time position feedback; angles translated to PWM duty cycles
Key Feature: Fully closed-loop electromechanical control with wireless override and real-time feedback
Base
Arm
Case Base & Lid
*SolidWorks 2022*
While no formal simulation was performed, real-time testing was used extensively to iteratively tune the PID controller. Initial gain estimates were derived from the physical dimensions of the touchscreen (151 mm × 91 mm), then refined through observation and trial-and-error tuning:
Proportional Gain (Kp): Scaled based on screen resolution using180° per full axis span (e.g., Kp = 180 / 91 for X).
Derivative Gain (Kd): Set to approximately 5–10% of Kp to dampen oscillations and prevent overshoot.
Integral Gain (Ki): Introduced after proportional–derivative tuning to correct steady-state error; clamped within ±90 to prevent windup.
The control logic operated using real-time position feedback from the resistive touchscreen via I²C:
Error Calculation: X and Y errors computed every 10 ms using an interrupt-driven global callback.
Control Signal: Torque outputs (τₓ, τᵧ) calculated using the PID formula: τ = Kp·e + Kd·(de/dt) + Ki·∫e·dt
Servo Control: PWM duty cycles updated based on torque values to reposition the touchscreen surface accordingly.
Final tuning and validation were done by manually observing ball movement in response to step inputs and setpoint changes; under both local (touch-based) and remote (UART-based) command inputs. The system demonstrated reliable performance and robustness against disturbances.
Base Drawing
Case Lid Drawing
Debugged inconsistent I²C touchscreen readings and reduced noise through read delay adjustments
Resolved PWM servo timing issues by calibrating duty cycle resolution for precise angle control
Tuned PID controller using trial-and-error under limited visual feedback and noisy measurements
Structured UART command parsing (3-byte format) to handle wireless input lag and improve setpoint reliability
Adjusted STL tolerances to accommodate printer imprecision during 3D part fabrication and assembly
Designed and built a complete electromechanical system with real-time sensor feedback and closed-loop control
Developed embedded C++ code for I²C touchscreen input, PWM-based servo actuation, and UART wireless communication
Collaborated with teammate to debug mechanical assembly and refine CAD models for improved stability
Validated robust system behavior under step changes, disturbances, and wireless control inputs
Implemented UART-based remote override capability, allowing dynamic setpoint updates from a laptop
SolidWorks CAD & 3D Printing · Embedded C++ (Raspberry Pi Pico SDK) · PWM-Based Servo Control · PID Tuning & Feedback Control · UART & I²C Communication · Touchscreen Sensing & Calibration · Hardware/Software Debugging · Electromechanical Prototyping
This project challenged me to bridge mechanical design with embedded software and control systems. I gained hands-on experience tuning PID controllers, developing embedded feedback loops, and debugging both hardware and software integration issues. Through iterative testing, we refined PID-based control using real-time sensor data, which deepened my understanding of system dynamics, actuator behavior, and embedded communication under practical constraints. These interdisciplinary skills are directly applicable to engineering challenges in robotics, automation, and smart systems.
*Note: Full control code (C++ SDK: BallMotor.cpp, ScreenRead.cpp, ServoRotate.cpp) available upon request*