Lời cam đoan . i
Lời cảm ơn . ii
Mục Lục . iii
Danh Mục Hình Vẽ . vii
Danh Sách Các Bảng.x
CHƯƠNG 1
Tổng Quan .1
1.1. Đặt vấn đề .1
1.2. Mục tiêu và giới hạn của đề tài .3
1.3. Phương pháp nghiên cứu.4
1.4. Ứng dụng của đề tài .4
1.5. Nội dung luận văn .4
CHƯƠNG 2
Tổng Quan Về Hệ Thống HVAC.6
2.1. Giới thiệu sơ lược về hệ thống điều hoà không khí .6
2.1.1. Biểu diễn quá trình điều hoà không khí trên đồ thị Carrier .6
2.1.2. Xác định các thông số tính toán trong hệ thống HVAC .8
2.1.2.1. Xác định các thông số trong nhà và ngoài trời .9
i. Thông số tính toán của không khí trong nhà.9
ii. Thông số tính toán của không khí ngoài trời .9
iii. Bảng tóm tắt các thông số nhiệt độ, độ ẩm tính toán.9iv
2.1.2.2. Xác định năng suất của máy điều hòa.10
i. Xác định lượng nhiệt hiện thừa của phòng .10
ii. Xác định lượng nhiệt ẩn tỏa ra của phòng .11
iii. Xác định lượng nhiệt hiện và ẩn do không khí từ ngoài đem vào .11
iv. Xác định lượng không khí qua dàn lạnh và nhiệt độ thổi vào không
gian điều hòa bằng đồ thị Carrier.13
2.2. Giới thiệu sơ đồ HVAC tổng thể .15
2.3. Giới thiệu một số sơ đồ HVAC thông dụng tại Việt Nam.16
2.3.1. Sơ đồ điều chỉnh lưu lượng không khí cấp vào không gian điều hòa.16
2.3.2. Sơ đồ điều chỉnh lượng không khí hồi đi vòng và lượng không khí vào
trước dàn lạnh.17
2.3.3. Sơ đồ điều chỉnh năng suất lạnh .18
2.4. Kết luận .19
CHƯƠNG 3
Mô Hình Hóa Hệ Thống HVAC .20
3.1. Phân tích sơ đồ điều chỉnh năng suất lạnh .20
3.2. Mô hình toán học của không gian điều hòa và các phần tử trong hệ thống
HVAC .22
3.2.1. Mô hình toán học của không gian điều hòa .22
3.2.2. Mô hình toán học của các phần tử trong hệ thống HVAC.24
3.2.2.1. Mô hình toán học của dàn lạnh .24
3.2.2.2. Mô hình toán học của các loại cảm biến.26
3.2.2.3. Mô hình toán học của nhiệt điện trở .27
3.3. Mô hình toán học của hệ thống HVAC.27v
3.3.1. Khái quát .27
3.3.2. Quá trình gia ẩm – làm lạnh.29
3.3.3. Quá trình tách ẩm – gia nhiệt .30
3.4. Kết quả mô phỏng các mô hình toán học.32
3.4.1. Các thông số cơ sở cho quá trình mô phỏng.32
3.4.2. Kết quả mô phỏng không gian điều hòa .34
3.4.3. Kết quả mô phỏng dàn lạnh .36
3.4.4. Kết quả mô phỏng điện trở.37
3.4.5. Kết quả mô phỏng hệ thống HVAC.37
CHƯƠNG 4
Thiết Kế Và Mô Phỏng Bộ Điều Khiển.42
4.1. Giải thuật điều khiển .42
4.2. Xây dựng bộ điều khiển và kết quả mô phỏng .43
4.2.1. Xây dựng bộ điều khiển .43
4.2.2. Kết quả mô phỏng .45
CHƯƠNG 5
Kết Quả Thực Nghiệm.50
5.1. Mô tả phần cứng của hệ thống HVAC.50
5.1.1. Phần cơ khí.50
5.1.2. Phần mạch điện - điện tử.52
5.1.3. Phần thu thập dữ liệu thông qua card PCI-1711U .55
5.2. Thu thập và xử lý tín hiệu .56
5.2.1. Tín hiệu nhiệt độ .56vi
5.2.2. Tín hiệu độ ẩm .58
5.2.3. Kết nối vào – ra của mô hình thực nghiệm.59
5.3. Kết quả thực nghiệm .61
CHƯƠNG 6
Kết Luận Và Hướng Phát Triển Của Đề Tài .64
6.1. Kết luận .64
6.1.1. Các kết quả đã đạt được của đề tài.64
6.1.2. Hạn chế.64
6.2. Hướng phát triển của đề tài.65
TÀI LIỆU THAM KHẢO .66
PHỤ LỤC.67
Phụ lục A: code Matlab “xác định mô hình toán học của không gian điều hòa” .67
Phụ lục B: code Matlab “xác định mô hình toán học của điện trở”.74
Phụ lục C: code Matlab “xác định thông số vật lý của không khí” .81
Phụ lục D: code Matlab “mô phỏng nhiệt độ của hệ thống HVAC” .84
Phụ lục E: code Matlab “mô phỏng độ ẩm của hệ thống HVAC”.104
Phụ lục F: ma trận khuyếch đại tương đối .124
Phụ lục G: phương pháp IMC (Internal Mode Control) .126
Phụ lục H: code Matlab “chương trình Matlab GUI” .129
Phụ lục I: chương trình C điều khiển van nước lạnh bằng PIC .149
Phụ lục J: chuyển đổi nhiệt độ sang
                
              
                                            
                                
            
 
            
                 165 trang
165 trang | 
Chia sẻ: trungkhoi17 | Lượt xem: 788 | Lượt tải: 2 
              
            Bạn đang xem trước 20 trang tài liệu Luận văn Điều khiển đa biến hệ thống HVAC, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
ls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
Phụ Lục C 81 
Phụ lục C: code Matlab “xác định thông số vật lý của không khí” 
function varargout = th2id(varargin) 
% TH2ID M-file for th2id.fig 
% TH2ID, by itself, creates a new TH2ID or raises the existing 
% singleton*. 
% 
% H = TH2ID returns the handle to a new TH2ID or the handle to 
% the existing singleton*. 
% 
% TH2ID('CALLBACK',hObject,eventData,handles,...) calls the local 
% function named CALLBACK in TH2ID.M with the given input arguments. 
% 
% TH2ID('Property','Value',...) creates a new TH2ID or raises the 
% existing singleton*. Starting from the left, property value pairs 
are 
% applied to the GUI before th2id_OpeningFunction gets called. An 
% unrecognized property name or invalid value makes property 
application 
% stop. All inputs are passed to th2id_OpeningFcn via varargin. 
% 
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only 
one 
% instance to run (singleton)". 
% 
% See also: GUIDE, GUIDATA, GUIHANDLES 
% Edit the above text to modify the response to help th2id 
% Last Modified by GUIDE v2.5 26-Mar-2012 11:17:42 
% Begin initialization code - DO NOT EDIT 
gui_Singleton = 1; 
gui_State = struct('gui_Name', mfilename, ... 
 'gui_Singleton', gui_Singleton, ... 
 'gui_OpeningFcn', @th2id_OpeningFcn, ... 
 'gui_OutputFcn', @th2id_OutputFcn, ... 
 'gui_LayoutFcn', [] , ... 
 'gui_Callback', []); 
if nargin && ischar(varargin{1}) 
 gui_State.gui_Callback = str2func(varargin{1}); 
end 
if nargout 
 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 
else 
 gui_mainfcn(gui_State, varargin{:}); 
end 
% End initialization code - DO NOT EDIT 
% --- Executes just before th2id is made visible. 
function th2id_OpeningFcn(hObject, eventdata, handles, varargin) 
% This function has no output args, see OutputFcn. 
% hObject handle to figure 
Phụ Lục C 82 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
% varargin command line arguments to th2id (see VARARGIN) 
% Choose default command line output for th2id 
handles.output = hObject; 
% Update handles structure 
guidata(hObject, handles); 
% UIWAIT makes th2id wait for user response (see UIRESUME) 
% uiwait(handles.figure1); 
% --- Outputs from this function are returned to the command line. 
function varargout = th2id_OutputFcn(hObject, eventdata, handles) 
% varargout cell array for returning output args (see VARARGOUT); 
% hObject handle to figure 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
% Get default command line output from handles structure 
varargout{1} = handles.output; 
function t_edit_Callback(hObject, eventdata, handles) 
% hObject handle to t_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of t_edit as text 
% str2double(get(hObject,'String')) returns contents of t_edit as 
a double 
% --- Executes during object creation, after setting all properties. 
function t_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to t_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
Phụ Lục C 83 
function phi_edit_Callback(hObject, eventdata, handles) 
% hObject handle to phi_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of phi_edit as text 
% str2double(get(hObject,'String')) returns contents of phi_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function phi_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to phi_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
% --- Executes on button press in caculate_pushbutton. 
function caculate_pushbutton_Callback(hObject, eventdata, handles) 
draft_a=get(handles.t_edit,'String'); 
draft_b=get(handles.phi_edit,'String'); 
[p,vl,vh,ro_h,il,r,ih,sl,sh]=Bang_nuoc_hn_bao_hoa_theo_t(str2num(draft_a)
); 
[h,gr]=Thongso_KKA_biet_t_phi(str2num(draft_a),str2num(draft_b)); 
set(handles.h_ans_text,'String',h); 
guidata(hObject, handles); 
set(handles.gr_ans_text,'String',gr); 
guidata(hObject, handles); 
% hObject handle to caculate_pushbutton (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
Phụ Lục D 84 
Phụ lục D: code Matlab “mô phỏng nhiệt độ của hệ thống HVAC” 
function varargout = Temp_control(varargin) 
% TEMP_CONTROL M-file for Temp_control.fig 
% TEMP_CONTROL, by itself, creates a new TEMP_CONTROL or raises the 
existing 
% singleton*. 
% 
% H = TEMP_CONTROL returns the handle to a new TEMP_CONTROL or the 
handle to 
% the existing singleton*. 
% 
% TEMP_CONTROL('CALLBACK',hObject,eventData,handles,...) calls the 
local 
% function named CALLBACK in TEMP_CONTROL.M with the given input 
arguments. 
% 
% TEMP_CONTROL('Property','Value',...) creates a new TEMP_CONTROL or 
raises the 
% existing singleton*. Starting from the left, property value pairs 
are 
% applied to the GUI before Temp_control_OpeningFcn gets called. An 
% unrecognized property name or invalid value makes property 
application 
% stop. All inputs are passed to Temp_control_OpeningFcn via 
varargin. 
% 
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only 
one 
% instance to run (singleton)". 
% 
% See also: GUIDE, GUIDATA, GUIHANDLES 
% Edit the above tau_H_text to modify the response to help Temp_control 
% Last Modified by GUIDE v2.5 14-May-2007 15:36:15 
% Begin initialization code - DO NOT EDIT 
gui_Singleton = 1; 
gui_State = struct('gui_Name', mfilename, ... 
 'gui_Singleton', gui_Singleton, ... 
 'gui_OpeningFcn', @Temp_control_OpeningFcn, ... 
 'gui_OutputFcn', @Temp_control_OutputFcn, ... 
 'gui_LayoutFcn', [] , ... 
 'gui_Callback', []); 
if nargin && ischar(varargin{1}) 
 gui_State.gui_Callback = str2func(varargin{1}); 
end 
if nargout 
 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 
else 
 gui_mainfcn(gui_State, varargin{:}); 
end 
% End initialization code - DO NOT EDIT 
Phụ Lục D 85 
% --- Executes just before Temp_control is made visible. 
function Temp_control_OpeningFcn(hObject, eventdata, handles, varargin) 
% This function has no output args, see OutputFcn. 
% hObject handle to figure 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
% varargin command line arguments to Temp_control (see VARARGIN) 
% Choose default command line output for Temp_control 
handles.output = hObject; 
% Update handles structure 
guidata(hObject, handles); 
% UIWAIT makes Temp_control wait for user response (see UIRESUME) 
% uiwait(handles.figure1); 
% --- Outputs from this function are returned to the command line. 
function varargout = Temp_control_OutputFcn(hObject, eventdata, handles) 
% varargout cell array for returning output args (see VARARGOUT); 
% hObject handle to figure 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
% Get default command line output from handles structure 
varargout{1} = handles.output; 
function V_r_edit_Callback(hObject, eventdata, handles) 
% hObject handle to V_r_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of V_r_edit as tau_H_text 
% str2double(get(hObject,'String')) returns contents of V_r_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function V_r_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to V_r_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
Phụ Lục D 86 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function AU_i_edit_Callback(hObject, eventdata, handles) 
% hObject handle to AU_i_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of AU_i_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of AU_i_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function AU_i_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to AU_i_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function Temp_edit_Callback(hObject, eventdata, handles) 
% hObject handle to Temp_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of Temp_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of Temp_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function Temp_edit_CreateFcn(hObject, eventdata, handles) 
Phụ Lục D 87 
% hObject handle to Temp_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function Humidity_edit_Callback(hObject, eventdata, handles) 
% hObject handle to Humidity_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of Humidity_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of 
Humidity_edit as a double 
% --- Executes during object creation, after setting all properties. 
function Humidity_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to Humidity_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function rate_edit_Callback(hObject, eventdata, handles) 
% hObject handle to rate_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of rate_edit as 
tau_H_text 
Phụ Lục D 88 
% str2double(get(hObject,'String')) returns contents of rate_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function rate_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to rate_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function v_a_edit_Callback(hObject, eventdata, handles) 
% hObject handle to v_a_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of v_a_edit as tau_H_text 
% str2double(get(hObject,'String')) returns contents of v_a_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function v_a_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to v_a_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function theta_wi_edit_Callback(hObject, eventdata, handles) 
% hObject handle to theta_wi_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
Phụ Lục D 89 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of theta_wi_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of 
theta_wi_edit as a double 
% --- Executes during object creation, after setting all properties. 
function theta_wi_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to theta_wi_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function Q_h2O_edit_Callback(hObject, eventdata, handles) 
% hObject handle to Q_h2O_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of Q_h2O_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of Q_h2O_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function Q_h2O_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to Q_h2O_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
Phụ Lục D 90 
function tau_H_edit_Callback(hObject, eventdata, handles) 
% hObject handle to tau_H_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of tau_H_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of tau_H_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function tau_H_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to tau_H_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function tau_T_edit_Callback(hObject, eventdata, handles) 
% hObject handle to tau_T_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of tau_T_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of tau_T_edit 
as a double 
% --- Executes during object creation, after setting all properties. 
function tau_T_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to tau_T_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
Phụ Lục D 91 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function Power_res_edit_Callback(hObject, eventdata, handles) 
% hObject handle to Power_res_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of Power_res_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of 
Power_res_edit as a double 
% --- Executes during object creation, after setting all properties. 
function Power_res_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to Power_res_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
function tau_V_edit_Callback(hObject, eventdata, handles) 
% hObject handle to tau_V_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
input = str2num(get(hObject,'String')); 
if (isempty(input)) 
 set(hObject,'String','0') 
end 
guidata(hObject, handles); 
% Hints: get(hObject,'String') returns contents of tau_V_edit as 
tau_H_text 
% str2double(get(hObject,'String')) returns contents of tau_V_edit 
as a double 
Phụ Lục D 92 
% --- Executes during object creation, after setting all properties. 
function tau_V_edit_CreateFcn(hObject, eventdata, handles) 
% hObject handle to tau_V_edit (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles empty - handles not created until after all CreateFcns 
called 
% Hint: edit controls usually have a white background on Windows. 
% See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), 
get(0,'defaultUicontrolBackgroundColor')) 
 set(hObject,'BackgroundColor','white'); 
end 
% --- Executes on button press in Temp_pushbutton. 
function Temp_pushbutton_Callback(hObject, eventdata, handles) 
clc 
%thong so PID chuan la P=0.0001, I=0.00001, D=0.00001 
% hObject handle to Temp_pushbutton (see GCBO) 
% eventdata reserved - to be defined in a future version of MATLAB 
% handles structure with handles and user data (see GUIDATA) 
%%%-------Thong so tu giao dien 
drafta=get(handles.V_r_edit,'String'); 
draftb=get(handles.AU_i_edit,'String'); 
draftc=get(handles.Temp_edit,'String'); 
draft_T=str2num(draftc); 
assignin('base','draft_T',draft_T); 
draftd=get(handles.Humidity_edit,'String'); 
draft_H=str2num(draftd); 
assignin('base','draft_H',draft_H); 
drafte=get(handles.rate_edit,'String'); 
draftf=get(handles.v_a_edit,'String'); 
draftg=get(handles.theta_wi_edit,'String'); 
drafth=get(handles.Q_h2O_edit,'String'); 
drafti=get(handles.tau_H_edit,'String'); 
tau_H=str2num(drafti)*60; 
assignin('base','tau_H',tau_H); 
draftj=get(handles.tau_T_edit,'String'); 
tau_T=str2num(draftj)*60; 
assignin('base','tau_T',tau_T); 
draftk=get(handles.Power_res_edit,'String'); 
draftl=get(handles.tau_V_edit,'String'); 
tau_Valve=str2num(draftl)*60; 
assignin('base','tau_Valve',tau_Valve); 
%%draftm=get(handles.D_h_edit,'String'); 
D_h=0; 
assignin('base','D_h',D_h); 
%%draftn=get(handles.D_temp_edit,'String'); 
D_temp=0; 
assignin('base','D_temp',D_temp); 
%%drafto=get(handles.I_h_edit,'String'); 
I_h=0; 
assignin('base','I_h',I_h); 
%%draftp=get(handles.I_temp_edit,'String'); 
I_temp=0; 
assignin('base','I_temp',I_temp); 
Phụ Lục D 93 
%%draftq=get(handles.P_h_edit,'String'); 
P_h=1; 
assignin('base','P_h',P_h); 
%%draftr=get(handles.P_temp_edit,'String'); 
P_temp=1; 
assignin('base','P_temp',P_temp); 
%%%--------Thong so ly thuyet 
rho_a=1.2; %density of air 
n_v=6; %so lan trao doi gio 
c_pa=1.025; %specific heat capacity of air 
S_duct=0.04; % dien tich ong gio 
V_res=220; %dien ap dinh muc cua resistor 
t_N=30;% Nhiet do ngoai nha 
phi_N=80;% Do am ngoai nha 
phi_kk2=95; %Do am tai diem dong suong 
S1=.02; % Buoc ngang ong, m 
S2=.02; % Buoc doc ong, m 
dng=.0127; % Duong kinh ngoai cua ong 
Sc=.0025; %Buoc canh, m 
delta_c=.0003; % Be day canh, m 
dtr=.01092;% Duong kinh trong cua ong 
S1=.02; % Buoc ngang ong, m 
n1=6; % so ong tren 1 hang ong 
Vk=1.5*(.2*.2);% Luu luong khong khi, m3/s 
n=3; % so hang ong 
n2=n1*n; % so ong 
c_pw=4.2; % density of water 
%%%--------Room modeling 
Q_air=str2num(draftf)*S_duct; %m3/s 
m_a=Q_air*rho_a; %air mass flow rate, kg/s 
damper=(str2num(drafta)*n_v/(Q_air*3600))*100; %do mo cua damper gio 
tuoi 
K_r=1/[str2num(draftb)+(n_v*str2num(drafta)/3)]; %room temperature gain 
tau_r=[str2num(drafta)*rho_a*c_pa]/[str2num(draftb)+(n_v*str2num(drafta))
/3]; %room temperature time constant(second) 
assignin('base','tau_r',tau_r); 
%%%--------Resistor modeling 
P_res=str2num(draftk)*3600; 
K_res=K_r*P_res; %resistor gain 
assignin('base','K_res',K_res); 
tau_res=[str2num(drafta)*rho_a*c_pa]/[str2num(draftb)+(n_v*str2num(drafta
))/3]; %r
            Các file đính kèm theo tài liệu này:
 luan_van_dieu_khien_da_bien_he_thong_hvac.pdf luan_van_dieu_khien_da_bien_he_thong_hvac.pdf