1. · Phase control TCA 785 Control thyristors, triacs, and transistors. The trigger pulses can be...
Transcript of 1. · Phase control TCA 785 Control thyristors, triacs, and transistors. The trigger pulses can be...
Computational Intelligence in Complex Decision Systems G. Oltean
1. Implementation of a
Temperature Control System using
ARDUINO
Computational Intelligence in Complex Decision Systems G. Oltean
Close control loop
Fuzzy controller
Fuzzy logic system: 9 rules
Temperature Sensor
One Wire Digital Temperature Sensor - DS18B20
Heating element
Heating resistor 2Ω, supplied in ac (12V peak value)
Heating power control
Phase control of a SCR (thyristor) – TCA 785
System structure
Computational Intelligence in Complex Decision Systems G. Oltean
Arduino development board
• “Brain” of the entire system
• Read current temperature
• Compute error and change-of-error
• Run fuzzy logic system
• Determine digital value of control signal
DAC - MCP4725, I2C interface
Provide analog value of control signal
Phase control board
Analog amplifier for control voltage – AD820
TCA 785 – phase control IC
System implementation
Computational Intelligence in Complex Decision Systems G. Oltean
Block diagram
Computational Intelligence in Complex Decision Systems G. Oltean
5
Functional diagram u(k) = u(k-1) - duc(k)
Computational Intelligence in Complex Decision Systems G. Oltean
6
ARDUINO UNO development board
Computational Intelligence in Complex Decision Systems G. Oltean
7
Programmable Resolution 1-Wire Digital Temperature Sensor
9-bit to 12-bit Celsius temperature measurements
Unique 1-Wire® Interface Requires Only One Port Pin for
Communication
Allows multiple DS18B20s to function on the same 1-Wire bus
Computational Intelligence in Complex Decision Systems G. Oltean
8
12-Bit Resolution
On-Board Non-Volatile Memory (EEPROM)
External Voltage Reference (VDD)
Rail-to-Rail Output
Single-Supply Operation: 2.7V to 5.5V
I2C Interface
Eight Available Addresses
DAC MCP4725
Computational Intelligence in Complex Decision Systems G. Oltean
9
Phase control TCA 785
Control thyristors, triacs, and transistors.
The trigger pulses can be shifted within a
phase angle between 0 ˚ and 180 ˚
Computational Intelligence in Complex Decision Systems G. Oltean
10
TCA 785
Computational Intelligence in Complex Decision Systems G. Oltean
11
Thermal enclosure Phase control board
Computational Intelligence in Complex Decision Systems G. Oltean
12
16 x 2 LCD
Computational Intelligence in Complex Decision Systems G. Oltean
13
Experimental setup
Computational Intelligence in Complex Decision Systems G. Oltean
14
Experimental setup
Computational Intelligence in Complex Decision Systems G. Oltean
15
Fuzzy logic system
Computational Intelligence in Complex Decision Systems G. Oltean
16
-1 -0.5 0 0.5 10
0.2
0.4
0.6
0.8
1
err; cerr
Neg
Zero
Pos
-1 -0.5 0 0.5 10
0.2
0.4
0.6
0.8
1
du
N
Z
P
Input fuzzy sets
Output fuzzy sets
Computational Intelligence in Complex Decision Systems G. Oltean
Control surface
errFls
cerrFlsNeg Zero Pos
Neg N N Z
Zero N Z P
Pos Z P P
Rule base
1
2
3
4
5
6
7
8
9
Computational Intelligence in Complex Decision Systems G. Oltean
Waveforms
for the
phase
control
circuit
CH3 - the analog control voltage applied at pin 11 of the TCA785 IC, 4.8V
CH2 - the ramp voltage, generated by the TCA785 IC, at pin 10
CH1 - the positive voltage pulse generated by the TCA785 at pin 15, to be applied in the gate of the
SCR to set it on (ch1, yellow); the voltage pulse is generated when the ramp voltage exceeds the
analog control voltage
CH4 - the almost sinusoidal supply voltage, in the secondary of the line transformer; the moment
when the SCR switches on (when the positive pulse appears in its gate) is obvious on the waveform –
the voltage decreases due to the large current ensured through the 2Ω heating resistor
Computational Intelligence in Complex Decision Systems G. Oltean
1
9 Waveforms
for the
power
circuit
CH1 - the supply voltage, in the secondary of the line transformer
CH2 - the voltage drop across the SCR
MATH - the voltage drop across the heating resistor
Computational Intelligence in Complex Decision Systems G. Oltean
20
0 500 1000 1500 2000 250025
30
35
40
45
50
time [s]
tem
pera
ture
[C
]
Tref
T
Experimental results, Tref = 45oC
process perturbation:
opening the thermal enclosure
Computational Intelligence in Complex Decision Systems G. Oltean
21
0 500 1000 1500 2000 250020
40
60
tem
p
0 500 1000 1500 2000 2500-20
0
20
err
0 500 1000 1500 2000 2500-20
0
20
cerr
0 500 1000 1500 2000 2500-1000
0
1000
du
0 500 1000 1500 2000 25000
2000
4000
u
Experimental results, Tref = 45oC
Computational Intelligence in Complex Decision Systems G. Oltean
0 500 1000 1500 2000 250020
40
60te
mp
0 500 1000 1500 2000 2500-1000
0
1000
du
0 500 1000 1500 2000 25000
2000
4000
u
0 500 1000 1500 2000 25000
2
4
con
tr.
vo
ltag
e
Experimental results, Tref = 45oC
Computational Intelligence in Complex Decision Systems G. Oltean
Experimental results, Tref = 37oC
0 100 200 300 400 500 600 700 800 90026
28
30
32
34
36
38
time [s]
tem
pera
ture
[C
]
Tref
T
Computational Intelligence in Complex Decision Systems G. Oltean
Experimental results, Tref = 34oC from 37oC
0 200 400 600 800 1000 120033.5
34
34.5
35
35.5
36
36.5
37
time [s]
tem
pera
ture
[C
]
Tref
T
Computational Intelligence in Complex Decision Systems G. Oltean
0 200 400 600 800 1000 120030
35
40te
mp
0 200 400 600 800 1000 1200-1000
0
1000
du
0 200 400 600 800 1000 12002000
4000
6000
u
0 200 400 600 800 1000 12002
3
4
con
tr.
vo
ltag
e
Experimental results, Tref = 34oC from 37oC
Computational Intelligence in Complex Decision Systems G. Oltean
2.
IMPLEMENTAREA
UNUI SISTEM DE
CONTROL AL TEMPERATURII
UTILIZÂND
MATLAB
Computational Intelligence in Complex Decision Systems G. Oltean
Controler fuzzy
reguli definite de utilizator
fiecărei reguli îi corespunde o mulţime parţială de ieşire
∆e = e(k) - e(k-1)
∑ ieşire+
-∑
Controler fuzzy
Întârziere
∆t
senzor
Element de control
*y e
∆e
cu
y
yye *
Fundamentare teoretică
Computational Intelligence in Complex Decision Systems G. Oltean
Implementare practică
Incinta termică Platforma EEboard
CAN
CNA
Senzor
Execuţie
Prelucrare
analogică pentru
achiziţie
Placa de sunetMATLAB/
Simulink
Prelucrare
analogică pentru
comandă
Flux comandă
Flux achiziţie
Controler
fuzzy
Placă de sunet - limitare
cuplaj capacitiv
valori tensiune: [-1V; +1V]
- amplificare
achiziţie 3:1
comandă 1:1
Schema de principiu
Computational Intelligence in Complex Decision Systems G. Oltean
Incinta termică
Senzor de temperatura LM35
factor de scală liniar +10 mV/°C (ex. 30°C 300mV)
măsurarea temperaturii în intervalul -55°C,+125°C
temperatura citită - diferită cu 0.01 °C de temperatura suprafeţei
precizie 0.5 °C (la +25°C )
tensiune de alimentare - între 4V şi 30V
Rezistenţă termică două rezistenţe ceramice conectate în paralel
Implementare practică
echivR
UP
2
max
Computational Intelligence in Complex Decision Systems G. Oltean
Platforma Electronic Explorer
Flux de achiziţie
Implementare
LM741
+
-
V+
V-
OUT LM555 GND
TRIGGEROUTPUTRESET
CONTROLTHRESHOLDDISCHARGE
VCC
Vee
9
0
Vcc
1k
Vcc
GND
Vcc
1k
2.2u
0
Vcc
-9
0
GND
Vee
Vee
11k
1k
0
LM35
Vcc OUT
GN
D
GND
Vcc
LM741
+
-
V+
V-
OUT
3k
0
Vcc
Vcc
1k
1k
47n
0
Amplificator Av=12 Repetor (buffer)
Senzor de
temperatură
Conversie
cc ca
Computational Intelligence in Complex Decision Systems G. Oltean
Implementare – cont.
Flux de comandă
Detector de vârf pozitivAmplificator
Av = 6.5
Tranzistor
Darlington
Rezistenţa
de încălzire
9
0
Vcc
-9
0
Vee
LM741
+
-V
+
V-
OUT
LM741
+
-
V+
V-
OUT
D
10u 27k
6.8k
Q1
2N2221
22k
Q2
BD237
0
0 0
5.5k
1k
0
+12
0
Vsursa Vcc
Vee
Vee
Vcc
Vsursa
6,822
Computational Intelligence in Complex Decision Systems G. Oltean
Schemă SimulinkImplementare
Computational Intelligence in Complex Decision Systems G. Oltean
Controler fuzzy T-S
Variabile de intrare: e, de
3 mulţimi de tip zmf, gauss, smf
Variabila de ieşire: du
3 mulţimi singleton: Ne = -0.2
Ze = 0
Po = 0.2
Baza de regulie
de
N Z P
N Ne Ne Ze
Z Ne Ze Po
P Ze Po Po
Computational Intelligence in Complex Decision Systems G. Oltean
Exemplu de activare a regulilor
Reguli activate
– 5: Dacă (e este Z) şi (de este Z) atunci (du este Ze)
– 8: Dacă (e este P) şi (de este Z) atunci (du este Po)
Defuzzificare - medie ponderată
85
8855*
zzy
Computational Intelligence in Complex Decision Systems G. Oltean
Rezultate experimentale
Semnalul preluat de la 555
Semnalul preluat de la senzor
Semnalul transmis spre Simulink
Flux de achiziţie
Computational Intelligence in Complex Decision Systems G. Oltean
Semnalul provenit din Simulink
Semnalul de la iesirea detectorului de vârf
Rezultate experimentaleFlux de comandă
Computational Intelligence in Complex Decision Systems G. Oltean
Evoluţia temperaturii incintei:Tref=45°C
Rezultate experimentale
Computational Intelligence in Complex Decision Systems G. Oltean
Rezultate experimentaleEvoluţia semnalelor: Tref = 45°C
Te
cu →
maxcu
cdue → 0
cu
e, cdu
cu, → const.
Computational Intelligence in Complex Decision Systems G. Oltean
Rezultate experimentaleEvoluţia temperaturii incintei:Tref-variabilă
45°C 37°C
Computational Intelligence in Complex Decision Systems G. Oltean
3. Implementation of a Fuzzy
Logic-Based Embedded System for Engine RPM
Control
Computational Intelligence in Complex Decision Systems G. Oltean
Introduction
implements an embedded system for the
Engine RPM control based on a
development board
developed around an Arduino Mega board
fuzzy logic system as controller
offers an easy understanding of the main
concepts regarding embedded systems
Computational Intelligence in Complex Decision Systems G. Oltean
System implementationBlock diagram
Computational Intelligence in Complex Decision Systems G. Oltean
DC-Motor: Gear ratio: 30:1
Free run speed at 6V: 1000RPM
Free run current at 6V: 120mA
Stall current at 6V: 1600mA
Computational Intelligence in Complex Decision Systems G. Oltean
Quadrature Encoder:
• Six pole magnetic disk +PCB
• Dual Channel
• 12 counts/revolution
• 2.8V -18V
Output signal
of the encoder
Computational Intelligence in Complex Decision Systems G. Oltean
Motor Driver:
• L298
• Middle class
• 2 Motors
• Sensors power supply
Computational Intelligence in Complex Decision Systems G. Oltean
ArduinoMega
Pinout LCD screen
Computational Intelligence in Complex Decision Systems G. Oltean
The Arduino Mega board is the “brain” of the entire system. It is primarily
responsible for the update of the digital control signal u, at every time
instance. Therefore, the actual RPM, RPMk is read and the actual RPM error
(errk) and change of RPM error (cerrk) are updated, as follows:
(1)
where is the RPM error in the previous time instance.
The star of the entire system is the fuzzy logic controller, whose role is to
infer the best modification in the control signal, in every time instance . The
operation of the fuzzy logic controller is explained later on. The digital
version of the actual control signal is updated using the relation:
(2)
Computational Intelligence in Complex Decision Systems G. Oltean
Compute RPMTo obtain the actual RPM:
a method based on a fixed time interval (time window) to
count the revolutions of the main motor shaft.
a counter is triggered at the initial time ti and it counts the
pulses received from the Hall effect sensor up to the final
increment tf.
The RPM is computed using the relation :
Cf - final value of the counter
Ci - initial value of the counter
Cr = 12, number of counts/revolution
Gr = 30, the gear ratio (30:1)
tf, ti – are measured in seconds
Computational Intelligence in Complex Decision Systems G. Oltean
The Fuzzy Logic Controller
first-order Takagi-Sugeno
two inputs errFls and cerrFls
one output ΔuFls
Fuzzy sets for the inputs Fuzzy sets for the output
Computational Intelligence in Complex Decision Systems G. Oltean
errFls
cerrFls Neg Zero Pos
Neg N N Z
Zero N Z P
Pos Z P P
Rule base of the
fuzzy logic system
Block diagram of the fuzzy logic controller
Computational Intelligence in Complex Decision Systems G. Oltean
The defuzzification method, used to transform the partial output fuzzy sets resulted from the inference process into a crisp value is the weighted average method.
Computational Intelligence in Complex Decision Systems G. Oltean
Control surface of the fuzzy logic controller
ou
tpu
t
cErr
Err
Computational Intelligence in Complex Decision Systems G. Oltean
Control Circuit
Fuzzy
logic
system cerr + _
+ _
RPM ref
z
1
ΔuFls
- +
z
1
u
RPM
errFls
cerrFls
0
255 -1
+1
-1
+1 su
err se
sc
Δu Motor
Driver
DC
Motor ua
Computational Intelligence in Complex Decision Systems G. Oltean
System setup
Computational Intelligence in Complex Decision Systems G. Oltean
Experimental resultsRPM from 0 to 1000
rise time = 8.8 s;
max. positive error = 5 rpm ;
max. negative error = 5rpm;
RPM from 1000 to 500
fall time = 6.75 s;
max. positive error = 6 rpm ;
max. negative error = 9rpm;
RPM from 500 to 750
rise time = 4.75 s;
max. positive error = 8 rpm ;
max. negative error = 6rpm;
RPM from 750 to 0
fall time = 6.5 s;
Computational Intelligence in Complex Decision Systems G. Oltean
Computational Intelligence in Complex Decision Systems G. Oltean
To drastically decrease the time response of the control system,
the control strategy should be slightly modified.
Because the control characteristic of the DC motor driven by
the H-Bridge is almost liner, when a large variation of the motor
speed is required (larger than 60 rpm), the control signal is not
determined by the fuzzy logic system, but it is estimated by a
simple linear interpolation, that acts as a course adjustment of
the control signal.
Then, the fuzzy logic system regains its role for the fine
adjustment of the speed.
Decreasing the time response
Computational Intelligence in Complex Decision Systems G. Oltean
Computational Intelligence in Complex Decision Systems G. Oltean
Tracking mode operation: RPM tracks the temperature variation
Computational Intelligence in Complex Decision Systems G. Oltean
Duty Cycle
23%
Low Speed
55%
Medium Speed
90%
High Speed
Computational Intelligence in Complex Decision Systems G. Oltean
4.
Controlul
pendulului
inversat
Computational Intelligence in Complex Decision Systems G. Oltean
4. Controlul pendulului inversat –
demonstratie video
pendul.fis
http://www.razorrobotics.com/articles/fuzzy-control-system/
Computational Intelligence in Complex Decision Systems G. Oltean
Computational Intelligence in Complex Decision Systems G. Oltean