
The proposed project consists of a mini controller designed for an 8-sensor line-following robot car. The controller reads the digital signals from the sensor array and computes a tracking error using a weighted method. This calculated error represents the position of the line relative to the center of the robot. Based on this value, the system generates a correction that adjusts the PWM signals driving the two DC motors, one on the right side and the other on the left side of the robot. By modifying the duty cycle of each motor independently, the controller corrects the trajectory and keeps the robot aligned with the line. Additionally, the design includes a 4-pin configuration input that allows the user to modify certain tuning parameters, enabling the robot to turn more aggressively or more smoothly depending on the selected setting. The tables for this settings are show above:
| uio_in[1:0] | Condition | Operation | Adjustment |
|---|---|---|---|
| 00 | sum_error > 0 | error = sum_error | 0 |
| 01 | sum_error > 0 | error = sum_error + 6 | +6 |
| 10 | sum_error > 0 | error = sum_error + 11 | +11 |
| 11 | sum_error > 0 | error = sum_error + 15 | +15 |
| uio_in[3:2] | Condition | Operation | Adjustment |
|---|---|---|---|
| 00 | sum_error < 0 | error = sum_error | 0 |
| 01 | sum_error < 0 | error = sum_error − 6 | −6 |
| 10 | sum_error < 0 | error = sum_error − 11 | −11 |
| 11 | sum_error < 0 | error = sum_error − 15 | −15 |
In order to test this design, you will need a little car with a 8CH IR TRACK MODULE, and to DC motors. Also you can prove the functionality with the test_bench file in the test folder.
8-Channel IR Line Tracking Sensor Array An infrared reflective sensor array is required to detect the position of the line relative to the robot. The array consists of eight IR emitter–receiver pairs placed in a row under the robot chassis. Each sensor measures the reflected infrared light from the floor surface, allowing the system to distinguish between the line and the background.
Analog Comparators for Sensor Thresholding Since the IR sensors produce analog voltage outputs, external analog comparators are required to convert these signals into digital logic levels. Each comparator compares the sensor voltage against a reference threshold and outputs a logic ‘1’ when the reflected signal exceeds the threshold, indicating detection of the line. A total of eight comparators are required, one per sensor channel.
Dual DC Motors The robot uses two DC motors, one on the left side and one on the right side. These motors provide differential drive, allowing the robot to steer by adjusting the speed of each wheel independently through PWM control signals generated by the chip.
H-Bridge Motor Driver An external dual H-bridge motor driver is required to interface the PWM outputs of the controller with the motors. The H-bridge allows proper power amplification and enables the motors to be driven safely with the required current. It also provides the necessary switching for motor control.
Configuration Switches (4 Pins) A set of four digital configuration inputs connected to switches or jumpers allows the user to modify the controller tuning parameters. These inputs adjust the magnitude of the correction applied to the computed tracking error, enabling the robot to turn more aggressively or more smoothly.
Power Supply A suitable DC power supply or battery pack is required to power the sensors, logic circuitry, and motors. The supply may include voltage regulation stages to provide stable logic levels for the controller and analog circuitry.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Sensor 1 | PWM Output Left Motor | ADJUST 1 |
| 1 | Sensor 2 | PWM Output Right Motor | ADJUST 2 |
| 2 | Sensor 3 | LED ON | ADJUST 3 |
| 3 | Sensor 4 | ADJUST 4 | |
| 4 | Sensor 5 | ||
| 5 | Sensor 6 | ||
| 6 | Sensor 7 | ||
| 7 | Sensor 8 |