Abstract: Controllers are devices that allow us to maintain a Where Kp is an adjustable proportional gain. A proportional
variable at a certain reference value, by means of a feedback controller can control any stable plant, but has limited
loop. By means of this practice the PID control of distance performance and error in regime off-set. [1][2]
and acceleration of a carriage is carried out which when
approaching a certain object this varies its speed (pwm) until
it can be stopped before colliding with it, subject to different The Integral parameter (I) refers to the time it takes to
disturbances it must not change its operation. An ultrasound perform corrective action. As the value is smaller, the
sensor and arduous software were used. setting is faster but can cause system instability,
oscillations, motors and pump vibration. Its transfer
Keywords: distance control, acceleration control, PID function remains:
control, PWM.
1
𝐶𝑃𝐼 (𝑠) = 𝐾𝑝 (1 + )
𝑇𝐼 𝑠
I. INTRODUCTION
where Ti is called integral time and is the one who adjusts
integral action. With integral action, a small positive error
A. PID CONTROL always if it is negative, the control system will be degressive.
This simple reasoning shows us that the error in permanent
regimen will always be zero. [1][2]
The PID control is a control mechanism that through a feedback
loop allows regulating the speed, temperature, pressure and
flow among other variables of a general process, The PID
The parameter Derivative (D) emits a predictive
controller calculates the difference between our real variable
action, that is, it foresees the error and starts a timely
against the desired variable [1].
action, Its transfer function remains:
Consider an entry and exit control loop (SISO) of a degree of Where Td is a so-called derivative time constant. This action
freedom: has a preventive character, which makes the control action
faster, although it has the important disadvantage that amplifies
the noise signals and can cause saturation in the actuator. The
derivative control action never used on its own, because it is
only effective during transitional periods. [1][3]
Fig 1.Block Diagram. Adjust controller parameters according to the following table:
The Arduino plate is nothing more than a PCB that implements Ultrasonic sensor HC-SR04 which is a sensor that emits an
a certain design of internal circuitry, so the end user should not ultrasonic wave, which disperses and bounces off being
worry about the electrical connections that the microcontroller captured by the sensor allowing to calculate the distance
needs to operate, and you can start directly developing the between the sensor and a certain object, detection range as it is
different electronic applications you need. [3] quite wide, ranging from 2 cm to 5 m at a resolution or accuracy
of 3 mm. [5]
Physical Aspects
WEIGHT:
Car Mass= 0.4633 Kg
𝑤 = 𝑚𝑎𝑠𝑠 ∗ 𝑔𝑟𝑎𝑣𝑖𝑡𝑦
𝑚
𝑤 = 0.4633 𝐾𝑔 ∗ 9.8 2
𝑠
𝑤 = 4.54 N
FRICTION:
𝜇𝑒 = 0.9
𝑓𝑒 = (𝜇𝑒 ∗ 𝐹𝑁)
Illustration 3 L298N Driver
𝑓𝑒 = 0.9 ∗ 4,54𝑁
𝑓𝑒 = 4.086𝑁
TORQUE:
R=0.065m
(𝑓𝑒 ∗ 𝑟)
𝑇=
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑚𝑜𝑡𝑜𝑟𝑠
(4.086 𝑁 ∗ 0.065 𝑚)
𝑇= 𝑇𝑚 (𝑆) 𝐾𝑚 (𝐽𝑠 + 𝐵)
2
𝑚2 = 2
𝑣(𝑆) 𝐽𝑠 + (𝑅𝐽 + 𝑙𝐵)𝑠 + 𝑅𝐵 + 𝐾𝑚 ∗ 𝐾𝑎
𝑇 = 0.1327 𝐾𝑔 2
𝑠
ACCELERATION:
L298N Driver
(𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑚𝑜𝑡𝑜𝑟𝑠 ∗ 𝑡𝑜𝑟𝑞𝑢𝑒)
𝑎=
𝑟𝑎𝑑𝑖𝑜 ∗ 𝑚𝑎𝑠𝑠
Controller L298/ Double Bridge H
2
(2 ∗ 0.1327 𝐾𝑔 𝑚 ⁄𝑠 2 )
𝑎= Power interface 7V~46V
0.065 𝑚 ∗ 0.4633𝐾𝑔
Maximun current 2A per channel
𝑎 = 8.813 𝑚⁄𝑠 2
SPEED: Control voltage 5V
We replace 3 and 4 in 1
𝑇𝑚 (𝑆) 𝑇𝑚 (𝑆) Control PID
𝐿𝑠 = 𝑉(𝑆) − 𝑅 − 𝐾𝑎 𝑤(𝑆)
𝐾𝑚 𝐾𝑚
𝐾𝑐 = 100 𝑐𝑚
From equation 2 the angular velocity is obtained 𝑃𝑐 = 0,8 𝑠
𝐾𝑝 = 𝐾𝑐 ∗ 0.6
𝑇𝑚 (𝑆) 𝑝𝑐 = 95 ∗ 0.6
𝑤(𝑆) = 𝑝𝑐 = 57
𝐽𝑠 + 𝐵
We replace 𝑇𝑖 = 𝑃𝑐 ∗ 0.5
(𝑅 + 𝐿𝑠 )𝑇𝑚 (𝑆) 𝑇𝑚 (𝑆) 𝑇𝑖 = 0,8 ∗ 0.5
𝑣(𝑆) = + 𝐾𝑎
𝐾𝑚 𝐽𝑠 + 𝐵 𝑇𝑖 = 0,4
Rewriting we have to: 1 1
= = 0.5
𝑅 + 𝐿𝑠 𝐾𝑎 𝑇𝑖 0.4
𝑣(𝑆) = ( + )𝑇
𝐾𝑚 𝐽𝑠 + 𝐵 𝑚
1
Where 𝑃𝐼𝐷 = 𝑋 (1 + ) ∗ 𝐾𝑝
𝑇𝑖
𝑣(𝑆): 𝐼𝑛𝑝𝑢𝑡
𝑇𝑚 : 𝑂𝑢𝑡𝑝𝑢𝑡 1
𝑃𝐼𝐷 = 𝑋 (1 + ) ∗ 57
0.4
Operating
V. CONCLUSIONS
Fig. 2 Block Diagram PID control
BIBLIOGRAYPH
[1 B. Franklin, "Franklin electric," 09 05 2013. [Online].
] Available:
https://franklinelinkmx.wordpress.com/2013/09/05/que-
es-el-control-pid/. [Accessed 25 10 2019].
[2 V. Mazzone, "Controladores PID," marzo 2002. [Online].
] Available: https://www-
eng.newcastle.edu.au/~jhb519/teaching/caut1/Apuntes/PI
D.pdf. [Accessed 25 10 2019].
Illustration 5. Stability Graph [3 Arduino. [Online]. Available: https://arduino.cl/que-es-
] arduino/. [Accessed 25 10 2019].
[4 Vistronica, "L298N DRIVER," 2019. [Online]. Available:
] https://www.vistronica.com/robotica/modulo-l298n-para-
control-de-motores-detail.html#. [Accessed 25 10 2019].
[5 A. G. González, "HC-SR04: Sensor ultrasonico para
] Arduino," 19 02 2013. [Online]. Available:
http://panamahitek.com/hc-sr04-sensor-ultrasonico-para-
arduino/. [Accessed 26 10 2019].
[6 Anonymous, "TT MOTOR," 2017. [Online]. Available:
] http://www.usattmotor.com/news/what-s-the-difference-
between-dc-servo-step-8387158.html.
Illustration 6 Car