Tip:
Highlight text to annotate it
X
Hi everyone of the arduinobymyself blog and Instructables.
Blog dedicated to the Arduino.
Contains project information, turorials, tips and tricks.
The development of hardware and software designs.
of the Arduino projects.
ah
We will continue talking about the brightness control with Arduino and PID control.
The PID control
of luminosity
using Arduino hardware
in the first part, we did a project
here we have the scheme of first project
very simple
It is to control the brightness in the inner of the black tube.
in the totally dark environment
and it could not suffer external interference
we saw that
how to do the brightness control
using a LDR and a LED
giving us the information needed
regarding the environment brightness
and the LED
being
the brightness control device, increasing or decreasing the brightness
ah
doing the environment brightness control
so, in this first part we saw
how to use
The FrontEnd PID and the
PID library for Arduino
and come to some conclusions. and now, in this second part
some changes were made
in the schematic
what is new?
it have a pontentiometer
to tune the setpoint value
so, in the A1
analogic pin 1
of the Arduino board
I have this
control
of the setpoint
and in the A0 pin
we still have the LDR information
as a feedback
to the control
of the PID that is internally in the Arduino
the LED remains controlled by the digital pin 3
that actually is a PWM pin
so this is the real picture of the project
we can see the potentiometer and its connection with the Arduino.
we can see the LDR (the feedback)
and we can see the LED
generating light for the system
the whole part of control via software, how to install the libraries...
how to install the FrontEnd is the same
of the first part... What is new?
what will change now,
is the sketch that will be sent to the Arduino.
this is the change
we have a new program to the Arduino
you can download directly from the 4 shared website
one another change is that: now we have an open environment and it can
suffer disturbances.
in this way, we can insert a disturbance
and verify the system behavior
related
with these disturbances
So, this video will be posted in the blog
Arduinobymyself and Instructables
it is all there...
and there you can download the sketch and all libraries needed
the PID library
the ControlP5 for Processing
and the PID_FrontEnd
...
the whole links
all files will be there for download
thus you can reproduce these tests
Here I have the new sketch
it is just send
to the Arduino board
Here I have the Processing
actually I will run the Processing
I will put 0
to the
setpoint
and let's see
how it works with this control
the processing is opening, it is time consuming due to the graphics
so
in the
PID FrontEnd I have 0 to the setpoint
thus, the output control is 0
if I have 0 to the setpoint the control output will be 0 too
the red line is my input
what is this red line?
actually, it is my real environment brightness. If I increase the environment brightness
...
it will increase my input, and if I decrease the environment brightness
it will decrease
ah
my input too
I will let in a satisfactory level, in order that we can see the circuit.
and we can see
that the LED
will light according as we will setting the setpoint
If I put a setpoint
equals to 400
we can see that the brightness
of my system
will increase
the LED has a flash
just because the system is trying to control
the brightness of my environment
and we can see that the LED lit a little bit
because
we are close to the minimum environment brightness
if I increase the setpoint
perhaps to the 800
and now we can see that the LED lit a little more
and I can see in the FrontEnd
that the PID control is acting to keep the brightness in the setpoint value
around 780, 786, 787, ........ vary a little
this variation is due to the system and PID parameters
in this moment
if I interfere in the system with a shadow for example
the brightness of the LED will increase
trying to keep the control close of the setpoint value
how much more do I shade, the LED brightness will increase.
trying to keep the control close of the setpoint value
until the time when the LDR will be blocked
thus my output (blue line) will go to maximum and I cannot act more in the output
the system will be blocked
for example, now the system is blocked.
I lost brightness information
due to the interference
if I take out the interference
we can see that the control goes back to the setpoint value
trying to
keep the setpoint value, and the output drops to
the older level
thus
with a interference
causing a interference
the PID control wil increase
the LED voltage
keeping in the control
as more I increase the interference more is increased LED voltage
till the maximum
in this moment I lost the control
and the red line will fall, losing the normal parameters
if I take out the disturbance
it returns
to the normal PID control
Now, let's modify the PID parameters to those obtained previously
KP equals to
0.0.1
KI equal to
0.28
and
KD equal to 0
these were PID parameters to those obtained previously, in the old version of this project
once more
placing disturbance
or changing the setpoint value
for example to
about 550
the system acts
trying to keep the setpoint value
and so,
with a disturbance
PID try to keeping
the setpoint parameters
till be blocked
and cannot keep the information
so, this is our second project
the second part
remembering that
in this second part
there are 3 modification:
The system now can suffer external disturbance
it is not free from interference
external interferences
second modification - the setpoint control is made by a potentiometer
it is not
necessary modify the setpoint in the FrontEnd PID
just the KP, KI and KD
parameter must be modified via FrontEnd
and
the third modification is the sketch to the Arduino
I have a new sketch
that needs to be sent to the Arduino
just download this file from the Blog
arduinobymyself
....
this video will be there (in the blog)
ASAP
That's all, and..... till the next project.