Color Distinguish Robot Project Report
Color Distinguish Robot Project Report
Name Student’s ID
Hồ Lê Khánh Dy 2052431
Figure 2.1. Differential drive of 2 front wheels and rear caster wheels...............................27
Figure 2.2. The errors of weighted average and quadratic interpolation method................28
Figure 2.3. System block diagram........................................................................................30
Figure 3.1. Force analysis on wheel.....................................................................................31
Figure 3.2. Robot dimensions and force analysis.................................................................34
Figure 3.3. Robot dynamics analysis...................................................................................35
Figure 3.3.4. Robot 3D model..............................................................................................40
Figure 4.1. System block diagram........................................................................................41
Figure 4.2. TCRT5000 dimensions......................................................................................41
Figure 5.4. The errors 𝐞𝟐 and 𝐞𝟑 with the robot’s motion in “Red package” scenario....62
Figure 5.3. The complete route in 2 senarios.......................................................................61
Figure 5.5. The errors 𝐞𝟐 and 𝐞𝟑 with the robot’s motion in “Blue package” scenario...62
Figure 5.6. The reponses of right and left motor corresponding to PWM...........................63
Figure 5.7. The step response of motors according to 50% duty cycle................................63
Figure 5.8. Step responses of right and left motors..............................................................64
Figure 5.9. Comparision between 100% duty cycle step responses of motors and the
transfer function found..............................................................................................................65
Figure 5.10. Step responses of right and left motors with PI controller in MATLAB........65
Figure 5.11. Step responses of right and left motors with PID controller through
experiments...............................................................................................................................66
Figure 5.12. Step responses of right and left motors with PID controller through
experiments in 10 seconds........................................................................................................67
Figure 6.1. The flowcharts of a. Master, b. Line following procedure, c. Controller, d. Load
handling process, e. Intersection process..................................................................................68
Figure 6.2. The flowcharts of slave (left) and the PI controller (right)................................69
Figure 7.1. Sensor PCB in reality.........................................................................................70
Figure 7.2. System PCB in reality........................................................................................71
Figure 7.3. Robot at the loading point..................................................................................71
Figure 7.4. Robot goes to the destination.............................................................................71
LIST OF TABLES
Table 1.1. MK ROBOT UGV specification.........................................................................11
Table 1.2. MP-500 Specification..........................................................................................11
Table 1.3. Pioneer 3 - AT specification...............................................................................12
Table 1.4. Battery comparison.............................................................................................13
Table 1.5. Motors comparison..............................................................................................14
Table 1.6. Color sensors comparison...................................................................................17
Table 1.7. Control structure comparison..............................................................................23
Table 1.8. Comparision of PID controller and On/Off controller........................................23
Table 3.1. Wheel’s specification..........................................................................................31
Table 3.2. Specifications of DC motor.................................................................................33
Table 3.3. Robot dimensions................................................................................................36
Table 4.1. TCRT5000 specification.....................................................................................41
Table 4.2. The maximum and minimum values of sensors..................................................47
Table 4.3. Errors of the sensors............................................................................................48
Table 4.5. Motors driver comparison...................................................................................51
Table 4.6. 18650 battery specification.................................................................................51
Table 4.7. Controlling power source calculation.................................................................52
Table 4.8. Dynamic power source calculation.....................................................................52
Table 5.1. Characteristics of the motors’ step responses.....................................................64
Table 5.2. Characteristics of the motors’ step responses with PI controller in MATLAB. .65
Table 5.3. Characteristics of the motors’ step responses with PID controller through
experiments...............................................................................................................................66
Ho Chi Minh University of Technology Mechatronics system design project
Line tracking error (from the left or right edge of the line) : 𝑒𝑚𝑎𝑥 = ±3 𝑚𝑚
-
Line width: 26 𝑚𝑚
- Background color: white
-
- Type of surface: planar
Technical requirements:
- The robot is equipped with a sensor system to help the robot recognize the line on
the floor/ground surface and follow that line. Select the appropriate sensor type by
yourself.
- The robot from the “Start” position moves to the “Loading area” (marked by a path
cut line, the cross-section is 50 mm long and 26 mm wide) and stops to wait for
the load to be placed manually. The robot is capable of recognizing that the load
has been uploaded.
- At the “Loading Area”, a block of red or blue color will be placed manually on top
of the robot. The mass of the good is 2 kg. The robot is capable of recognizing that
the load has been uploaded.
- After receiving the goods, the robot must move to the "End" position corresponding
to the color of the package.
Note:
- The shape and dimensions of the load are chosen by the student.
- The color identification solution for the load is chosen by the student.
Shape of the line path:
8
Ho Chi Minh University of Technology Mechatronics system design project
From the design requirements and the provided specifications, we can set some
conclusions:
- The load is determined to be 2 kg. Therefore, when taking an overview, we only
consider mobile robot with a low payload capacity. Due to the small payload, we should
consider 3 or 4 wheels mobile robot to simplify the structure and increase possibility for the
later manufacturing process.
- About the material of the load, our group decide to choose a lump of iron because it
is small, common and low cost. Then we use color labels to cover it.
9
Ho Chi Minh University of Technology Mechatronics system design project
CHAPTER 1. OVERVIEW
1. Introduction
1.1. Definition line following robot
Line following robots (LFR) are robots designed to follow a path. This line or path
may be as simple as a physical white line on the floor or as complex path marking
schemes, embedded lines, magnetic markers, and laser guide markers. The robot can avoid
obstacles, make sharp turns, climb bridges, detect a specific object, and carry and deposit
the object in the right position. LFR can be applied in many different fields:
- Provide parts arrangement in warehouse and production areas.
- Transfer goods between production stations.
- Distributing and supplying products, especially in trading.
- Supply and arrangement in special fields such as hospitals, supermarkets, offices
room.
1.2. Steering control types of LFR
Differential drive: This is the most common mechanism in LFR steering control
designs. In this concept, there are two independent wheel drives. Each wheel is driven at
different speeds to turn in any direction or at the same speed, allowing the robot to go
forward or backward. This steering method is the simplest because it does not require an
additional steering motor.
Steered wheel control: Common in the tricycle drive concept. The tricycle robot is
designed with a front steering wheel controlled by a motor. The two rear wheels are
attached to a common axle driven by a single motor to move forward and backward.
However, some LFRs have both steer and drive controlled by the front wheel, and the rear
wheels are used as supporting wheels to maintain stability.
Dual steering wheel type: This is a combination of differential drive and steering
wheel control. Two independent steer/drive motors are placed on diagonal corners of the
LFR and swiveling castors are placed on the other corners. The steering drive of the dual
steering wheel type can perform the 360-degree turning function and can perform the
universal lateral movement function, with high flexibility and accurate operation
flexibility..
2. Mechanical specification
2.1. MK ROBOT UGV
1
Ho Chi Minh University of Technology Mechatronics system design project
Mechanical specifications
LxWxH 970 × 740 × 350 𝑚𝑚
Average speed 1.5 𝑚/𝑠
Maximum load 80 𝑘𝑔
Mechanical analyze:
Advantage:
- Better stability and maneuverability on road.
- Less slippage and less power consumption.
Disadvantage:
- Complexity in design.
- No zero radius turn ( cannot rotate around it vertical axis ).
2.2. MP-500
Mechanical specifications
LxWxH 823 × 592 × 358 𝑚𝑚
Average speed 1.5 𝑚/𝑠
Maximum load 80 𝑘𝑔
Mechanical analyze:
Advantage:
- Low cost and simplicity.
- Ensure to be coplanar.
- Convenient to tune the speed of each motor.
- Robot can turn with small radius.
- 2 front driving wheels are more stable when compared to 2 rear driving wheels.
Disadvantage:
1
Ho Chi Minh University of Technology Mechatronics system design project
Mechanical specifications
LxWxH 508 × 497 × 277 𝑚𝑚
Average speed 0.7 𝑚/𝑠
Maximum load 12 𝑘𝑔
Mechanical analyze:
Advantage:
- Well weight distribution ( on a rectangle ).
- Good for rough terrain so that ensure the distance between sensors and road
surface..
- Great traction.
Disadvantage:
- It uses skidding or slipping technique, increases wheel wear, reducing life.
- Difficult to synchronize 4 motors when going straight or turning.
- The control algorithm is complicated.
- Difficult to be coplanar.
3. Electronic specification
There are 4 main components that make the vehicle operates:
- Power: Sources that supply power to different components of the mobile robot.
- Controller: Different kinds of controllers to make control signal for other
components.
- Actuator: Devices that convert control signals and energy into mechanical
energy (physical movement).
1
Ho Chi Minh University of Technology Mechatronics system design project
3.2. Microcontroller
A microcontroller is needed to process information from the sensors, control the
motors and operate the vehicle. Microcontroller families such as ESP32, PIC16, STM32,
and ATMega,… are commonly used due to their compact, easy for programming and
providing the essential functionality required for sensors and motors control.
The microcontroller should meets the following requirements:
- Have enough I/O pins for reading digital and analog values
- Have module PWM to control the motor
- Have interrupt port to read the signal from the encoders, sensors,…
- Have Communication interfaces (I2C, UART, SPI, RS232,…)
- Fast processing speed
- Power consumption
- Compact and low cost
1
Ho Chi Minh University of Technology Mechatronics system design project
3.3. Actuator
An actuator is needed to carry out commands from the microcontroller. There are
three types of actuators, namely, pneumatic, hydraulic and electric. However, pertaining to
this project, only electric actuator (motors) is considered.
DC motors are widely used in high-quality electric drive systems, with DC motor
power ranges from a few W to several MW. This is a versatile, flexible motor that can
meet the requirement of speed, torque, acceleration, and braking with heavy loads. DC
motors are often used mainly to meet the requirement of speed. The DC motor with an
Encoder attached is used to precisely control the speed, using the Pulse Width Modulation
- PWM method. Therefore, DC motors are commonly used in LFR.
A stepper motor is a type of DC motor that works in discrete steps. It is a
synchronous brushless motor where a full rotation is divided into a number of steps. The
two main components of a stepper motor are the rotor and the stator. The rotor is the
rotating shaft and the stator consists of electromagnets that form the stationary part of the
motor. When a discrete DC voltage is applied, the stepper motor rotates in a particular
angle called the step angle; thus a stepper motor is manufactured with steps per revolution.
It can be operated with or without a feedback control. The motor moves by performing
steps, by simply counting the steps, the position of the motor can be located at a given
time.
Servo motor can be any type of motor above combined with controller and feedback
system. Servo motor is designed to provide precise control of position, speed, and
acceleration in various applications. These motors are a type of rotary or linear actuator
and are commonly used in automation, robotics, and other systems where accurate and
controlled movement is essential.
Table 1.5. Motors comparison
3.4. Sensors
Line following methods: Two commonly used methods for LFRs are the method of
using CMU camera and sensors.
CMU Camera: In the case of using a camera, the image obtained from the actual line
will be sent back, processed and used image processing algorithms to determine the exact
1
Ho Chi Minh University of Technology Mechatronics system design project
position and deviation angle of the vehicle relative to the line. CMU camera is a type of
camera with an integrated microprocessor to process the camera’s signal image return and
output the signal to the main microcontroller. The input of microcontroller is the error
between the camera position and the considered point on the line:
Where:
𝑒1: The distance from the camera to the center of the line is perpendicular to the
drive wheel axis. In the tracking controller, the error 𝑒1 is considered to be
-
approximately 0 because the point being considered on the line is always on the
𝑒2: The distance from the camera to the center of the line is parallel to the drive
same line as the camera location.
-
𝑒3: Deviation angle between the vehicle's axis and the tangent of the line at the
wheel axis.
-
considered point.
Sensors: The most common sensors for a LFR have been LDR (Light Dependent
Resistor) and IR (infrared) LED (light emitting diode).
LDR is a light dependent resistor which works by incident light on it. Its resistance
varies according to change in the intensity of light. As the light falls on the LDR then it
shows very high resistance ideally infinite and when there is not any light beam incident on
it then it shows very less resistance ideally zero. That means if a voltage apply in the one
terminal of the LDR then it gives zero voltage at another end if there is any light falls and
vice versa.
1
Ho Chi Minh University of Technology Mechatronics system design project
Advantage:
- Low cost and simple to use.
- Have a wide range of resistance values and sensitivity levels.
- They do not require any external power source.
- They are compatible with many circuits and devices.
Disadvantage:
- Easily affected by the change in temperature
- Low accuracy.
- Slow response time.
- Narrow spectral response that depends on the material used and may not match the
desired wavelength range.
Infrared (IR) Sensors: Comprise of IR-transmitter (Tx) and receiver (Rx). This special
purpose LED transmits infrared rays of wave length 760 nm. White surfaces generally
reflect well, but black surfaces reflect poorly.
Advantage:
- Fast response time.
- Low power consumption.
- High accuracy.
- Easy to identify lines with high contrast.
1
Ho Chi Minh University of Technology Mechatronics system design project
Disadvantage:
- Limited range.
- Can be affected by environmental conditions such as dust, sunlight,
- Accuracy depends on surface material.
Color detection methods: To detect the color of the products, we have 2 posibilities
methods:
Color sensor: A color sensor is a type of sensor that has the feature of distinguishing
different types of colors such as green, blue or red, etc... This sensor uses a light source for
color analysis, which means it emits light through the LED light source and then absorbs
this light. Light will reflect after hitting any object or specific object. On the principle of
reflected light, the controller uses a sensor to analyze the color of a particular object or
object.
Camera: capture images from the object and image processing to give color results.
Table 1.6. Color sensors comparison
1
Ho Chi Minh University of Technology Mechatronics system design project
The tracking-line error depends on the ability to distinguish the state of the sensors
and the distance between sensors.
Advantage:
- This algorithm is simple.
- This algorithm has high speed processing.
Disadvantage:
- Only works for pre-determined line map.
- The spacing of sensors affect the algorithm.
4.2. Approximation algorithm:
The analog signal is read from the sensor through approximation to find out the
relative position of the vehicle relative to the center of the line.
Advantage:
- Have lower error than the comparative algorithm.
Disadvantage:
- Sensors must have similar output characteristics.
- This algorithm takes more time to process.
In the approximation algorithm, there are 2 main methods:
Quadratic interpolation:
1
Ho Chi Minh University of Technology Mechatronics system design project
The coordinate value with the highest output of the estimated curve is considered the true
position of the line using the formulas:
𝑏 𝑦1 + 𝑦3 − 2𝑦2
𝑥 =− 𝑤ℎ𝑒𝑟𝑒 𝑎 = ; 𝑏 = 𝑦2 − 𝑦1 −
2𝑎𝑥1 − 𝑎 2𝑎 2
(1.1.1)
Weighted average:
∑ 6
0 𝑥𝑖𝑦𝑖 3(𝑦6 − 𝑦0) + 2(𝑦5 − 𝑦1) + (𝑦4 −
𝑦2)
(1.1.2)
𝑥 =− 6 = 𝑖=
∑𝑖=0𝑦𝑖 ∑𝑖=0
6
𝑦𝑖
1
Ho Chi Minh University of Technology Mechatronics system design project
To detect a line, it is necessary to use at least two sensors. However, using two
sensors is not enough for the robot to distinguish between straight lines and curves.
Currently, there are 4 common types of sensor configuration:
Two-sensor configuration:
Line
This method is simple, cost-effective and low computational overhead. However, this
method has limited precision when detect junction or the need to switch between multiple
tracks.
Four-sensor configuration:
Line
This method has better accuracy and adaptability when compared to a two-sensor
setup. This method is suitable for the route including straight lines and simple junctions.
However, this method would be very poor at sensing a greater than 90 degree turn.
Matrix-sensor configuration:
Line
This method has high precision when compared to other methods. However, high
cost, high computational load and complexity are the biggest drawbacks of this method.
V- shape configuration:
2
Ho Chi Minh University of Technology Mechatronics system design project
Line
This method would be very good at getting an advanced look at intersections and 90
degree turns because the sensors at outer edges of the V, would give an advanced warning.
This method is suitable for path has complicated turns of an advanced track.
Distance between sensors
For the distance between sensors, it is necessary to pay attention to the distance
between the two sensors at the edge.
If the distance is too far, it will lead to inaccurate detection of when the robot
turning. On the contrary, if the distance between the two sensors is too close, it will affect
the robot's ability to detect lines, causing signal noise.
Direction of
motion
𝜃𝐶
𝑤
Formulation to calculate exactly the distance between sensors:
2
Ho Chi Minh University of Technology Mechatronics system design project
Sensor
Sensor
Slaver 1
2
Ho Chi Minh University of Technology Mechatronics system design project
Number of MCUs 1 ≥2
Although the PID controller is effective, the robot speed can be up to 1.3 𝑚/𝑠 [12],
to achieve the desired behavior, it required manual trials and errors method, which is time
consuming.
Fuzzy controller:
The structure of the fuzzy controller:
2
Ho Chi Minh University of Technology Mechatronics system design project
Tracking controller:
2
Ho Chi Minh University of Technology Mechatronics system design project
Figure 1.15. Define the line detection error for system modeling
(1.4) in the sense of Lyapunov’s stability, and all tracking errors 𝑒1, 𝑒2, 𝑒3 will be
In [9], with the error dynamics (1.3), the system is stable with the tracking controller
𝑒1̇ 𝑣𝑅𝑐𝑜𝑠𝑒3 −1 𝑒2
[𝑒2̇ ] = [𝑣𝑅𝑠𝑖𝑛𝑒3 ] + [ 0 𝑣
−𝑑 − 𝑒1] [ ]
𝜔
(1.1.3)
𝑒3̇ 𝜔𝑅 0 −1
𝑣 = 𝑣𝑅𝑐𝑜𝑠𝑒3 + 𝑘1𝑒1
{𝜔 = 𝑘2𝑣𝑅𝑒2 + 𝜔𝑅 + 𝑘3𝑠𝑖𝑛𝑒3 (1.1.4)
6. Design specifications
To calculate the maximum speed, we will calculate based on the sampling time,
which depends on the sensor response time. Moreover, IR LED is the most optimized
sensor for
2
Ho Chi Minh University of Technology Mechatronics system design project
robot begins to move from straight line (2000 𝑚𝑚) to a curve (𝑅 = 500 𝑚𝑚).
For the line path of this project, the maximum error of robot position is when the
C B A
D
500
500
O
𝐷𝐶 𝐷𝐶 𝐷𝐶 𝐷𝐶
= = =
𝐴𝐶 √𝑂𝐶2 − 𝐴𝑂2 √(𝑂𝐷 + 𝐷𝐶)2 − 𝐴𝑂2 √(500 +
𝐷𝐶)2 − 5002
Line tracking error (from the left or right edge of the line) : 𝑒𝑚𝑎𝑥 = ±3 (𝑚𝑚)
-
2
Ho Chi Minh University of Technology Mechatronics system design project
Figure 2.1. Differential drive of 2 front wheels and rear caster wheels
2
Ho Chi Minh University of Technology Mechatronics system design project
Figure 2.2. The errors of weighted average and quadratic interpolation method
2
Ho Chi Minh University of Technology Mechatronics system design project
After analyzing, we can see that the color of product is only blue or red, robot do not
need to detect many colors at the same time, so the color sensor can meet the requirement.
Moreover, due to the compact, low cost and high speed response, it is suitable for our
project. In conclusion, our group decide to use color sensors to detect the color of the
products.
3. Control propose solutions
3.1. Control structure
Therefore, for this project, the hierarchical controller was chosen because of its fast
response speed, ease of control, and concurrent programming.
3.2. Controller
The PID controller is chosen to control the motor speed as the speed control of the
motor is a SISO system, and for its ease of use, effectiveness and suitable for the project.
of the controller will be converged to zero as 𝑡 → ∞, the system’s stability will be check
The tracking controller is chosen for the overall MIMO control system as the errors
by Lyapunov’s standard. To reduce the complexity, the car's speed is fixed at 𝑣𝑚𝑎𝑥 and the
angular velocity (𝜔𝐺) will be controlled when the car turns a corner.
4. Summary:
4.1. Principle diagram of mechanical solution:
2
Ho Chi Minh University of Technology Mechatronics system design project
Data
Power Supply
Sensor
PWM PWM
Low - Voltage Power Source
Driver Driver
Power Source
3
Ho Chi Minh University of Technology Mechatronics system design project
2𝜋𝑟𝑛
As:
𝑣=
60
(3.1)
𝐿𝑡𝑟𝑎𝑣𝑒𝑙 = 𝑣𝑡
Distance traveled:
2𝜋𝑟
𝑛
(3.2)
⇒ 𝐿𝑡𝑟𝑎𝑣𝑒𝑙 = 𝑡
60
Where:
Traveled distance: 𝐿𝑡𝑟𝑎𝑣𝑒𝑙
(𝑚𝑚) Wheel’s radius: 𝑟
(𝑚𝑚) Revolute per minutue: 𝑛
(𝑟𝑝𝑚) Travel time: 𝑡 (𝑠)
distance in the time 𝑡. We conclude that the larger the wheel, the more distance the robot
From the equation above we see that the wheel’s radius is proportional to travel
travels. We also want to ensure that the robot's ground clearance is high enough for the line
following sensors so that we select the wheel.
Table 3.1. Wheel’s specification
Technical Specification
2. Motor selection
𝑟 𝑇
𝑣
𝑃
𝑁 𝐹 𝑚𝑠𝑙
1
Inertia momentum of the wheel:
𝐼= (3.3)
𝑚𝑟 2
3
Ho Chi Minh University of Technology Mechatronics system design project
3
Ho Chi Minh University of Technology Mechatronics system design project
Where:
1
𝐹𝑚𝑠𝑙 = 𝜇𝑙( 𝑀
+ 𝑚)𝑔2
(3.5)
1
In order for the wheel to roll without slipping, the moment T must satisfy the condition:
𝑇 ≤ 𝐼𝛾 + 𝜇 ( 𝑀 +
𝑚) 𝑔𝑟 2
(3.6)
Where:
𝐼: Inertia momentum (𝑘𝑔𝑚2).
𝑇: Torque (𝑁𝑚)
𝑟: Wheel’s radius
𝐹𝑚𝑠𝑙: Rolling friction force
𝛾: Angular acceleration (𝑟𝑎𝑑/𝑠2)
𝑎: Acceleration (𝑚/𝑠2)
𝑀: robot’s mass (𝑘𝑔)
𝑚: Wheel’s mass
(𝑘𝑔) Known quantities:
Estimated wheel’s mass: 0.1 (𝑘𝑔)
Estimated robot’s mass (including packages): 5
(𝑘𝑔) Wheel’s radius: 75 (𝑚𝑚)
Sliding Rolling frictional coefficient: 𝜇 = 0.5
Rolling frictional coefficient: 𝜇𝑙 = 0.1 [1]
Speed required: 0.5 (𝑚/𝑠)
Acceleration required: 1 (𝑚/𝑠2)
Speed ratio of transmission system: 𝑢 = 2
Efficiency of spur gear system: 𝜂𝑔𝑒𝑎𝑟 = 0.95
𝑎
Angular acceleration:
𝛾 = = 26.7 (𝑟𝑎𝑑/𝑠2)
𝑟
(3.7)
Angular speed:
3
Ho Chi Minh University of Technology Mechatronics system design project
𝑣
𝜔 = = 13.3 (𝑟𝑎𝑑/𝑠)
𝑟
(3.8)
Limited momen:
𝑇 = 0.78 (𝑁𝑚) (3.10)
Wheel circumference:
𝐶 = 2𝜋𝑟 = 0.235 (𝑚) (3.11)
𝑣
Rotation on the working shaft:
𝑛 = × 60 = 130 (𝑟𝑝𝑚)
𝑐
(3.12)
𝑃
Power on the motor shaft:
For the safety coefficient is 2 [2] [3], the required power for a motor is: 𝑃𝑚𝑜𝑡𝑜𝑟 =
1.68 × 1.8 = 3 (𝑊)
From that, we select the encoder motor DC servo motor GM25-370 DC Geared Motor
with specifications:
Table 3.2. Specifications of DC motor
3
Ho Chi Minh University of Technology Mechatronics system design project
𝐶 𝐹 𝑙𝑡
𝑀𝑔
h b
With:
ℎ: Height from vehicle center of mass to ground
𝑏: Width between two wheels of robot
-
𝐶: Center of mass
-
-
To avoid flipping, the moment generated by gravity around the center of rotation must
𝑏 𝑚𝑣2 𝑏 𝑔𝑏𝑅 ℎ 𝑔𝑅
be greater than the moment of centrifugal force:
𝐹𝑙𝑡ℎ − 𝑃 ≤ 0 ⇒ ℎ − 𝑚𝑔 ≤ 0⇒ℎ ≤ ⇒
≤ 2 𝑅 2 2𝑣2 𝑏
(3.16)
2𝑣2
Because of the size of the load, we select the width of the base is 180 (𝑚𝑚). We
arrange the wheels outside of the base so that:
𝑏 = 160 (𝑚): Width between two wheels of the robot
𝑅 = 0.5 (𝑚): The curvature radius of the track
⇒ ℎ ≤ 0.15 (𝑚)
3.2. Conditions for the vehicle not to slide when cornering
In order for the car not to slide when cornering, the centripetal force, in this case, the
𝑀𝑣2
total frictional force acting on the vehicle is greater than the centrifugal force:
3
Ho Chi Minh University of Technology Mechatronics system design project
𝐿1 𝐿2
𝑎
𝑀𝑔
C
𝑟
ℎ
𝑁 𝑁 1
2
𝐹𝑚𝑠 2 𝐹𝑚𝑠 1
Where:
𝑁1: Reaction force at the drive wheel
𝑁2: Reaction force at the driven wheel
𝐹𝑚𝑠1: Rolling friction on drive wheel
𝐹𝑚𝑠2: Rolling friction on driven wheel
𝐿 = 𝐿1 + 𝐿2: Distance between front and rear wheel axles
ℎ: Height from vehicle center of mass to ground
𝑟: Wheel’s radius
𝑀: robot’s mass
𝑔 = 9.8 (𝑚/𝑠2): Gravitational acceleration
𝑎: Acceleration
Force balance equation
∑ 𝐹𝑥 = 0
{ ∑ 𝐹𝑦 = 0
∑ 𝑀𝑧/𝑐 = 0
2𝐹𝑚𝑠1 + 𝐹𝑚𝑠2 =
(3.18)
𝑀𝑎
⇒{ 2𝑁1 + 𝑁2 = 𝑀𝑔
𝑁2𝐿1 − 𝐹𝑚𝑠2ℎ − 2𝐹𝑚𝑠1ℎ − 2𝑁1𝐿2 = 0
3
Ho Chi Minh University of Technology Mechatronics system design project
2𝐹𝑚𝑠1 + 𝐹𝑚𝑠2 = 𝑀𝑎
𝑀𝑔𝐿1 − 𝑀𝑎ℎ
𝑁1 =
𝑀𝑔𝐿2 + 2𝐿𝑀𝑎ℎ
(3.19)
{𝑁2 = 𝐿
𝑀𝑔𝐿1 − 𝑀𝑎ℎ
Conditions for the wheels to always stick to the road surface
{ 𝑁 = >0
𝑀𝑔𝐿 2𝐿 + 𝑀𝑎ℎ
1
𝑁 = >0
2
𝐿
2
𝑎
(3.20)
⇒ 𝐿1 > ℎ
𝑔
Where:
ℎ = 150 (𝑚𝑚)
𝑎 = 0.4 (𝑚/𝑠2)
𝑔 = 9.8 (𝑚/𝑠2)
⇒ 𝐿1 > 2.8 (𝑚𝑚)
We choose 𝐿1 = 160, 𝐿2 = 𝐿 − 𝐿1 = 20 (𝑚𝑚)
From the calculations we preliminarily select parameters:
Table 3.3. Robot dimensions
4. Mounting tolerances between hole and motor shaft of the motor fixtures
commercial so its positioning axis is considered standard. With a nominal diameter ∅7. We
The motor needs to be not only fixed but also variable. The motor is a product
ℎ6
For hole: We choose the basic deviation as H; The accuracy level is 7
For the shaft: We choose the basic deviation as h; The accuracy level is 6
Calculated shaflt tolerance: with 𝑒𝑖 = 0 due to table 4.3 page 27 of “Dung sai và lắp
ghép”.
3
Ho Chi Minh University of Technology Mechatronics system design project
𝑒𝑠 = 0 𝜇𝑚
{𝑒𝑖 = 𝑒𝑠 − 𝑇 = 0 − 9 = −9 𝜇𝑚 (3.21)
𝐸𝐼 = 0 𝜇𝑚
{𝐸𝑆 = 𝐸𝐼 + 𝑇 = 0 + 15 = 15 𝜇𝑚 (3.22)
∅8. We choose ∅8 due to page 50 book “Dung sai và lắp ghép”. [4]
The gear shaft needs to be not only fixed but also variable. With a nominal diameter
𝐻7
ℎ6
For hole: We choose the basic deviation as H; The accuracy level is 7
For the shaft: We choose the basic deviation as h; The accuracy level is 6
Calculated shaflt tolerance: with 𝑒𝑖 = 0 due to table 4.3 page 27 of “Dung sai và lắp
ghép”
𝑒𝑠 = 0 𝜇𝑚
{𝑒𝑖 = 𝑒𝑠 − 𝑇 = 0 − 9 = −9 𝜇𝑚 (3.23)
𝐸𝐼 = 13 𝜇𝑚
{𝐸𝑆 = 𝐸𝐼 + 𝑇 = 13 + 22 = 35 𝜇𝑚 (3.24)
5. Gear calculation
5.1. Key specification data of helical gear transmission
Unit Value
3
Ho Chi Minh University of Technology Mechatronics system design project
Power, 𝑃1 𝑘𝑊 0.0033
Torque, 𝑇 𝑁.
𝑚𝑚
290
Module, 𝑚 0.5
Driving Driven
gear gear
𝑆𝐻
𝐻
(3.25)
3
𝑇1𝐾𝐻𝛽
𝑎𝑤 = 𝐾𝑎(𝑢 + 1) √
(3.26)
]2𝑢𝜓 [𝜎
𝐻 𝑏𝑎
Based on Table 6.5; Table 6.6 and Table 6.7 “Tính toán thiết kế hệ dẫn động cơ khí”,
we select:
𝐾𝑎 = 49.5 (𝑀𝑃𝑎1/3); 𝜓𝑏𝑎 = 0.3; 𝐾𝐻𝛽 = 1.07 ⇒ 𝑎𝑤 ≈ 19.8(𝑚𝑚)
3
Ho Chi Minh University of Technology Mechatronics system design project
⇒ 𝑍1 ≈ 1
Select 𝑍1 = 30
Number of teeth of driven gear:
𝑍2 = 𝑢𝑍1 = 50 (3.28)
Pitch diameter:
Drive gear:
𝑑1 = 𝑚𝑍1 = 15 (3.30)
Driven gear:
𝑑2 = 𝑚𝑍2 = 25 (3.31)
Addendum diameter:
Drive gear:
Driven gear:
Dedendum diameter
Drive gear:
Driven gear:
Value
Specification
Driving spur gear Drived spur gear
4
Ho Chi Minh University of Technology Mechatronics system design project
Center distance 𝑎, 𝑚𝑚 20
Number of teeth 30 50
Pitch diameter 𝑑, 𝑚𝑚 15 25
𝑑𝑎, 𝑚𝑚
Addendum diameter 16 26
4
Ho Chi Minh University of Technology Mechatronics system design project
PWM PWM
Low - Voltage Power Source
Driver Driver
Power Source
Parameters Value
0.2 − 15
𝑚𝑚
Distance range
4
Ho Chi Minh University of Technology Mechatronics system design project
IC−max 100 mA
IF−max 60 mA
4
Ho Chi Minh University of Technology Mechatronics system design project
We choose 𝑅2 = 4700(𝛺).
2.3. Sensor placement
4
Ho Chi Minh University of Technology Mechatronics system design project
As the figure above, Position 1 causes 𝑋𝑑 shorter than Position 2. When move from
white to black surface, detection of sensor depends on 𝑋𝑑, smaller 𝑋𝑑 makes sensor has
better resolution. Therefore, we choose to place sensor perpendicular to the line like
position 1.
2.4. Calculating distance from sensor to the line
In the height range from 9 ÷ 12 (𝑚𝑚), we see that at the height of 12 𝑚𝑚, the
4
Ho Chi Minh University of Technology Mechatronics system design project
According to the datasheet, the length of each sensor is 𝐿 = 10.2 (𝑚𝑚) > 𝑙 =
8.5 (𝑚𝑚), so we choose the minimum distance between the two sensors as 𝑑𝑚𝑖𝑛 = 𝐿 =
10.2 (𝑚𝑚). Required line for robot to track in this project has the width 26 (𝑚𝑚), there
are two situations:
Two sensors have recognized area in line
4
Ho Chi Minh University of Technology Mechatronics system design project
→ 𝑑 ≈ 15 (𝑚𝑚).
equation
4
Ho Chi Minh University of Technology Mechatronics system design project
From the following data we take the max and min value for the calibration.
Table 4.2. The maximum and minimum values of sensors
𝑥𝑖𝑚𝑎𝑥 𝑥𝑖𝑚𝑖𝑛
Value
Sensor
1 883 53
2 859 42
3 877 44
4 837 42
5 894 56
𝑦 = 47 +
Applying the calibration formula, we have the equations for each sensor:
823
(𝑥
Sensor 1: − 53)
1 830 1
𝑦 = 47 + − 42)
(𝑥
823
Sensor 2:
2 817 2
= 47 + − 44)
823
𝑦 (𝑥
Sensor 3:
3 833
− 42)
3
𝑦 = 47 +
823
(𝑥
Sensor 4:
4 795 4
𝑦 = 47 + − 56)
(𝑥
823
Sensor 5:
5 838 5
their analog values, where 𝐿𝑐𝑏 is likely a constant factor (15 in this case). The result, 𝑋,
This formula represents the weighted average of the sensor coordinates based on
4
Ho Chi Minh University of Technology Mechatronics system design project
obtained:
4
Ho Chi Minh University of Technology Mechatronics system design project
-8 -6.79 1.21
-6 -4.93 1.07
-4 -3.83 0.17
-2 -1.46 0.54
0 -0.48 0.48
2 1.61 0.39
4 4.21 0.21
6 6.23 0.23
8 7.44 0.56
10 7.99 2.01
12 9.20 2.8
5
Ho Chi Minh University of Technology Mechatronics system design project
14 12.25 1.75
16 15.41 0.59
18 17.55 0.45
20 18.78 1.22
22 20.52 1.48
24 23.33 0.67
26 24.12 1.88
28 26.73 1.27
30 28.04 1.96
the values found with the slope and intercept, from which we get the approximate linear
equation:
𝑦 = 1.077𝑥 − 0.199
With:
𝑦: The approxiamte distance
𝑥: Calculated weighted average distance
-
-
5
Ho Chi Minh University of Technology Mechatronics system design project
3.1. Requirement
There are two most common driver using for robotics and mechatronics small and
medium projects, especially for education and competitions: L298N and TB6612FNG.
We take some important specifications of these two drivers from datasheet.
5
Ho Chi Minh University of Technology Mechatronics system design project
4.5 – 7𝑉 −0.2𝑉 –
6𝑉
Logic supply voltage
−25°𝐶 – −20°𝐶 –
130°𝐶 85°𝐶
Operating temperature
PWM Channel 2 2
𝐶𝐶/𝐶𝐶𝑊/𝑆ℎ𝑜𝑟𝑡
𝐶𝐶/𝐶𝐶𝑊/ 𝑏𝑟𝑎𝑘𝑒
𝑆𝑡𝑜𝑝 /𝑆𝑡𝑜𝑝
Mode
/𝐿𝑜𝑤 – 𝑐𝑢𝑟𝑟𝑒𝑛𝑡
𝑠𝑡𝑎𝑛𝑑𝑏𝑦
30,000𝑉𝑁𝐷 115,000𝑉
𝑁𝐷
Price
After analysis and comparing, team intend to choose Li – Ion types. Although it is
heavy and risk more than Li – Po, its high power and charge are huge advantages and with
the holder we can fix on the robot surely instead of Li – Po. Moreover, Li – Ion is likely to
much cheaper than Li – Po one and easy to re – charge. Our group decide to use 18650 Li –
Ion Rechargeable Battery to supply electrical source for this project.
Table 4.5. 18650 battery specification
Parameter Value
Dimension 18 × 65𝑚𝑚
5
Ho Chi Minh University of Technology Mechatronics system design project
2500𝑚𝐴ℎ ×
5𝐶
Capacity
Max current
Device Quantity Supply voltage Power
consumption
PIC16F877A 4 250𝑚𝐴 5𝑉 5𝑊
Total 2.735𝑊
Using safety coefficient 𝑘 = 1.3, the minimum energy for control source is:
67
𝑄𝑚𝑖𝑛 = 1.3 × 𝑊 × 𝑡𝑚𝑎𝑥 = 1.3 × 2.735 × ≈ 66.17
(4.6)
(𝑚𝑊ℎ) 3600
2 750𝑚 12 18𝑊
consumption voltage
𝐴 𝑉
DC – GA25
1 2.2𝑚 5𝑉 0.89𝑊
𝐴
TB6612FNG
Using safety coefficient 𝑘 = 1.3, the minimum energy for control source is:
67
(12𝑉): 𝑄𝑚𝑖𝑛 = 1.3 × 𝑊 × 𝑡𝑚𝑖𝑛 = 1.3 × 18 × = 436
(𝑚𝑊ℎ) 3600 (4.8)
5
Ho Chi Minh University of Technology Mechatronics system design project
67
(5𝑉): 𝑄𝑚𝑖𝑛 = 1.3 × 𝑊 × 𝑡𝑚𝑖𝑛 = 1.3 × 0.89 × ≈ 21.5
(𝑚𝑊ℎ) 3600
5
Ho Chi Minh University of Technology Mechatronics system design project
𝑄𝑚𝑖𝑛 436
Therefore, the minimum capacity of battery is:
5
Ho Chi Minh University of Technology Mechatronics system design project
5
Ho Chi Minh University of Technology Mechatronics system design project
5
Ho Chi Minh University of Technology Mechatronics system design project
𝑒2: is the error from the reference point E to line following point M in the vertical
direction.
-
𝑒3 𝜃𝐸
θ
E
𝑒2
𝑒1
YM YA 𝑣
AM
O XA XM X
𝑣 = ω𝑑 × 𝑅 (5.1)
Kinematics equation at A:
6
Ho Chi Minh University of Technology Mechatronics system design project
𝑋̇𝐴 = 𝑣𝑐𝑜𝑠θ
𝑌𝐴̇ = 𝑣𝑠𝑖𝑛θ
(5.2)
𝑋𝑀 = 𝑋𝐴 + 𝑑𝑐𝑜𝑠θ
𝑌𝑀 = 𝑌𝐴 + 𝑑𝑠𝑖𝑛θ
(5.3)
𝑒 𝑥 = 𝑋𝐸 − 𝑋𝑀
𝑒𝑦 = 𝑌𝐸 − 𝑌𝑀 (5.6)
𝑒 𝜃 = 𝜃𝐸 − 𝜃
𝑒̇𝜃 = 𝜃̇𝐸 − 𝜃̇
6
Ho Chi Minh University of Technology Mechatronics system design project
𝑐𝑜𝑠θ
𝑒̇𝜃 = 𝜃̇𝐸 − 𝜃̇
𝑒1 = 𝑒𝑥𝑐𝑜𝑠𝜃 + 𝑒𝑦𝑠𝑖𝑛𝜃
𝑒2 = −𝑒𝑥𝑠𝑖𝑛𝜃 + 𝑒𝑦𝑐𝑜𝑠𝜃
𝑒3 = 𝑒𝜃
𝑒𝑦𝜃̇𝑠𝑖𝑛𝜃
𝑒̇3 = 𝑒𝜃̇
[𝑌𝐸̇ − 𝑣𝑠𝑖𝑛θ
− 𝜃̇ × 𝑑1 × 𝑐𝑜𝑠θ]𝑐𝑜𝑠𝜃 − 𝑒𝑦𝜃̇𝑠𝑖𝑛𝜃
𝑒̇3 = 𝑒𝜃̇
As θ̇ = 𝜔 , we have:
6
Ho Chi Minh University of Technology Mechatronics system design project
− 𝑒𝑥𝜔𝑐𝑜𝑠𝜃
+ [𝑌𝐸̇ − 𝑣𝑠𝑖𝑛θ − 𝜔 × 𝑑1 × 𝑐𝑜𝑠θ]𝑐𝑜𝑠𝜃
− 𝑒𝑦𝜔𝑠𝑖𝑛𝜃
𝑒̇3 = 𝑒𝜃̇
6
Ho Chi Minh University of Technology Mechatronics system design project
Recall 𝑒3 = 𝜃𝐸 − 𝜃, therefore:
cos 𝑒3 = cos(𝜃𝐸 − 𝜃) = 𝑐𝑜𝑠𝜃𝐸𝑐𝑜𝑠𝜃 + 𝑠𝑖𝑛𝜃𝐸𝑠𝑖𝑛𝜃
{ 𝑠𝑖𝑛𝑒3 = sin(𝜃𝐸 − 𝜃) = 𝑠𝑖𝑛𝜃𝐸𝑐𝑜𝑠𝜃 − 𝑐𝑜𝑠𝜃𝐸𝑠𝑖𝑛𝜃
The above equations then become:
𝑒1
In conclusions:
𝑐𝑜𝑠𝜃𝐶 𝑠𝑖𝑛𝜃𝐶 𝑒 𝑐𝑜𝑠𝜃𝐶 𝑠𝑖𝑛𝜃𝐶 𝑋𝐸 − 𝑋𝐶
0 0
[𝑒2] = [−𝑠𝑖𝑛𝜃𝐶 𝑐𝑜𝑠𝜃𝐶 0] [𝑒𝑦] = [−𝑠𝑖𝑛𝜃𝐶 𝑐𝑜𝑠𝜃𝐶 0] [ 𝑌𝐸
𝑥
− 𝑌𝐶 ]
𝑒3 0 0 𝑒 0 0 𝜃 − 𝜃𝐶
1 𝜃 1 𝐸
6
Ho Chi Minh University of Technology Mechatronics system design project
𝑒̇1 𝑣𝐸𝑐𝑜𝑠 −1 𝑒2
𝑒 𝑣
[𝑒̇2] = [𝑣𝐸𝑠𝑖𝑛𝑒3 ] + [ 0 −(𝑑1 + 𝑒1)] [ ]
3
{ 𝜔
𝜔𝐸 0 −1
𝑒3
2. Controller design
The kinematic feedback controller will be based on (5.14). Here we will design the
𝒗
𝒖 = [ ]. Then we prove the stability through a chosen Lyapunov function.
controller based on Lyapunov direct method. First we propose the controller for the input
�
�
6
Ho Chi Minh University of Technology Mechatronics system design project
𝑣 = 𝑣𝐸𝑐𝑜𝑠𝑒3 + 𝑘1𝑒1
{𝜔 = 𝑘2𝑣𝑒𝑒2 + 𝜔𝐸 + 𝑘3𝑠𝑖𝑛𝑒3 (5.15)
Proving the stability of the controller, choose the considered positive Lyapunov
function:
1 1 − 𝑐𝑜𝑠𝑒3
𝑉 = (𝑒2 + 𝑒 2 ) +
2 1 𝑘2
2
(5.16)
𝑠𝑖𝑛𝑒3
The derivative of the function:
𝑉̇ = 𝑒 (𝑣 𝑐𝑜𝑠𝑒 − 𝑣) + (𝑘 𝑣 𝑒 + 𝜔 −
𝜔)
(5.17)
𝑘2
1 𝐸 3 2 𝐸 2 𝐸
Hence, the controller (3.15) leads to achieve the time derivative 𝑉 is negative as
long as 𝑘1, 𝑘2, 𝑘3 > 0. That means the system (3.14) is stable with the controller (3.15)
in the sense of Lyapunov’s stability, and all tracking errors will be converged to zero as 𝑡
→ ∞. And, when starting with 𝑣0 ≈ 𝑣𝐸 , the error 𝑒1 can be set to be zero (or small
enough to be ignored).
Preliminarily choose 𝑘1 = 10 ; 𝑘2 = 100 ; 𝑘3 = 10
After the robot’s required speed 𝑣𝐸 , the robot’s required angular speed 𝜔𝐸 are
founded, with 𝐿 is the distance between two wheels, the speed of the left and right motors,
𝑣𝐿 and 𝑣𝑅, respectively can be found by:
2𝑣𝐸 − 𝜔𝐸𝐿
𝑣𝐿 =
(5.19)
2
2𝑣𝐸 + 𝜔𝐸𝐿
𝑣𝑅 =
(5.20)
2
In order for the vehicle to follow the line, the first job is to determine the vehicle's
position relative to the line. We set the coordinate system as shown in [Figure 5.2 a], in
From there we have the error 𝑒1 which is eliminated so we do not need to consider it.
which A is the midpoint between the two wheels, M is the midpoint of the sensor array.
Besides, the only type of error we can measure in the reality using line sensor is 𝑒2, while
𝑒3 can only approximated by equation [5.21].
𝑒2
− 𝑒′
(5.21)
𝑒 = arctan (2
)3
𝑑𝑆
6
Ho Chi Minh University of Technology Mechatronics system design project
have both 𝑒2 and 𝑒2′ , but with only one array, we can find the 𝑒′ by
2 storing the 𝑒2 of the
In equation [5.17], the line tracking error suppose to be a 2-array sensor so that we
previous reading as 𝑒′ .
2
3. Controller simulation
In this tracking controller, when starting with 𝑣0 ≈ 𝑣𝑅 , the error 𝑒1 can be set to be
zero (or small enough to be ignored) resulting of the simulation is shown below.
𝑘1 = 3; 𝑘2 = 205; 𝑘3 = 3 , the robot’s motion with the tracking errors 𝑒2 and 𝑒3 are
After simulated the reference route in 2 scenarios (package “Red” or “Blue”), with
6
Ho Chi Minh University of Technology Mechatronics system design project
Figure 5.4. The errors 𝐞𝟐 and 𝐞𝟑 with the robot’s motion in “Red package” scenario
Figure 5.5. The errors 𝐞𝟐 and 𝐞𝟑 with the robot’s motion in “Blue package” scenario
As we are tracking the center of the line and the line is 26𝑚𝑚 width with tolerance of
±3𝑚𝑚 . For that reason, the allowable 𝑒2 is in the range of −16𝑚𝑚 to 16𝑚𝑚 . The
simulation shows that the controller surfer the requirement and a physical prototype will be
made. Moreover, further tuning will be applied to achieve the best performance.
4. Motor controller
The chosen motor is the JGA25-370 DC geared motor with encoder, with main shaft
rotation speed is 8500 rpm and output shaft is 250 rpm. Then, the maximum rotation speed
of the motor is 141.67 rev/s.
Since there are 11 ticks per cycle on the encoder, the motor’s maximum frequency is:
𝑓𝑚 = 141.67 ÷ 11 ≈ 13 (𝐻𝑧)
Applying Nyquist theorem for data sampling:
𝑓𝑠 ≥ 2𝑓𝑚
→ 𝑓𝑠 ≥ 26 𝐻𝑧
Choose sampling rate 𝑓𝑠 = 65(𝐻𝑧) → 𝛿𝑡 ≈ 0.015 (𝑠)
6
Ho Chi Minh University of Technology Mechatronics system design project
Then:
𝑁 × 𝛿𝑡 = 𝑚 × 𝑇𝑚
→ 𝑁 × 0.015 = 𝑚 × 0.077 (𝑚: 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑖𝑛𝑡𝑒𝑔𝑒𝑟)
We choose 𝑁 = 77; 𝑚 = 15.
To further observe the linearity and the dead band between the input (%𝑃𝑊𝑀)
and the output revolution of the motor’s shaft (𝑟𝑝𝑚), the 𝑃𝑊𝑀 signal is fed into the
motor, start with 0 and increment 1 every 0.5s. After that, we read the 𝑟𝑝𝑚 signal from
the encoder.
Figure 5.6. The reponses of right and left motor corresponding to PWM
according to the PWM and the range between 𝟎 − 𝟓% is the motor deadband.
From [Figure 5.5], it can be seen that the speed of the motor is a linear function
To find the motor transfer function, the output signal is the revolution of the output
Figure 5.7. The step response of motors according to 50% duty cycle
6
Ho Chi Minh University of Technology Mechatronics system design project
Applying the above data to MATLAB System Identification Toolbox (SIT), we obtain
the following transfer function of the motor:
24.48
𝐺𝑟𝑖𝑔ℎ𝑡(𝑠) =
𝑠 + 25.56
(5.21)
23.68
𝐺𝑙𝑒𝑓𝑡(𝑠) =
𝑠 + 24.72
(5.22)
Overshoot 0% 0%
7
Ho Chi Minh University of Technology Mechatronics system design project
Figure 5.9. Comparision between 100% duty cycle step responses of motors
and the transfer function found
PID controller
Due to experiments, it’s proved that the Derivative term of PID controller causing
the motor to jiggling, therefore, we only used PI controller. Using MATLAB’s PID tuner
app and SIMULINK, the PI parameters of the transfer functions are found:
Figure 5.10. Step responses of right and left motors with PI controller in MATLAB
7
Ho Chi Minh University of Technology Mechatronics system design project
𝐾𝑃 0.106 0.112
𝐾𝐼 4.06 5.2
Overshoot 0% 0%
Peak 1 1
After doing some experiments, we found the PID parameters through trials and
errors with the results in [Table 5.3].
Figure 5.11. Step responses of right and left motors with PID controller through
experiments
Table 5.3. Characteristics of the motors’ step responses with PID controller
through experiments
𝐾 1.05 1.05
𝑃
𝐾 0.03 0.03
𝐼
up to ±14.4% , these are due to the speed calculation makes that the speed is
In [Figure 5.10], the step responses show that there are times when the error can be
7
Ho Chi Minh University of Technology Mechatronics system design project
Figure 5.12. Step responses of right and left motors with PID controller through
experiments in 10 seconds
7
Ho Chi Minh University of Technology Mechatronics system design project
b. c. d.
a. e.
7
Ho Chi Minh University of Technology Mechatronics system design project
Figure 6.2. The flowcharts of slave (left) and the PI controller (right)
7
Ho Chi Minh University of Technology Mechatronics system design project
7
Ho Chi Minh University of Technology Mechatronics system design project
Robot can follow the line properly in a variety of environment light conditions with
small line error even at quite high speed. The robot also has successfully detect the color of
the load and carry to the right end point.
2. Limitation and improvements
2.1. Mechanical manufacturing
7
Ho Chi Minh University of Technology Mechatronics system design project
Limitations: The design is too complex for assembling the components together as it
takes times to assemble and separate which makes difficulty for components replacements.
2.2. Electrical components
Limitations:
- From the beginning, we design four buck converters on our circuit and it leads to
the malfunction in our PCB so we have to replace it with another one.
- The coil on the new PCB sometimes heated up and released smoke which can
damage our system.
Improvements:
- We should check the PCB design carefully first before manufacturing.
- We should try to have a appropriate wiring for our PCB so that we can ensure all
the essential wires and power source wires are connect precisely.
2.3. Control system
Limitations:
- Our system sometimes lost the control so it cannot detect the line properly.
- Sometimes the color sensor value is incorrect and the robot will carry the load to
the wrong destination.
Improvements:
- We should have a shield for the color sensor for better performance of the system.
3. Conclusion and future development
3.1. Conclusions
After this line follower and obstacle avoidance robot project, our group has completed
the following objectives
- Researches about the current researches and model of line following and obstacle
avoidance robot in the reality.
- Know-how to prepare and plan for a mechatronics project.
- Designed, manufactured and conduct experiment on the robot which has
successfully not only follow the line, but also detect and avoid the obstacle at
arbitrary positions on the line path.
- Complete all the documents and required drawings in time.
3.2. Future development
- Expand the capability to carry and transport load for the robot to be utilized in
warehouses.
- Improve the line following controller using Fuzzy-PID adaptive control to improve
the line error.
7
Ho Chi Minh University of Technology Mechatronics system design project
REFERENCE
[1] Reza N. Jazar (2017) - Vehicle Dynamics: Theory and Applications, Springer
International Pulishing.
[2]LD-60 Autonomous Mobile Robot,
[Link]
series_mobile_robot_datasheet_en.pdf
[3] Electric AGV - AWRM-PO700 - automationware - omnidirectional
([Link])
[4] Pioneer 3-AT, Adept Mobile Robot, available:
[Link]
[5] ez-Wheel, SWD Started kit for AGV&AMR, Instruction manual.
[6] Battery options for mobile robots, available:
[Link]
[7] Nguyễn Tấn Tiến, Trần Thanh Tùng, Kim Sang Bong (2016), Giảng dạy thiết kế
hệ thống cơ điện tử qua đồ án, Hội nghị toàn quốc lần thứ 8 về Cơ Điện tử.
[8] Different types of motors used in robotics, available:
[Link] robotics#:~:text=DC%20motors
%20are%20commonly%20used,need%20for%20high%20i nitial%20torque.
[9] Lam, H. D., Le, T. D. H., Phan, T. T., & Nguyen, T. T. (2014, November).
Smooth tracking controller for AGV through junction using CMU camera. In The 7th
Vietnam Conference on Mechatronics (pp. 597-601).
[10] An Intelligent Line-Following Robot Project for Introductory Robot Courses,
2010.
[11] M. S. Islam, Design and Fabrication of Line Follower Robot, Asian Journal of
Applied Science and Engineering, Volume 2, No 2, 2013.
[12] Juing-Huei Su, An intelligent line-following robot project for introductory robot
courses, World Transactions on Engineering and Technology Education, Vol.8, No.4,
2010.
[13] Difference Between Phototransistor and Photoresistor (LDR),
available: [Link]
phototransistor- [Link]
[14] ROBOT PLATFORM,[Link]:
[Link]
[Link].
[15] IQS Directory, 2023. Available:
[Link]
guided- [Link]#:~:text=Three%20types%20of%20AGVs%20are,to%20be
%20recharged%2 0or%20repaired.
7
Ho Chi Minh University of Technology Mechatronics system design project
[16] Oguten, S., & Kabas, B. (2021). PID Controller Optimization for Low-cost Line
Follower Robots. arXiv preprint arXiv:2111.04149.
[17] Engin, M., & Engin, D. (2012, September). Path planning of line follower
robot. In 2012 5th European DSP Education and Research Conference (EDERC) (pp. 1-5).
IEEE.
[18] Ismail, A. H., Abdul Zaman, A. M., & Terashima, K. (2016). Fuzzy logic
approach for line following mobile robot using an array of digital sensors. IJAIEM,
5(7), 108-115.
[19] Azzabi, A., & Nouri, K. (2021). Design of a robust tracking controller for
a nonholonomic mobile robot based on sliding mode with adaptive gain. International
journal of advanced robotic systems, 18(1), 1729881420987082.
[20] R. [Link], in Vehicle Dynamics - Theory and Application.
[21] T. C. –. L. V. Uyển, “Thiết kế hệ thống dẫn động cơ khí tập 2”.
[22] N. Đ. Tốn, “Dung sai và lắp ghép”.
[23] Control tutorial for MATLAB & SIMULINK, DC Motor Speed: System
Modeling, available at: [Link]
example=MotorSpeed§ion=SystemM odeling
[24] Curio Res (2021). How to design and implement a digital low-pass filter on an
Arduino. Available at:
[Link]
[25] R. [Link], in Vehicle Dynamics - Theory and Application.
[26] A. M. &. B. A. Joseph [Link], "Mobile Robot Inspirational to
Implementation," p. 221.
[27] F. [Link], “Electric Motors and Control Systems,” pp. 117 - 118.
8
Ho Chi Minh University of
Weeks
Works Number of days 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
I. Overview 84
Introduction and reasearch related issues 21
Research on available models 21
Select parameters and approach 21
Adjust an overview 84
II. Design
1. Mechanics 42
Calculate and select of motor 14
Design of frame 14
Draw 3D drawing and adjust parameters 21
Draw 2D drawing 21
Adjust parameters of 2D drawing 35
2. Electrics 49
Build a schematic diagram of electrical system 1
Select components of electrical system 14
Design driver 21
Select and test sensors 21
Read data of sensors 21
Adjust parameters 35
3. Control 49
Model the kinematic for mobile robot 7
Model the kinematic for the system 7
Determine transfer function of motor, driver 7
Design PID for motors 21
Design state feedback controller 21
Model sensors, kinematic system 28
Adjust parameters 28
4. Simulation 35
Programming 21
All members
Phan Hoàng Duy
Hồ Lê Khánh Dy
Nguyễn Trung Đức
Lê Tiến Đạt
7