Il mini sistema è formato
da:
Funzionamento “estivo”:
si regola la temperatura
di setpoint =SETPOINT e il differenziale totale ∆,
con i due potenziometri
il differenziale di
gradino è:
δ=∆/3
La temperatura minima
associata al differenziale totale è:
t1=setpoint- ∆/2
La temperatura massima
associata al differenziale totale è:
t1=setpoint+ ∆/2
il primo ventilatore entra
in funzione quando la temperatura letta dalla termocoppia è superiore a:
t1=setpoint- δ
/2
il secondo ventilatore
entra in funzione quando la temperatura letta dalla termocoppia è superiore a:
t1=setpoint+ δ /2
il terzo ventilatore entra
in funzione quando la temperatura letta dalla termocoppia è superiore a:
t1=setpoint+ ∆/2
il primo ventilatore si
disattiva quando la temperatura letta dalla termocoppia è inferiore a:
t1=setpoint- 1,5 δ
il secondo ventilatore si
disattiva quando la temperatura letta dalla termocoppia è inferiore a:
t1=setpoint- δ /2
il terzo ventilatore si
disattiva quando la temperatura letta dalla termocoppia è inferiore a :
t1=setpoint+ δ /2
COLLEGAMENTI DELLE PORTE
Nel programma i valori
minimo e Massimo del setpoint sono 25 e 70°C
I valori minimo e Massimo
del differenziale sono 2 e 10°C
Il sistema:
Il
sistema in funzione: i 3 led segnalano l’accensione di tutti e tre i
ventilatori
IL microcontrollore, la
scheda per la termocoppia e quella di comando dei ventilatori e della lampadina

La scheda con la connessione della termocoppia ed il
segnale di uscita
IL LISTATO
' ventilatori in cascata
Const Device = CB280
Dim vett(5) As Byte
Dim n As Integer
Dim sn1 As String
Dim sn2 As String
Dim temp As Single
Dim t1 As Single
Dim t2 As Single
Dim setpoint
As Single
Dim r As Single
Dim numc
As Byte
Dim I As Byte
Dim sp1 As String
Dim s As String
Dim DIFF As Single
Dim delta As Single
Dim PORTA_in As Byte
Dim supc As Integer
Dim r1 As Single
Dim r2 As Single
supc=0
Set Debug On
Debug CLR
'NUMERO ventilatori
numc=3
PORTA_in=10
sp1="ventilatori in
cascata"
scrivist 1,sp1
Out PORTA_in,1
Out PORTA_in+1,0
Out PORTA_in+2,0
Out PORTA_in+3,0
Do
temp=termocoppia_1(3)
'da 20 a 70
setpoint=retta(4,25,70)
' da 2 a 7
DIFF=retta(5,2,10)
delta=DIFF/3
sp1="temp
="
scrivi 3,sp1,temp,2
sp1="setpoint ="
scrivi 4,sp1,setpoint,2
sp1="differenziale totale="
scrivi 5,sp1,DIFF,2
t1=setpoint+delta*15/10
t2=setpoint-delta*15/10
sp1="Tsup
="
scrivi 6,sp1,t1,2
sp1="Tinf
="
scrivi 7,sp1,t2,2
For I=1 To 3
s=Dec I
r1=t2+delta*I
r2=r1-delta
sn1=Fp(r1,4,1)
sn2=Fp(r2,4,1)
sp1="ventilatore="+s+" ON a t=
"+sn1+" OFF a t="+sn2
If temp>r1 Then
sp1=sp1+" =ON "
Out PORTA_in+I,1
vett(I)=1
End If
If temp<r2 Then
sp1=sp1+" =OFF "
Out PORTA_in+I,0
vett(I)=0
End If
scrivist 8+I,sp1
Next
If supc=0 Then Delay 1000
If supc Then seriale
Loop
'seriale
Sub seriale()
Bclr 0,1
Opencom 0,9600,18,9,54
Bclr 1,2
For I=1 To 9
If I=1 Then r=temp*100
If I=2 Then r=setpoint*100
If I=3 Then r=DIFF*100
If I=4 Then r=vett(1)
If I=5 Then r=vett(2)
If I=6 Then r=vett(3)
If I=7 Then r=77777
If I=8 Then r=88888
If I=9 Then r=99999
sp1=Fp(r,5,0)
Putstr 0,sp1
Next
Delay 300
End Sub
'soubroutine
che visualizza alla riga
'il numero=num
Con decimali=decim
's=testo
Sub scrivi(riga As Integer,ss As String,num As Single,decim As Integer)
Debug Goxy,1,riga
Debug ss
Debug Fp(num,10,decim)
Debug Goxy,1,riga
End Sub
'soubroutine
che visualizza alla riga
'il testo=s
Sub scrivist(riga As
Integer,ss As String)
Debug Goxy,1,riga
Debug ss
End Sub
'lettura termocoppia con
amplificatore
Function termocoppia_1(porta As Integer)As
Single
Dim nn As Integer
nn=Adin(porta)
r=732*nn
r=r/10000
r=14+r
termocoppia_1=r
End Function
Function retta(porta
As Integer,min As Single,max
As Single)As Single
Dim nn As Integer
nn=Adin(porta)
r=min+nn*(max-min)/1023
retta=r
End Function

Figura

Figura

Figura

Il programma di visualizzazione sul PC

L’uscita
sul PC