PID Algorithm Applied on Led Lamps Luminosity Control

Aiming sustainability and great demand of electric energy, there is a need for new technologies development, creating equipments to reduce costs generated by electric energy consumption, this article presents a prototype of control and energy monitoring applied dimmable LED lamp illumination circuit in a room, zenital architecture and sheds topology. To keep appropriated luminosity level, this system act monitoring natural light available on the environment and adjusting luminosity of the lamps, the control basis used in this project is a PID controller with retroaction because it is an industrial control algorithm very disseminated on automation sector which although being a robust system, it is very easy understanding and provide satisfactory results on automated processes. The control and monitoring take place from reading of luminosity sensors, of tension and current installed on prototype besides an LCD display that shows information from data obtained by sensors, this system has more flexibility to the user. A PID controller was designed to analyze and domain process, driving the system to get highest efficiency levels. Keywords— Dimmer, LED, controllers, PID.


INTRODUCTION
The global electric energy wasting reaches high rates, having a consequence of climate change in the last years, therefore it is an important to promote and implement conscious use if electric energy. ISO 50001 deals with energy management, it is one more proof that worldwide companies have same objectives that is wasting reduction, preservation of natural resources and sustainable development.
Beyond benefits on correct use of electric energy, the energy efficiency projects contribute to people quality improvement, once the saved resources can be invested in health, education and leisure. The environment is also favored with these measures (SANTOS, 2012).
With that, the emergence if practical and effective methods of equipment optimization, that use electric energy, are the new market trend. In this view, the devices are designed with the intention of perform activities in the shortest time possible and generate high production, in view of the need for an efficient control so that no performance loss occurs (LOPES, 2018).
With the arrival of technology, that is possible developing autonomous equipments applying control basis and a management system, we can control the way electricity is delivered to the charge and assist in the consumption standards avoiding wasting.
This article has as objective to develop an illumination control system to assist on electric energy consumption reducing through automatic control of its luminosity intensity making better use of natural light of the environment. Design and evaluate a PID controller to control environment luminosity.
Also it was developing a hardware of control that analyze through sensors of illuminance in a specific environment and subsequently control power applied on illumination circuit.

Controllers
According to Ogata (2005), the robust and efficient control of variables as temperature, luminosity, color, level, humidity and flow rate, for example, guarantees good performance of automated process once these variables influence directly to products quality, there are two models adopted on control system. output value. It is recommended to use this model in systems where there are as few external disturbances as possible which are undetected and may interfere with the process. As illustrated in figure 1.

Closed Loop
The retroactive (closed loop) model uses feedback data from the controller output, acting proportionally to the error corresponding to the difference between the desired setpoint value and the system output value, as shown in figure 2. Thus, the system becomes less susceptible to external disturbances.

2.1.3
Lighting Setpoint The setpoint is the response value that is to be achieved with a control system, this value needs to be set and informed when controlling system adjustment.
An NBR 5413 (Brazilian Association of Technical Standards, 1992) establishes the minimum average illuminance values in service for indoor artificial lighting, where trade, industry, education, sports and others are performed.

ON/OFF Controller
Starting from a simple automatic control process, we have the ON/OFF method where the control variables are Boolean values (true or false). This is an intelligent control form widely used in automatic lighting controls with electric photo relay or timer relays. And can be represented by the following equation: Where U (t) only takes two values 0 or 1. An ON / OFF control system can be represented by the block diagram of figure 3. This control mode adopted in automatic lighting systems is elementary and relatively economical.
However, it does not provide the combination with high efficiency hybrid systems associating natural light, because it does not have a convergent behavior to the error acting dynamically in closed loop permanent regime.

Proportional Controller
For a controller with proportional control action, the relationship between the controller output signal u (t) and the acting error signal e (t) is: Or, in the frequency domain, Where Kp is called proportional gain. Whatever the actual mechanism or form of energy used in the operation, the proportional controller is, essentially, an adjustable gain amplifier.
A block diagram illustrating the action of this controller is shown in figure 4.

Proportional and Integral Controller
The performance of a P.I controller is defined by: Or by the transfer function given by: Where Kp represents the proportional gain and Ti, called full time. Both values are adjustable. The integral control action is corrected from full time. However, a change in proportional gain affects both the proportional and control action. The figure 5 shows the block diagram of a proportional and integral controller.  The combination of the proportional, integral, and derivative control action is called PID.
This combined control action has the advantages of each of the three individual control actions (proportional integral and derivative). Which is represented by the equation, Or by transfer function: Where Kp represents the proportional gain, Td represents the derivative time and Ti represents the integral time. The block diagram of a PID controller is shown in figure 6.

Proportional, Integral and Derivative Controller Actions
The control signal generated by PID controller is intended to achieve good steady-state transient performance of the controlled system.
According to Ogata (2003), the purpose of the controller is to compare the actual value of the plant output to the reference input, and to provide a control signal that will reduce the error to zero or as close to zero as possible.
By analyzing the presented controllers, it is possible to determine four basic configurations, defined from a specific plant, such configurations are: 1 -Proportional Controller (P).  The integral component of the proportional and integral controller is intended to accelerate the system response with respect to the size and duration of the error, in other words, to the accumulated error, reducing the off-set error generated by the proportional action. The integration gain requires moderate adjustment, as too low values may cause the system to have a slow response, while a high gain will lead to an unstable system response, figure 8. The derivative component of the proportional and derivative controller is applied to the system inertia which is explained by the process performance that has a natural delay in the output signal by modifying the input variable. Derivative action anticipates error correction by decreasing system response time.
The objection to the use of, exclusively derivative, a controller is at its extreme points, where in a system with excessive noise tends to a highly variant error that interferes with the control algorithm leading to an undesired output, while a derivative controller tends to zero if the error value is constant, in which case a proportional variable is required to generate a signal at the controller output.
The rate of change of the error is determinant in the action of the derivative controller. In the point of view and one application practices the derivative controller and determinant in the stability of the system acting in the reduction of the overshoot caused by the integrative gain, Figure 9. The proportional, integral and derivative controller combines the advantages of the PI and PD controller. The integral action is directly linked to the accuracy of the system being responsible for the null error in steady state.
The destabilizing effect of the PI controller is balanced by the derivative action that tends to increase the relative stability of the system while making the system response faster due to its anticipatory effect, figure 10.

Manual Tuning Method
When designing a PID controller, it is necessary to adjust some parameters that influence the system behavior, these are specific gain values (kp, ki, kd). The literature presents numerous methods that allow this adjustment. In the case of manual tuning, the parameters are adjusted separately and the system behavior is analyzed until the desired results are obtained.

ATMEGA328P
The Atmega328P is an AVR microcontroller developed by ATMEL, it has fourteen digital inputs / outputs (six of them PWM), six analog inputs, 32Kb Flash Memory, 2 kb RAM (SILVA et al., 2014).
The microcontroller is responsible for processing the data obtained through the light, current and voltage sensors, transforming the voltage levels generated at the sensor output into the physical equivalent of each unit of measurement using a linear equation implemented in the embedded software. It is also responsible for configuring Pulse Width Modulation (PWM) signal generation to configure the TRIAC conduction angle (Triode for Alternating Current), controlling the amount of energy delivered to the load.

TRIAC
The TRIAC, alternating current triode, is an electronic component equivalent to two SCRs, connected in antiparallel (anode with cathode) and terminal (Gate) tripped. This type of connection results in a two-way electronic switch as well as a DIAC (Diode for Alternating Current), conducting two-way electrical current (SILVA et al., 2014).
The TRIAC (Triode for Alternating Current) -an alternating corrective period represented by schematic figure 11. The TRIAC is used to switch alternating current from a signal applied to its gate terminal. The trigger signal can be generated by a microcontroller that sends a variable period pulse train, where the average voltage delivered to the load is delimited by the time the generated signal has a high logic level. The operation of the TRIAC is illustrated in the graph of figure 12, which shows the triggering at different points of the sinusoidal signal.

BH1750
The BH1750 is a digital light sensor IC module designed for I²C bus interface. It is equipped with 16-bit digital output that provides a resolution from 1 to 65535 lux  The BH 1750 is an ambient light sensor with digital data output, and has built in every circuit essential for its operation, including a silicon photodiode, a signal amplifier that converts photodiode-generated electrical current into an analog voltage signal that features a 16-bit resolution AD converter for the amplifier-generated voltage signal, which is calculated and expressed in the lux unit of measure. Data generated on the sensor's internal circuits is transmitted in I²C protocol to other devices with the same technology through the data pins (SLA) and (SLC) clock, and more than one sensor can be connected to the same data bus.

Integrated Module NRF24l01
The NRF24L01 communication module consists of an integrated radio frequency wireless communication circuit developed by Nordic Semiconductor Company. That uses the NRF24L chip. Depending on the manufacturer, the module is Transceiver, that means, operate as sender or receiver, depending only on modifying its settings.
In the case of communication between frequency radios of the same type, it can present up to 2 Mbits for the data transfer rate, has 125 channels and works in the frequency range of 2.4 -2.5GHz (ORTIZ, 2013).
In the module integrated circuit, besides the passive components, it has an antenna that helps to send and receive data, also has 10 interface pins between the transceiver module and a microcontroller with SPI protocol. The module in figure 14, together with the electrical scheme shown in figure 15.

LCD Display
The operation of the LCD (Liquid Crystal Display) is based on the existence of an electric field in the region where the liquid crystal is located, which tends to organize its molecules, thus allowing the passage of polarized light, the control of electrode voltages, providing the necessary characteristics so that an image or information summing up all the pixels can appear (MUNARINI et al., 2015).
The LCD controller has a RAM, called display data memory and referenced with the acronym DDRAM (Display Data RAM), which receives the data we want to display. For example, to make the letter "A" appear in the first position of the display, simply write the byte 41H (ASCII of the letter A) at position 0 of the DDRAM (SANTOS, 2012).
The LCD display used in this project has 16 columns and 2 rows in which they indicate the voltage, current, power and luminous flux values. This display was chosen due to the low-cost in the market, besides having a HD44780 controller, that is an easy-to-communicate with microcontrollers.

Current Sensor
The ACS712 -30A current sensor, which supports instantaneous current values between -30A and + 30A. The sensor output is a voltage value between 0V and 5V, proportional to the measured current (Pacheco et al., 2016).
According to information from ACS712 datasheet reads DC / AC current, and generates a potential difference that can be read by a microcontroller, when there is no electric current the voltage value is 2.5V in alternating current according to the graph illustrated in Figure 16.

International Journal of Advanced Engineering Research and Science (IJAERS)
[

IV. APLICATIONS
In order to rationalize the consumption of electricity, many projects are currently being developed, among them architectural projects that present new geometries and buildings with the purpose of absorbing natural resources, such as wind minimizing thermal loads and light decreasing the current consumption generated to illuminate environments.
Natural light offers many advantages in terms of energy efficiency in buildings and can be a determining factor in reducing electricity costs.
There are many projects that aim to use natural light as we can mention the use of zenith openings in buildings. However, the design and sizing of lighting circuits in most cases does not meet the main disadvantage of these types of architecture, which is the variation in ambient light levels due to climate change. Which characterizes a problem to be corrected. Projects are being developed with the same purpose which encourages the pursuit of improvement, in this case a low-cost application with a robust control strategy, aiming to obtain better results.

V.
RELATED WORKS The development of this project starts from the bibliography of similar works with common objectives, which allow the study of applications and comparisons of the results achieved between them.

Case Study 5.1.1 Developing a Light Controller for Alternating Current Power Leds
Silva; Siqueira and Alberti (2013) feature present the development of an AC power LED light controller, which brings economic advantages of the product in relation to those present in the market, taking into account the importance of adequate lighting in study, work and leisure environments. The importance of the development of new technologies that help in the rational use of electricity and reduce environmental impacts is known.
The technology used as a light source is the power LED that has its AC power supply. Being widely used for longer durability and lower power consumption, the advantages of this technology increase through power control, bringing the lighting to levels suitable for certain environments.
The tests in the development of this project showed the luminous variation of the LED's from the change of voltage value, leading to the development of a dimmer circuit.
The use of Seoul Semiconductor's Acriche LED line has assisted in the development of this project by operating on AC power without the use of converter circuits, ideal for residential and industrial applications that have AC power sources.
The emitter used for this project was the A3 W series 4 W AN3200 and the temperature is approximately 3000 K, an illumination level of 200 lux (measured at 50cm distance) and a luminous flux of 180 lumens.
Control of the voltage and current amplitude in this design is done by a PWM-controlled AC-AC buck converter, which features two-way IGBT switches with internal diodes, applying a voltage to the load at a given time and proportional to the duty cycle network operation by controlling the effective voltage range on load.
The control PWM signal is generated by means of a PIC 18F4550 microcontroller and intermediated by an HCPL-314J driver with the function of integrating the control and power circuits controlling the semiconductor switches, drive frequency parameters and made by means of a potentiometer.
The final design has advantages in the use of low-power, long-life AC power LEDs that can reach over 30.000 hours of operation, which makes it possible for domestic and industrial use to control with two-way switches using MOSFET, which operates at a given angle of conduction of the voltage delivered to the load, controlling the light intensity and the power consumed by the LED. However, operation of this type of switch may cause damage to the circuit due to excessive time or signal overlap when switching the switches.
The use of the HCPL-314J driver for key actuation, which can drive two MOSFET independently, made the interface between the controller and the converter generated by PWM was not enough to activate the keys, which were sized to work at 15V dc.
All the electronic arrangement developed in this project proves that the ideas are fully applicable, and with objective achieved in relation to the economic advantages that reaches fifty percent compared to other imported products with the same functionality, according to the authors research. The project developed by Diego Zeuner Fagundes Santos (SANTOS, 2012) in which addresses a highefficiency light control, adaptable to the environment, using LED lamp. It seeks to show the rational consumption of electricity from the control of light, and the application of natural light in certain environments, causing the power of the lamps to be reduced or increased according to the amount of light in place, maintaining a range practically constant lux and specific for each environment, avoiding energy waste.

High Efficiency Lighting Control, Adaptable to the Environment, Using Led Lamp
For this control practice, a prototype was developed that uses LDR (light dependant resistor) that has its physical characteristics modified, by incident light on its surface generating values that are interpreted by a PIC16F877 microcontroller which controls the power of LED lamps, through an array of components such as a 4n25 optical coupler to isolate the circuit to prevent burnout of the microcontroller port and a TIP122 transistor operating as a pulse width modulation (PWM) pulse width modulation.
The prototype features a 16 x 2 LCD display, which shows the user the minimum and maximum light levels to choose from within a range of 200 to 1200 lux. Predefined setpoint values are shown on the display and vary within a range of 100 to 100 lux, until user choice made via a button installed on the control board.
The implementation of an LCD display has made machine-man interaction more efficient. Enabling the visualization of control parameters and monitoring of sensor data, making a system more dynamic without the need for direct interaction with source code files and the compilation of new data, which would require specific programming language knowledge.
The application of a PWM control provided the variation of LED brightness due to the pulse width applied to the load, in this case in LED lamps. The PWM control is widely indicated for control in direct current circuits which was used in this project with 12V LED lamps, which makes the prototype unfeasible considering that the residential electric circuits use alternating current voltage and amplitude above 100V. Then requiring a transformer to reduce this voltage as well as rectifier circuits and filters in the lighting circuit to be controlled by PWM.
To obtain the luminous intensity which is measured in lux, an LDR photodetector was used which has its resistance altered according to the amount of light in the environment, a simple component to be used in certain applications. However, since it is a nonlinear component, it requires the use of mathematical tools to obtain the characteristic equation, which converts the signal of the resistance variation at the system input into an output signal expressed in lux.
The developed prototype has the sensor installed on the control board making the design less coherent, as it requires both to be exposed to the monitored environment. However, the developers were successful in relation to the proposed project, which combines an automatic control system for artificial lighting, further enhancing the savings in the use of LED lamps.

Smart Low Power Lighting Control by Android Operating System Devices
Paulo Souza (SOUZA, 2016) proposes intelligent low power lighting control through devices with Android operating system.
The development of this project starts from the idea of housing resources management applied to lighting, through home automation seeks to develop in the android system a process of control of light intensity and color in LED strip lighting, this control will be done automatically or remotely. with wireless communication and Bluetooth protocol.
The project also aims to prove the efficiency in thermal and visual comfort to those who are exposed to environments with light controls.
For this it was necessary to search for concepts such as smart home. A smart home connected to a network that can be remotely or automatically controlled making coherent system decision making.
The developed prototype uses an ATMega328P-PU microcontroller responsible for the storage and processing of control variables. To capture the amount of light, the hardware uses an LDR light-dependent resistor, which has its physical characteristics modified according to the incidence of light, as shown in other study projects.
The controlled light source was a Ws2812b addressable LED strip with additive RGB (Red, Green, Blue) color system. This addressing technology enables different control data values to be sent over a single cable, which carries the digital signal generated by the microcontroller.
Wireless communication uses the Bluetooth protocol through a smart phone and a Bluetooth Transceiver module, which can communicate with other devices with the same technology as mobile phones, tablets and laptops.
The ATMega328P-PU microcontroller is easily found and has a relatively low commercial value which facilitates the development of low-cost projects with strong technological power. Using the LDR component as a light sensor requires the development of filters and mathematical equations that aid in an accurate reading of the amount of light, since it is not a linear device.
The use of RGB addressable LED tape is an interesting application because it allows the color variation and luminous intensity of the LED's, with only one digital output from the microcontroller providing control of several

International Journal of Advanced Engineering Research and Science (IJAERS)
[ Vol-6, Issue-12, Dec-2019]  https://dx.doi.org/10.22161/ijaers.612.5  ISSN: 2349-6495(P) | 2456-1908(O) tapes individually through the various digital ports contained in the ATMega328P-PU. This LED strip operates at a voltage of 5V, the same operating voltage range as the microcontroller. A feature that facilitates the design and use of smart phones as a means of controlling lighting system parameters through the Bluetooth protocol. This protocol communicates over a relatively short distance but sufficient in residential environments, for use on android operating system requires the development of an application, however this is not a problem as Bluetooth interface applications are easily obtained from app stores, or can be developed with Android Studio software as in the case of this project. Other interesting points in this project are the ways of control being them remote via smartphone and automatic with the reading of the light sensor. The authors of this research emphasize the great relevance of automatic control projects, which is increasingly present in everyday life with smart homes that bring comfort and convenience to users.

VI.
MATERIALS AND METHODOLOGICAL PROCEDURES With technological advancement, smart devices are being widely developed in order to assist in certain activities, enabling to achieve better results for certain tasks.
For this purpose, an electronic control and automatic monitoring board for ambient lighting was developed. For system management an AVR microcontroller, the ATmega328P, was used.
The firmware was developed using the IDE arduino integrated development environment which is available at www.arduino.com, which has a C++ based programming language, so it was necessary to write the arduino bootloader to the microcontroller. The use of IDE arduino helped in the development of the project with ease in the elaboration of the system embedded in the prototype.
The control board layout was designed using Proteus Designer Suite 8.5 software, in this software it was possible to design the electrical scheme, perform the routing of components to build the printed circuit board layout, and the 3D visualization of the printed circuit board.
The control board operates on 127V alternating current voltage and controls loads of up to 5A of current draw corresponding to approximately 20 units of 23W LED lamps.
The interface contains a 16x2 LCD display where the user can view the voltage, current, power and brightness intensity values of the lamps. In this circuit the LCD display is configured for 4-bit data sending commands through four digital pins. The data reported on the LCD display is obtained through sensors installed on the board and through calculations made by programming such as the case of the power value.
To measure the load current, the ACS 712-30A current sensor was installed invasively in the circuit. The voltage values are obtained in the circuit through a P8, which is a sensor that detects alternating current 127V/220V voltage levels, and informs the microcontroller through analog ports, the use of this sensor in this type of application was interesting. The P8 module contains a 10kΩ and a 220kΩ resistor, and acts as a voltage divider, containing an electrolytic capacitor to stabilize the output values, also has an optical coupler that isolates the AC voltage from the DC signal sent to an analog port on the microcontroller.
The developed board has three control options: local, remote and automatic. By means of a push button, the user chooses the control option, the chosen option is informed on the LCD display. In the local option the brightness control of LED lamps is done manually and with a potentiometer installed on the board that allows the adjustment of light intensity.
The remote option is made with a smartphone or any other Bluetooth-enabled device that is previously paired with the control board using an HC-05 module, pairing access to send commands to the system for brightness adjustment, and receives values from lighting circuit monitoring. An HC-05 Bluetooth module was installed on the board and was configured using AT commands, operating in slave mode, sending RX / TX serial data.
In the automatic option the plate obtains the values of light intensity in the environment and autonomously controls the power of the lamps.
The luminosity measurement is made using a BH1750 light sensor that determines the amount of light measured in lux that falls on its surface, the values detected by this sensor are transmitted through an I²c protocol communication interface to the microcontroller. These values are for adjusting the wattage of the lamps thus maintaining the amount of lux required for the environment.
The determination of the illumination setpoint was made to comply with NBR5413 in item 5, subclause 5.3 Illuminances in lux, by type of activity, 5.3.13 Schoolsmeeting room which the standard indicates three illuminance values, 150-200-300. Following the sub-item 5.2.4.1. Which recommends to adopt the intermediate value in which it will be used in all cases.
The board contains a circuit with the TIC246 TRIAC that controls the lamp power by controlling the firing angle at a given point of the sinusoidal signal. A signal from digital pin 3 of the microcontroller to a circuit containing a 430Ω resistor and an MOC3021 IC triggers the TRIAC GATE, so that triggering occurs at the right time, a zero- pass detector that uses certain components is required, a rectifying bridge, two 30kΩ resistors and one 4n25 CI, this part of the circuit indicates the 0 volt path and is connected to digital pin 2 of the microcontroller. The lamps used were 9W dimmable LED light bulbs with 100l m/W luminous efficiency.

VII. VALIDATION AND CHARACTERISTICS
Following the positioning patterns of lighting electrical panels, where they are generally positioned in discrete locations outside the common access area. This accommodation logistics requires the development of a wireless sensor network, since the light sensors need to be positioned in the environment to be controlled and the control board must be in the frame that distributes the lighting circuits.
The wireless sensor developed is a simple electronic circuit containing an AVR microcontroller, a BH1750 sensor and a NRF24L01 communication module, the BH1750 sensor detects the light levels and transmits through an I²c protocol communication interface to the microcontroller, deals with this information and sends it to the control board via module NRF24L01 giving feedback to the control system. This process of operating of the wireless light sensor is best represented by the block diagram of figure 17. The developed control board carries within it all the tuning peripherals and system interface, where the user determines the control option established to the environment, it is up to him to choose the remote or automatic local control mode in all options the monitoring data is exposed through the on-board LCD display enabling data collection for personal reports or even efficiency comparison with other power controllers. The block diagram of figure 18 represents the control board hardware. The manual mode is a brightness adjustment in which it is not influenced by the variation of the outside light but also allows a reduction in energy consumption through the power control. However, combined with a zenithal illumination will have in the environment varying level of brightness being higher or lower than the standard.
The remote mode has the same characteristics as manual mode but with some advantages, among them, the possibility to obtain the monitoring data directly on the smartphone or notebook just by access pairing, to make control parameterization does not require direct access to the control board, these adjustments can be made directly from your device with bluetooth technology.
In view of the technology and intelligent devices that are being developed it was decided to keep the focus on automatic mode, in this version of the proposed project the automatic mode uses more elaborate control fundamentals, in it was implemented a PID controller, which enabled a better response to light levels in the controlled environment. In the PID controller design there are some parameters that influence system performance.
The strategy used to parameterize the PID controller gains was manual tuning by applying changes to the controller parameters and checking the process behavior until the desired result was obtained.
As said earlier application of this project refers to environment that uses natural resources as a source of light energy we can cite as an example the zenith lighting, so technical standards determine the appropriate light levels for each environment, so the lighting variation in a Zenith system due to climate variation can affect human health since very low as well as very high levels are detrimental to vision, so the automatic system tends to compensate for these variations by keeping the light level appropriate to the environment.

VIII. RESULTS AND CONCLUSION
As indicated in the abstract of this document, the application of the control system was in a meeting room with zenith lighting in the sheds topology as shown in Figure 19. The light levels adopted followed what is established by NBR 5413 (Brazilian Association of Technical Standards, 1992), which concerns the illuminance of interiors where trade, industry, education, sports and others are performed. Although the standard does not deal with hybrid or natural lighting, it serves as a basis for lighting-related design as no technical standard has been found to set parameters for such lighting respectively.
A lighting circuit in the room had its lamps replaced by dimmable LED lamps, the wireless light sensor was placed on the working plane where it could capture the light intensity of the room and the control board was installed in the lighting panel with a setpoint value of 200 lux, at that time the natural light had low intensity but still influenced the internal lighting of the room which needed the complement of artificial light but not at full power which already characterizes a reduction in electricity consumption, and enabled us to adjust the parameters of the PID controller. It has the following characteristics in relation to the parameter values.
With increasing Kp the process becomes slower and less oscillating with less overshoot. High value Ki makes the system accelerated making it possible to reach the setpoint value faster but has instability and more overshoot. Increasing the value of Kd slows down the system with less overshoot.
The controller was parameterized so that there was no overlap to the setpoint signal, avoiding light peaks of the controlled process, but with inadequate values the response signal did not reach the desired value as we can see in the graph of figure 20.  Through the analysis of the graph and table we detected an average value corresponding to 198.3 lux with the setpoint at 200 lux. That shows the application of the control method applied in this project reached an error rate of 0.85%. on a permanent basis.
Because it is a variant system due to the natural influences of the external illumination, the graph of figure  22 represents a transient analysis with high external variation as well as a unit step response. Step.

International Journal of Advanced Engineering Research and Science (IJAERS
In this case the initial error at 200 lux corresponds to 1.5% of the average read response values of the system, applying a radical variation of the setpoint value corresponding to half of the previous value, that means, 100 lux, the system took 3 seconds. to reach the desired light levels and followed with an error rate of 0.64%.
From the graphical analysis of the data obtained with the proposed prototype, we can notice the efficiency of a control system in obtaining desired results, emphasizing the energy saving with this system and easily perceived when not using, the maximum power of the lamps as previously, the simple control of power in relation to time characterizes a decrease of the consumed energy, besides maintaining the adequate light levels contributing to the visual health of those who frequent this environment.
The implementation of voltage and current sensors in addition to different control modes in this project aimed to show the numerous possibilities in an intelligent control project adding value to the developed product and inspiring new related projects.