Design and Implementation of a Digital Twin for a Line-Follower Robot

GIRISHC21 11 views 22 slides May 18, 2025
Slide 1
Slide 1 of 22
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

A digital twin in Unity 3D powers this project, mirroring a three-wheeled line-follower robot to refine navigation on a 2-meter closed-loop track with a narrow path. The 15 cm x 10 cm chassis, designed in Tinkercad, features two DC gear motors, a front caster, and three IR sensors, including a cente...


Slide Content

Design and Implementation of a Digital Twin for a Line-Follower Robot Student : Girish Chandrappa Scientific Advisor: Senior Researcher, PhD. Armands Šenfelds 2025

Thesis Topicality Digital twin reduces prototyping costs via virtual analysis pre-deployment. Synchronizes virtual-physical worlds for integrated model testing. Enables user interaction with static models via the unified controller. Offers adaptability for seamless sensor upgrades and advancements. Line-follower exemplifies an integrated synchronization setup for testing any model.

Develop a Unity 3D digital twin for a three-wheeled line-follower robot, ensuring precise physical-virtual model synchronization with parameter optimization for robust navigation. Tasks : Engineer a physical robot using ESP32, IR sensors, and DC motors for line tracking. Design a Unity 3D digital twin that accurately replicates the dynamics of a physical robot. Achieve model synchronization via MATLAB for a unified control architecture. Implement PID-based control logic for consistent motor and sensor performance. Quantify parameters (e.g., path deviation, stability, speed) for performance evaluation. Perform iterative testing for navigation reliability under diverse conditions (e.g., sharp turns, inclines). Aim of Thesis

Physical Environment ESP32, IR Sensors, DC Motors, Speed Sensor, Battery Sensor Data to Controller Control Signals from Controller via WiFi Digital Twin Environment Virtual Robot Model, Virtual IR Sensors, Virtual Motors Simulated Sensor Data to Controller Control Signals from the Controller Controller PID-Based Control Logic, Two-Way Communication (UDP/TCP) Control Signals to Physical and Digital Environments Sensor Data from Both Environments Web Dashboard HTTP via ESP32 Real-Time Data Logs, Comparative Graphs Data from Physical and Digital Environments

Schematic Overview

Circuit Simulation of the Physical Model Simulated circuit using a schematic tool to test component integration. Modeled ESP32, L298N motor driver, and DC motors for control validation. Included three IR sensors to simulate line detection accuracy. Tested 6V-1.3Ah battery power distribution to all components.

ESP32 and L298N ESP32 chosen for dual-core processing and built-in WiFi connectivity. Enables real-time communication with MATLAB for control signals. Supports Arduino IDE programming for sensor and motor management. L298N selected for reliable DC motor control with high current capacity. Drives two DC gear motors for precise wheel movement. Ensures efficient power distribution from the 6V-1.3Ah battery.

Three-way IR sensor (TCRT5000, 5V) detects the line with the center at the centroid. Speed sensor (HC-020K, 5V) chosen over encoder for cost savings. DC geared motors (3V-6V) drive wheels with reliable torque output. Ensures smooth navigation with speed sensor feedback. Combination selected for affordable and effective design.

Modeled a 15 cm x 10 cm chassis in Tinkercad to test component placements. Assembled two DC gear motors at the rear and a front caster wheel. Connected ESP32 microcontroller and L298N motor driver for control. Integrated a Qoltec 53041 battery and uploaded Arduino IDE scripts to ESP32. Designing the Physical Model

Creating a Digital Twin using Unity 3D Unity 3D chosen for real-time 3D rendering and physics simulation. Modeled a 15 cm x 10 cm chassis matching physical dimensions. Added two virtual DC motors and a front caster wheel. Implemented three virtual IR sensors using raycasts for line detection. Ensured 1:1 scale and physics alignment with the physical robot.

PID Control Architecture for Integrated Robot System

Sensor input acquisition PID-based input processing Control signal synthesis Real-time system synchronization Independent and simultaneous model execution Unified control logic architecture

PHYSICAL MODEL (ESP32) DIGITAL TWIN MODEL (UNITY 3D) UNIFIED MATLAB CONTROLLER

Physical Model Operations Operation : ESP32 processes IR sensor data (binary 0 or 1) to detect the black path and adjust motor speeds via the L298N driver. Navigation : Follows a 2-meter closed-loop track, using the centered IR sensor for precise path alignment. Communication with MATLAB : Establishes a WiFi -based TCP connection for two-way data exchange. Control Flow : Receives motor control signals from MATLAB and sends real-time sensor feedback for navigation adjustments. Data Exchange: Requests real-time logs from the Unity 3D digital twin over WiFi for performance comparison.

Digital Twin Operations Operation : C# scripts simulate IR sensors via raycasts to track a 2-meter closed-loop path. Navigation : Mimics physical navigation, adjusting motor speeds based on virtual sensor data. Communication with MATLAB : Establishes a WiFi -based UDP connection for two-way data exchange. Control Flow : Receives navigation commands from MATLAB and sends simulated sensor feedback. Data Exchange: Shares real-time logs with the physical model over WiFi for performance comparison.

System Testing Average Path Accuracy Comparison Average Centered Path Accuracy Comparison

Average Error Rate Comparison Comparative Metrics Table

Key Achievements and Findings Our physical robot reached 96.7% accuracy, and the digital twin hit 99.7% accuracy after 10 runs. The physical robot had a 3.3% error rate, while the digital twin had only 0.3% error, showing a 3% difference. Despite average error rates of 3-5% from components, our system performed much better with 96.7% and 99.7% accuracy. Small errors from components like sensors and communication slightly lowered the main accuracy numbers. The small 3% difference between systems is okay because it comes from real-world things like lighting and temperature. Both systems handled straight paths and sharp turns well in all tests. During simulations, I discovered the digital twin consistently outperformed the physical robot by 2-3% in accuracy results.

Built an integrated real-time synchronization system for easy parameter analysis, testing, and real-time data comparison. Designed and tested MATLAB WiFi communication strength using UDP and TCP protocols. Developed a flexible integrated model, allowing design changes in physical, virtual, and controller blocks while keeping the main schematic intact. Completed the professor's goal, enabling future students to use this model for laboratory work. Created a highly adaptable system, supporting the addition of multiple physical and virtual components in the future. Future enhancements include adding MPU6050, battery simulation in Unity 3D, and a new communication line to reduce the negligible error rate. Conclusion

Answers to the reviewer’s questions

Thank you for your attention Questions?