Anda di halaman 1dari 6

PID CONTROLLER

Rivas Motta Laura Daniela, Hernández Moreno Leidy Vanessa


Bogotá D.C
Manuela Beltrán University
laura_rivas18@outlook.es, lvhm_blue@hotmail.com

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:

 Structure of the PID 𝐶𝑃𝐷 (𝑠) = 𝐾𝑝 + 𝑠𝐾𝑝 𝑇𝑑

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 members of the family of PID controllers include three


actions: proportional (P), integral (I) and derivative (D). These
controllers are called P, I, PI, PD and PID. [2]

 The Proportional parameter (P) measures the


difference between the current value and the set-point
(in percentage) and applies the change. Its transfer
function remains:
Table 1 Parameters Adjust
𝐶𝑝(𝑠) = 𝐾𝑝
B. ARDUINO SOFTWARE
Arduino is a development platform based on a free hardware
electronic board that incorporates a re-programmable
microcontroller and a series of female pins, which allow
connections between the microcontroller and the different
sensors and actuators in a very simple way (mainly with dupont
cables).

Illustration 4 L298N Block Diagram

Illustration 1 Slogan Arduino D. ULTRASONIC SENSOR (HC-SR04)

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]

Illustration 5 Ultrasonic sensor


Illustration 2 Arduino Plate
This sensor has the same function as a radar as it sends pulses
C. L298 Driver at high frequency in this case ultrasonic. It is composed of two
piezoelectrics: a transmitter and receiver both in the form of a
cylinder. The transmitter is in charge of emitting the ultrasonic
The L298N driver is a device for controlling the operating
signal and then being bounced through an object reaching the
direction of motors at an output current per channel of up to 2A.
receiving cylinder. Because it will take a while for the signal to
This module has a heat sink according to the characteristics of
return from the time it is emitted, it is obvious to think that the
this driver, its characteristic design allows an exceptional anti-
speed with which it will reach the receiver is intimately related
interference performance and may work up to a voltage input
to the distance of transmission and bounce. [5]
level of 46V, although for safety reasons it is recommended to
use voltage levels somewhat below this limit value. [4]
II. MATHEMATICAL DESING

 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

· High level : 2.3V <= Vin <=


Vss
 DC motor
Control signal input · Low level: -0.3V <= Vin <=
level 1.5 V
Returning to the differential equations of the DC motor
developed above, the Laplace transform is applied:
Control current 36mA
L𝑠𝑖 (𝑆) = 𝑉(𝑆) − 𝑅𝐼 (𝑆) − 𝐸𝑎 (𝑆) (1)
Output power 25W
𝐽𝑠𝑤(𝑆) = 𝑇𝑚 (𝑠) − 𝐵𝑤 (𝑆) (2)
Indicator lights Ignition, control, direction
𝐸𝑎 (𝑆) = 𝐾𝑎 𝑤(𝑆) (3)
Operanting
𝑇𝑚 (𝑆) = 𝐾𝑚 𝐼(𝑆) (4) Temperature -20°C~+135°C

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

𝑇𝑚 (𝑆) (𝑅 + 𝐿𝑠 )(𝐽𝑠 + 𝐵) + 𝐾𝑚 ∗ 𝐾𝑎 (%𝑒𝑟𝑟𝑜𝑟)∗100


= 𝑇𝑚 (𝑠) 45
𝑣(𝑆) 𝐾𝑚 (𝐽𝑠 + 𝐵) 𝑋= *PID
100

Finally, the transfer function that relates the output (torque) to


the input (voltage).
(95 − 5) ∗ 100 with a distance of 100 cm. This starts to vary the PWM of the
45 1 motors at the moment that feels 38 cm until it has a reading of
𝑋= ∗ (1 + ) ∗ 57
100 0.4 8 cm or less (from the location of the sensor to the object) to
achieve a stop.
255 On the other hand, it works with the module L298N, for the
𝑝𝑤𝑚 = = 1.35
189 control of the pwm of both engines, which were in the position
of the tyres of the car. For its operation it was necessary to use
two batteries in parallel so that the voltage and the current were
III. RESULTS sufficient to power both engines. However, the arduous energy
is used for the sensor and the location of the driver pins.

As far as the stability graph generated with the transfer function


in the Simulink software shows some above peaks because the
derivative control is not introduced which is the one that allows
to decrease these.

V. CONCLUSIONS
Fig. 2 Block Diagram PID control

 Using the software that allows a simulation of a


Matlab control system using simulink it is able to
simulate simple and complex systems as it has a
high processing speed and with the advantage
that the user can interact with systems, obtaining
optimal results for their respective design.

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

IV. ANALYSIS OF RESULTS ANNEXES

For the design of the car, an ultrasonic sensor is used, in order


to detect the distance of the car to an object, In our case it works

Anda mungkin juga menyukai