<aside>

프로메테우스 인공지능 동아리 25-1 13팀 프로젝트 페이지입니다!

</aside>

<aside>

</aside>

1. Introduction


<aside>

1.1 Introduction


MazeSimul is an autonomous maze navigation project using TurtleBot3 and the Webots simulator.

The main objective is to enable the robot to follow the left wall in a maze environment and navigate without collisions.

Both rule-based and PID controllers were first implemented and tested in the Webots simulator. Based on the collected data, a machine learning model was trained and deployed to a real TurtleBot3 using ROS2.

MazeSimul

</aside>

<aside>

1.2 Members


스크린샷 2025-07-30 00.40.56.png

</aside>

<aside>

1.3 Tech Stack


스크린샷 2025-07-30 00.20.00.png

</aside>

2. Webots Simulation


<aside>

2.1 Robot Controllers


<aside>

2.1.1 Rule Based Controller


The rule-based control method determines the robot's actions based on predefined rules applied to sensor input values.

TurtleBot3 is equipped with a LiDAR sensor capable of measuring distance in all 360 degrees, allowing it to detect surrounding obstacles and walls.

The image below shows the orientation of the LiDAR sensor mounted on TurtleBot3.

image.png

In rule-based robot control, only three specific angle values from the LiDAR distance vector are used :

Measurement Front Corner Left
Corresponding angle 0 45 90

The core logic of the program is simple. It compares the distance values at three specific angles with predefined thresholds. This allows the robot to detect whether there is a wall in front, to the side, or at the corner.

Based on this, it chooses the appropriate action.

When a wall is detected in front of the robot, it prioritizes avoiding collision by performing a turning maneuver.

If there is no obstacle ahead, the robot checks for a wall on its left side and follows it accordingly.

If the robot is too close to the wall, it steers away. If it’s too far, it moves closer—maintaining a consistent distance.

This control logic is defined based on the truth table below.

Front (0°**)** Left (90°**)** Corner (45°**)** Action
True True True turn right
True True False turn right
True False True turn right
True False False turn right
False True True go straight
False True False go straight
False False True turn right
False False False turn left
</aside>

<aside>

2.1.2 PID Controller


PID control is a feedback loop–based method that adjusts the robot’s motion according to the error.

image.png

It responds to the error using a combination of three components: Proportional (P), Integral (I), and Derivative (D).

This allows for more precise and stable motion control.

The error is defined as the difference between the measured distance to the wall (via LiDAR) and the desired setpoint distance.

The continuous-time PID control equation is as follows:

$u(t) = K_P \cdot e(t) + K_I \cdot \int_0^t e(\tau) \, d\tau + K_D \cdot \frac{de(t)}{dt}$

However, in discrete systems such as robots, this equation must be discretized ****for implementation.

In this project, we implemented two types of discrete PID controllers.

Simple PID

A simple discrete PID control method was implemented, where each term is computed as follows:

$\text{correction} = K_P \cdot \text{error} + K_D \cdot \text{rateError} + K_I \cdot \text{cumError}$

To prevent continuous oscillations, the integral term was not used in this project ($K_I=0$), so the controller effectively functions as a PD controller.

The final set of parameters that yielded satisfactory performance was

$K_P=30, K_D=23, K_I=0$.

Discretized PID (Z-Transform 기반)

This method applies the Tustin transformation and inverse Z-transform to convert the continuous PID controller into a form suitable for discrete systems.

The resulting control logic is expressed with the following difference equation:

In this implementation, the integral term was excluded ($K_I=0$), and the controller was effectively used as a PD controller.

To achieve stable and responsive behavior, the parameters were set as

$K_P=50, K_D=25, K_I=0$

</aside>

</aside>

<aside>

</aside>

3. ROS2 & Turtlebot3


<aside>

</aside>

<aside>

</aside>

4. Snaps