Download - Termorregulación 20 de octubre de 2009
![Page 1: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/1.jpg)
Termorregulación
20 de octubre de 2009
http://en.wikipedia.org/wiki/PID_controller
http://www.mne.psu.edu/sommer/me445/ntcnotes.pdf
http://www.ferrotec.com/technology/thermoelectric/
http://www.engin.umich.edu/group/ctm/PID/PID.html
http://einstein.ciencias.uchile.cl
![Page 2: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/2.jpg)
Potencia del calefactor, watt.
Temperatura del café, K.
cafecalefactorpiezacafecafe TTTTdt
dTcafeCp , watt
calefactorpiezacalefactorcalefactor UTTdt
dTcalefactorCp , watt
Tiempo
El nivel basal del trazo de la temperatura es la temperatura de la pieza. El de la potenciales cero.
![Page 3: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/3.jpg)
Tasa más llena Pieza más fría
Potencia del calefactor, watt.
Temperatura del café, K.
cafecalefactorpiezacafecafe TTTTdt
dTCp watt
Tiempo
![Page 4: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/4.jpg)
-Vcontrol Vout
Sistema de control con realimentación negativa
VVAVoutRVV
RVV outcontrol
outcontrol VVVV
outcontrol VVV 2
20 outcontrol
out
VVAV
outcontrolout VVAV 2
controlout AVAV 2
controlout VAA
V2
outcontrol VV
2A si outcontrol VV
![Page 5: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/5.jpg)
2 V -20 V 2 V-2 V
Handout.pdf
Potencia = watt= iV= V2R-1
= i2RPotenciatemperatura
![Page 6: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/6.jpg)
2 volt
-TsetT
-(T-Tset) = -Error P Error
5%
¿Potencia negativa? Elemento de efecto Peltier.http://www.ferrotec.com/technology/thermoelectric/
Potenciatemperatura
Traduzco la temperatura en un voltaje usando un termistor.
Traduzco el voltaje en potencia usando un elemento Peltier.
![Page 7: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/7.jpg)
Elemento de efecto Peltier.http://www.ferrotec.com/technology/thermoelectric/
Si invierto el sentido de la corriente invierto el sentido del transporte de calor.
Elemento Termo Eléctrico, TE, ( efecto Peltier ).
![Page 8: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/8.jpg)
Elemento de efecto Peltier.http://www.ferrotec.com/technology/thermoelectric/
![Page 9: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/9.jpg)
![Page 10: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/10.jpg)
2 volt
-TsetT
-(T-Tset) = -Error P Error
5%
![Page 11: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/11.jpg)
2 volt
-TsetT
-(T-Tset) = -Error P Error
10%
![Page 12: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/12.jpg)
2 volt
-TsetT
-(T-Tset) = -Error P Error
20%
![Page 13: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/13.jpg)
2 volt
-TsetT
-(T-Tset) = -Error P Error
30%
![Page 14: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/14.jpg)
2 volt
-TsetT
-(T-Tset) = -Error P Error
50%
![Page 15: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/15.jpg)
http://en.wikipedia.org/wiki/PID_controller
Controlador Proporcional Integral Diferencial, PID.
![Page 16: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/16.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
0%
2 volt
![Page 17: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/17.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
10%
2 volt
![Page 18: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/18.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
30%
2 volt
![Page 19: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/19.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
75%
2 volt
![Page 20: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/20.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
100%
2 volt
![Page 21: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/21.jpg)
-(T-Tset) = -Error
P Error
ErrorI2
30%
100%
2 volt
![Page 22: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/22.jpg)
http://en.wikipedia.org/wiki/PID_controller
Controlador Proporcional Integral Diferencial, PID.
![Page 23: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/23.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
75%
dtdError
D
0%
2 volt
![Page 24: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/24.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
75%
dtdError
D
20%
2 volt
![Page 25: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/25.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
75%
dtdError
D
45%
2 volt
![Page 26: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/26.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
75%
dtdError
D
75%
2 volt
![Page 27: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/27.jpg)
-(T-Tset) = -Error
P Error
ErrorI
30%
75%
dtdError
D
45%
2 volt
![Page 28: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/28.jpg)
Fuente de poder
Arduinomicrocontrolador
Termistor
Potenciómetro
LCDSwitch
Demodulador
Amplificadorde potencia
Termocontrolador
Serial port
![Page 29: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/29.jpg)
Entrada 220 volt
1.5 A
220 VACfase
220 neutro
Tierra
16 VAC 8A
16 VAC 8A
16 VAC 500 mA
16 VAC 500 mA
GND
GND
![Page 30: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/30.jpg)
Fuente de poder no regulada
2pico
rms
VV
2rmspico VV
1 2
20V
200 ms
3
Resistencia de carga de 1 ohm
![Page 31: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/31.jpg)
Fuente de poder regulada
16 VAC
16 VAC
GND
7815
7809
7915
+15 V
+9 V
-15 V
GND
![Page 32: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/32.jpg)
Steinhart–Hart equationT is the temperature (in Kelvin) R is the resistance at T (in Ohms) A, B, and C are the Steinhart-Hart coefficients
Temperatura, grados Celsius
Res
iste
ncia
R2,
ohm V
oltaje, volt
3lnln1
RcRbaT
2.3 V
![Page 33: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/33.jpg)
Amplificador del thermistor
Termistor
5 V
1.7-4.1V 0.1-4.9V
Al ADC
3.4-8.2V -(3.4-8.2V)
3.32 inout VV
7.46. outV
![Page 34: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/34.jpg)
Salida del ADC
Tem
pera
tura
, gr
ados
Cel
sius
y = temperatura en 0Cx = Salida del ADC / 1000
DAC_cuentas = analogRead(thermistor); temperatura = cuentas_A_grados(DAC_cuentas);
Analog in pin 2
![Page 35: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/35.jpg)
float cuentas_A_grados(int count){ double a = 51.191000000; //Parametros para V del thermistor de 10k double b= -0.0585000000; // unido a un resistencia de 7 kohm a +5 volt double c = 0.0000300000; // multiplicado por 2 double d =-0.0000000200; // menos 3.3 volt. double mil = 1000.0000; double dcount; double dcountN; double dresult; double dresult1;double dresult2; double dresult3;
float resultado; dcount =(double) count; dcount = dcount/mil; dresult1 = b*dcount; dcountN = dcount *dcount; dresult2 = dcountN*c; dcountN = dcountN *dcount; dresult3 = dcountN*d; dresult = a + dresult1 + dresult2 + dresult3; resultado = (float) dresult; return resultado;}
Analog in pin 2
![Page 36: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/36.jpg)
10% 2V
20 ms2V
1 ms
Demodulación de las salidas análogas ( PWM @ 500 Hz)
analogWrite(5,128);
analogWrite(5,26);
analogWrite(5,230);
![Page 37: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/37.jpg)
PWM demodulator
PWM channel 5
PWM channel 6
2V
20 ms
analogWrite(5,128);analogWrite(6,0);
analogWrite(5,0);analogWrite(6,128);
![Page 38: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/38.jpg)
Amplificador de poder+22V+15V
-15V -22V
InputOutput
DBX33
DBX34
70%
70%
+/- 2 A+/- 6V sobre 3 ohm
Input
Out
put
Existen amplificadores operacionales de potencia, por ejemplo LM657http://www.national.com/mpf/LM/LM675.html
![Page 39: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/39.jpg)
#include <LCD4Bit.h>#include <stdlib.h>#define thermistor 2#define potentiometer 3#define calentar 5#define enfriar 6
LCD4Bit lcd = LCD4Bit(2);// select the I/O pin for Digital Dispay
char S1[4]; // String S1 para itoachar S2[16] = " Funcion ";int funcion = 0;float temperatura = 25;float tempset = 25 ;long t;float KP=25; float KI=25; float KD = 5;float lasterror=0; float integral=0; float diferencial = 0;
![Page 40: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/40.jpg)
void setup() { lcd.init(); lcd.clear(); lcd.cursorTo(1,0); lcd.printIn("Hola!"); Serial.begin(1200); Serial.println("Termostat"); lcd.clear(); pinMode(3,INPUT); lcd.cursorTo(2,0); lcd.printIn(S2); lcd.printIn(itoa(funcion,S1,10)); analogWrite(enfriar,0); analogWrite(calentar,0); delay(1000);}
![Page 41: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/41.jpg)
void loop() { int DAC_cuentas; while (digitalRead(3)==LOW) { analogWrite(enfriar,0); analogWrite(calentar,0); funcion = funcion + 1; if (funcion >= 6 ) funcion = 0; lcd.cursorTo(2,0); lcd.printIn(S2); lcd.printIn(itoa(funcion,S1,10)); delay (1000); } switch (funcion) {
Digital pin 3
Digital pin 3
![Page 42: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/42.jpg)
case 0: { lcd.cursorTo(0,5); lcd.printIn(" "); while (digitalRead(3)==HIGH) { DAC_cuentas = analogRead(thermistor); temperatura = cuentas_A_grados(DAC_cuentas); display_float(temperatura,1,0); delay(1000); } break; }
Digital pin 3
Case 0 Mide la temperatura
![Page 43: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/43.jpg)
float cuentas_A_grados(int count){ double a = 51.191000000; //Parametros para V del thermistor de 10k double b= -0.0585000000; // unido a un resistencia de 7 kohm a +5 volt double c = 0.0000300000; // multiplicado por 2 double d =-0.0000000200; // menos 3.3 volt. double mil = 1000.0000; double dcount; double dcountN; double dresult; double dresult1;double dresult2; double dresult3;
float resultado; dcount =(double) count; dcount = dcount/mil; dresult1 = b*dcount; dcountN = dcount *dcount; dresult2 = dcountN*c; dcountN = dcountN *dcount; dresult3 = dcountN*d; dresult = a + dresult1 + dresult2 + dresult3; resultado = (float) dresult; return resultado;}
Analog in pin 2
![Page 44: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/44.jpg)
void display_float(float datum, int fila, int columna){ int enteros; int decimas; int i; i = (int) 10*datum ; //Cast operator enteros= i/10; decimas = i% 10; lcd.cursorTo(fila,0+columna); if (enteros<10) lcd.printIn(" "); lcd.printIn(itoa(enteros,S1,10)); lcd.cursorTo(fila,2+columna); lcd.printIn("."); lcd.cursorTo(fila,3+columna); lcd.printIn(itoa(decimas,S1,10)); Serial.print(enteros); Serial.print("."); Serial.print(decimas); Serial.print(" "); }
![Page 45: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/45.jpg)
case 1: { while (digitalRead(3)==HIGH) { tempset = omni(tempset); if (tempset <= 5.0) tempset = 5.0; if (tempset >= 50.0) tempset = 50.0; display_float(tempset,1,5); delay(100); } break; }
Digital pin 3
Case 1 Determina la temperatura a regular
![Page 46: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/46.jpg)
float omni(float parameter) { int i; int j; i = analogRead(potentiometer); delay(50); j = analogRead(potentiometer); if (j > i+1) parameter = parameter -1; if (j < i-1) parameter = parameter +1; if (parameter > 100) parameter = 100; if (parameter < 0) parameter = 0; return (parameter); }
5Kohm Analog in pin 3
![Page 47: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/47.jpg)
case 2: { integral = 0.0; while (digitalRead(3)==HIGH) { DAC_cuentas = analogRead(thermistor); temperatura = cuentas_A_grados(DAC_cuentas); display_float(temperatura,1,0); display_float(tempset,1,5); controla(temperatura,tempset,KP,KI,KD); t = t +1; Serial.print(t); display_float(temperatura,1,0); display_float(tempset,1,5); delay(1000); } break; }
Digital pin 3
Case 1 Controla la temperatura
![Page 48: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/48.jpg)
void controla(float Tmedida, float Tset, float Kp, float Ki, float Kd) { float error; int potencia; error =(Tmedida - Tset); integral = (integral + error)/10; if ( integral >1000) integral = 1000; if ( integral <-1000) integral = -1000; diferencial = 10*(error-lasterror); lasterror = error; potencia =(int) Kp*error + Ki*integral + Kd*diferencial; sacawatts(potencia); }
![Page 49: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/49.jpg)
void sacawatts( int watts) { int signo; int maxwatts = 255; signo = watts; if (watts <0) watts = -watts; if (watts > maxwatts) watts = maxwatts; lcd.cursorTo(2,1); if (watts <= 100) lcd.printIn(" "); if (watts <= 10) lcd.printIn(" "); lcd.printIn(itoa(watts,S1,10)); lcd.printIn(" "); lcd.cursorTo(2,0); if(signo > 0) { analogWrite(enfriar,watts); analogWrite(calentar,0); lcd.printIn("-"); } else { analogWrite(enfriar,0); analogWrite(calentar,watts); lcd.printIn("+"); } }
![Page 50: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/50.jpg)
case 3: { while (digitalRead(3)==HIGH) { lcd.cursorTo(2,0); lcd.printIn("KP = "); lcd.printIn(itoa(KP,S1,10)); lcd.printIn(" "); KP = omni(KP); delay(100); } break; }
Digital pin 3
Case 3 Define KP
![Page 51: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/51.jpg)
case 4: { while (digitalRead(3)==HIGH) { lcd.cursorTo(2,0); lcd.printIn("KI = "); lcd.printIn(itoa(KI,S1,10)); lcd.printIn(" "); KI = omni(KI); delay(100); } break; }
Digital pin 3
Case 4 Define KI
![Page 52: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/52.jpg)
case 5: { while (digitalRead(3)==HIGH) { lcd.cursorTo(2,0); lcd.printIn("KD = "); lcd.printIn(itoa(KD,S1,10)); lcd.printIn(" "); KD= omni(KD); delay(100); } break; } }
Digital pin 3
Case 3 Define KD
![Page 53: Termorregulación 20 de octubre de 2009](https://reader035.vdocuments.pub/reader035/viewer/2022081502/5665b4911a28abb57c9240a0/html5/thumbnails/53.jpg)
Tem
pera
tura
, gr
ados
Cel
sius
Tiempo, segundos
Prueba del sistema
Set point Temperatura controlada Temperatura de la pieza