1. Trang chủ
  2. » Luận Văn - Báo Cáo

kl le van duc thien 2015 621 31

92 3 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA ĐIỆN – ĐIỆN TỬ ĐỒ ÁN TỐT NGHIỆP GIÁM SÁT VÀ ĐIỀU KHIỂN MƠ HÌNH LỊ SẤY NƠNG SẢN Người hướng dẫn : TS VÕ HỒNG DUY TS TRẦN TRỌNG ĐẠO Người thực : LÊ VĂN ĐỨC THIỆN Lớp : 10040003 Khoá : 14 ĐH THÀNH PHỐ HỒ CHÍ MINH, NĂM 2015 NHẬN XÉT CỦA GIẢNG VIÊN HƯỚNG DẪN TP Hồ Chí Minh, ngày… tháng….năm 2015 Giảng viên hướng dẫn NHẬN XÉT CỦA GIẢNG VIÊN PHẢN BIỆN TP Hồ Chí Minh, ngày… tháng……năm 2015 Giảng viên phản biện LỜI CẢM ƠN Trước hết em xin gửi lời cảm ơn tới quý thầy cô Khoa Điện - Điện Tử thuộc trường ĐẠI HỌC TÔN ĐỨC THẮNG nói chung thầy thuộc Bộ mơn Tự Động - Điều Khiển nói riêng tận tình giảng dạy, truyền đạt cho chúng em kiến thức, kinh nghiệm quý báu suốt thời gian học tập trường Đặc biệt em xin gửi lời cảm ơn chân thành đến Thầy Võ Hoàng Duy Thầy Trần Trọng Đạo Các Thầy tận tình giúp đỡ, hướng dẫn em suốt trình làm Đồ Án Tốt Nghiệp Xin gửi lời cảm ơn tới bạn lớp Điện-Điện tử Khóa 14 học tập, trao dồi kiến thức suốt năm tháng học tập trường Với số lượng kiến thức tích góp qua mơn học, buổi thực hành, thí nghiệm trường học hỏi kinh nghiệm từ mơi trường thực tế bên ngồi, từ bạn bè giúp em vững vàng bổ sung kiến thức cho thân để phục vụ công việc sau Sau cùng, lần em xin kính chúc quý thầy cô khoa Điện – Điện tử thầy hiệu trưởng thật dồi sức khỏe, an vui sống tiếp tục sứ mệnh cao đẹp người thầy truyền đạt kiến thức cho hệ mai sau TP Hồ Chí Minh, ngày 18 tháng năm 2015 Sinh viên thực Lê Văn Đức Thiện CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG Tơi xin cam đoan cơng trình nghiên cứu riêng tơi hướng dẫn khoa học Thầy TS Võ Hoàng Duy TS Trần Trọng Đạo Các nội dung nghiên cứu, kết đề tài trung thực chưa cơng bố hình thức trước Những số liệu bảng biểu phục vụ cho việc phân tích, nhận xét, đánh giá tác giả thu thập từ nguồn khác có ghi rõ phần tài liệu tham khảo Ngoài ra, luận văn sử dụng số nhận xét, đánh số liệu tác giả khác, quan tổ chức khác có trích dẫn thích nguồn gốc Nếu phát có gian lận tơi xin hồn tồn chịu trách nhiệm nội dung luận văn Trường đại học Tôn Đức Thắng không liên quan đến vi phạm tác quyền, quyền gây q trình thực (nếu có) TP Hồ Chí Minh, ngày 18 tháng năm 2015 Người thực Lê Văn Đức Thiện (Trang dùng để đính kèm Nhiệm vụ Đồ án tốt nghiệp có chữ ký Giảng viên hướng dẫn) TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA ĐIỆN –ĐIỆN TỬ - CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM Độc lập – Tự – Hạnh phúc LỊCH TRÌNH LÀM ĐỒ ÁN TỐT NGHIỆP Họ tên sinh viên: Lê Văn Đức Thiện Lớp:10040003 MSSV:41000230 Tên đề tài: Giám sát điều khiển mơ hình lị sấy nông sản Tuần / ngày 02/0309/03/2015 09/0316/03/2015 16/323/03/2015 23/0330/03/2015 30/0306/04/2015 06/0413/04/2015 13/0420/04/2015 20/0427/04/2015 27/0404/05/2015 04/0511/05/2015 11/0518/05/2015 18/0525/05/2015 25/0501/06/2015 01/0608/06/2015 08/0615/06/2013 15/0622/06/2015 Nội dung Xác nhận GVHD Tìm hiểu nhận đề tài làm đồ án tốt nghiệp Thiết kế xây dựng mơ hình SolidWorks Lập trình code Thiết kế lại mơ hình tìm mua linh kiện Lập trình code Thiết kế thi cơng phần khung mơ hình lị sấy băng tải Chỉnh sữa phần code lập trình Chỉnh sửa phần khung mơ hình, viết giao diện máy tính C# code lập trình Làm mạch công suất: mạch triac, mạch cách ly opto relay; mạch phát điểm zero Chỉnh sửa phần code Thiết kế thi cơng lị nhiệt Kiểm tra mạch công suất Kiểm tra việc truyền nhận liệu lên máy tính Làm mạch nguồn Lắp ráp lại mơ hình Gắn động chạy thử mơ hình băng tải Lắp cảm biến, lắp đặt hệ thống nút nhấn điều khiển, đấu dây điều khiển dây nguồn cho mơ hình Lập trình code, tiến hành mơ chương trình Hồn thiện mơ hình Viết chương trình điều khiển giao diện giám sát- điều khiển C# Kiểm tra việc truyền nhận liệu lên máy tính Đấu dây Chạy thử mơ hình chỉnh sửa cần thiết Hoàn thiện phần code điều khiển Kiểm tra, chạy thử mơ hình Hồn thiện giao diện giám sát điều khiển C# Hồn thiện chạy thử mơ hình Viết báo cáo đồ án tốt nghiệp GV HƯỚNG DẪN MỤC LỤC LỜI MỞ ĐẦU CHƯƠNG SƠ ĐỒ KHỐI VÀ LINH KIỆN SỬ DỤNG TRONG HỆ THỐNG 1.1 SƠ ĐỒ KHỐI 1.2 SƠ ĐỒ NGUYÊN LÝ MẠCH 1.3 GIỚI THIỆU LINH KIỆN CHÍNH SỬ DỤNG 1.4 CẢM BIẾN NHIỆT ĐỘ DS18B20 1.5 GIAO TIẾP UART - CHUẨN RS232 (COM) VÀ MODULE BLUTOOTH HC05 1.5.1 TRUYỀN THÔNG NỐI TIẾP UART 1.5.2 SO SÁNH TRUYỀN ĐỒNG BỘ VÀ BẤT ĐỒNG BỘ TRONG TRUYỀN NỐI TIẾP 11 1.5.3 MODULE BLUTOOTH HC05 12 1.6 TRIAC DÒNG BTA 13 1.7 OPTO PC817 VÀ MOC 3021 14 1.8 KHỐI MẠCH CƠNG SUẤT VÀ TÍNH TỐN CHỌN LINH KIỆN 15 1.8.1 MẠCH PHÁT HIỆN ĐIỂM ZERO 16 1.8.3 MẠCH DÙNG RELAY VÀ MOC PC817 22 1.8.4 MẠCH CẦU H DÙNG IC L298 23 1.8.5 BỘ NGUỒN XUNG CẤP CHO MẠCH ĐIỀU KHIỂN VÀ ĐỘNG CƠ 25 CHƯƠNG LƯU ĐỒ GIẢI THUẬT ĐIỀU KHIỂN VÀ GIAO DIỆN 26 GIÁM SÁT 26 2.1 GIỚI THIỆU PHẦN MỀM LẬP TRÌNH GIAO DIỆN C# 26 2.2 LƯU ĐỒ GIẢI THUẬT 28 2.2.1 SƠ ĐỒ HĨA CÁC BƯỚC LẬP TRÌNH 28 2.2.2 CHƯƠNG TRÌNH CHÍNH 29 2.2.3 CHƯƠNG TRÌNH CON 30 a Chương trình đọc nhiệt độ 30 b Chương trình ngắt RDA 31 c Chương trình ngắt RB nút nhấn 32 d Chương trình điều khiển nhiệt độ theo giá trị đặt 33 e Chương trình đảo chiều động cho module cầu h - l298 34 CHƯƠNG THIẾT KẾ MƠ HÌNH HỆ THỐNG SẤY NƠNG SẢN 35 3.1 THIẾT KẾ LÒ NHIỆT BẰNG NHIỆT ĐIỆN TRỞ TRÊN CƠ SỞ LÝ THUYẾT 35 a Nguyên lí làm việc 35 b Nguyên lý sấy dịng khơng khí nóng 36 c Lượng nhiệt khơng khí cung cấp cho trình sấy 37 d Tính nhiệt lượng tỏa điện trở nhiệt 38 e Tính trung bình, máy sấy cần dùng m3 khơng khí? 39 f Tính cơng suất trung bình cho tải gia nhiệt 39 3.2 CẤU TẠO CỦA LÒ ĐIỆN TRỞ NHIỆT TRONG MƠ HÌNH 40 3.3 GIỚI THIỆU SƠ LƯỢC VỀ BĂNG TẢI NÔNG SẢN 41 a Cấu tạo băng tải 41 b Nguyên lí hoạt động băng tải 41 3.5 THIẾT KẾ PHẦN CƠ KHÍ MƠ HÌNH THÙNG SẤY VÀ BĂNG TẢI 42 a Thùng sấy 42 b Băng tải 43 c Nguyên lý hoạt động mơ hình 43 d Hình ảnh mơ hình sau thi công 46 CHƯƠNG TỔNG KẾT 48 4.1 ĐÁNH GIÁ MƠ HÌNH SẤY 48 4.2 NHỮNG KHÓ KHĂN KHI GIẢI QUYẾT VẤN ĐỀ 48 4.3 HƯỚNG PHÁT TRIỂN ĐỀ TÀI 48 TÀI LIỆU THAM KHẢO 50 PHỤ LỤC 51 DANH MỤC CÁC HÌNH VẼ Hình 1-1: Sơ đồ khối tổng quan Hình 1-2: Sơ đồ nguyên lý mạch làm việc Hình 1-3: Mơ tả chân PIC 16F877A AT 89S52 Hình 1-4: Sơ đồ khối tổ chức Timer0 Hình 1.5 Thanh ghi INTCON ghi phục vụ ngắt Hình 1-6: a: truyền nhận song song; b: truyền nhận nối tiếp Hình 1-7: Giao tiếp truyền thơng RS232 sơ đồ nguyên lý 10 Hình 1-8: Module Blutooth HC05 12 Hình 1-9: Triac BTA20 13 Hình 1-10: Hình dạng chân PC817 MOC3021 14 Hình 1-11: Sơ đồ nguyên lý mạch phát điểm Zero 16 Hình 1-12: Mơ dạng sóng OSCILLOSCOPE phần mềm Proteus 16 Hình 1-13: Mạch cơng suất dùng Triac điều khiển thiết bị gia nhiệt 17 Hình 1-14: Mơ dạng sóng Toff =4ms trễ 20 Hình 1-15: Mơ tả góc kích α 21 Hình 1-16: Mạch hồn thiện điều khiển Triac 21 Hình 1-17: Sơ đồ ngun lý mạch điều khiển cơng suất dùng opto relay 22 Hình 1-18: Thanh điện trở nhiệt quạt thổi gió pha 220VAC 23 Hình 1-19: Sơ đồ nguyên lý module L298 23 Hình 1-20: Bộ nguồn xung 24VDC mạch chuyển đổi nguồn 5v-3A 25 Hình 2-1: Giao diện làm từ phần mềm lập trình ngơn ngữ C# 27 Hình 2-2: Lập trình cho 16F877A phần mềm CCS 28 Hình 2-3: Sơ đồ chương trình 29 Hình 2-4: Sơ đồ chương trình đọc nhiệt độ 30 Hình 2-5: Lưu đồ chương trình ngắt RDA 31 Hình 2-6: Chương trình ngắt RB nút nhấn 32 ĐỒ ÁN TỐT NGHIỆP Trang 66/80 phut_say.Text = "00"; gio_say.Text = "00";}} private void Stop_say_Click(object sender, EventArgs e) {if (congcom.IsOpen) {}} private void pictureBox1_Click(object sender, EventArgs e) {if (congcom.IsOpen) {congcom.Write("S"); txtnhietdodat.Text = ""; nut_tang.ForeColor = Color.Red; dong_thongbao2.Visible = true; dong_thongbao2.Text = "Hãy nhập giá trị nhiệt độ đặt nhấn Send";} else {dong_thongbao1.Text = "Cong Com chưa kết nối"; dong_thongbao1.Visible = true;}} private void pictureBox4_Click(object sender, EventArgs e) {if (congcom.IsOpen) {congcom.Write("G"); txtnhietdodat.Text = ""; dong_thongbao2.Text = "Đã gửi giá trị cài đặt";} else {dong_thongbao1.Text = "Hãy kiểm tra kết cổng Truyền thông"; dong_thongbao1.ForeColor = Color.Red;}} private void view_table_Click(object sender, EventArgs e) {if (lich_thoigian.Visible == true) {lich_thoigian.Visible = false; manhinhcamera.Visible = true; view_table.Text = "View Table";} else {manhinhcamera.Visible = false; lich_thoigian.Visible = true; view_table.Text = "OFF Table";}} private void view_temperaturemetter_Click(object sender, EventArgs e) {if (dongho_datnhietdo.Visible == true) {dongho_nhietdodo.Visible = false; dongho_datnhietdo.Visible = false; bieu_doduong.Visible = false; triso_giatridatdongho.Visible = false; triso_giatrithucnhietdodongho.Visible = false;} else {dongho_nhietdodo.Visible = true; dongho_datnhietdo.Visible = true; Giám sát điều khiển mơ hình lị sấy nông sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 67/80 bieu_doduong.Visible = true; triso_giatridatdongho.Visible = true; triso_giatrithucnhietdodongho.Visible = true; }} private void buttonX1_Click(object sender, EventArgs e) {if (congcom.IsOpen) {congcom.Write("R"); dong_thongbao2.Text = "Đã Tắt Nguồn "; congcom.Write("T"); man_hinh_lcdchinh.Visible = false; batnguon.Text = "Bật Nguồn"; tatnguon.Text = "Đã Tắt"; man_hinh_lcd_gioithieu.Visible = true; man_hinh_lcd_gioithieu.Text = " RESET CÀI ĐẶT HỆ THỐNG ! \n NHẤN OK TRỞ VỀ MẶC ĐỊNH"; green_ledbangtai1.Visible = false; red_ledbangtai1.Visible = false; green_ledbangtai2.Visible = false; red_ledbangtai2.Visible = false; green_daosan.Visible = false; red_daosan.Visible = false; anh_chuadotlo.Visible = true; anh_khidotlo.Visible = false; anh_ngonlua_1.Visible = false; anh_ngonlua_2.Visible = false; timer_anhngonlua.Stop(); timer_quat.Stop(); timer_thoigiansay.Enabled = false; bat_quat.Enabled = false; dot_lo.Enabled = false; run_bangtai1.Enabled = false; /*nut nhan*/ run_bangtai2.Enabled = false; nut_camera.Enabled = false; xoa_thoigian.Enabled = false; nut_tang.Enabled = false; nut_giam.Enabled = false; tat_quat.ForeColor = Color.Red; bat_quat.ForeColor = Color.Black; dong_thongbao4.Visible = true; dong_thongbao4.Text = "Quạt Sấy Đã Tắt , Hãy Đảm Bảo Đã Tắt Bộ Phận Gia Nhiệt "; run_bangtai1.ForeColor = Color.Black; stop_bangtai1.ForeColor = Color.Red; /* nut nhan*/ Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 68/80 bat_quat.Enabled = true; dot_lo.Enabled = true; run_bangtai1.Enabled = true; /*nut nhan*/ run_bangtai2.Enabled = true; nut_camera.Enabled = true; xoa_thoigian.Enabled = true; nut_tang.Enabled = true; nut_giam.Enabled = true; timer_thoigiansay.Stop(); giay_say.Text = "00"; phut_say.Text = "00"; gio_say.Text = "00"; giay_chaytext.Text = "00"; gio_chaytext.Text = "00"; phut_chaytext.Text = "00"; timer_thanhnhiet.Stop(); thanh_nhietdo.Value = 0; thanh_nhietdodat.Value = 0; timer_thanhnhietdodat.Stop();}} private void buttonX2_Click(object sender, EventArgs e) {if (congcom.IsOpen) {congcom.Write("O"); man_hinh_lcd_gioithieu.Visible = false; man_hinh_lcdchinh.Visible = true; lcd_dong2.Visible = true;}} private void buttonX3_Click(object sender, EventArgs e) {if (congcom.IsOpen) {congcom.Write("S"); txtnhietdodat.Text = ""; dong_thongbao2.Visible = true; dong_thongbao2.Text = "Hãy nhập giá trị nhiệt độ đặt nhấn Send";} else {dong_thongbao1.Text = "Cong Com chưa kết nối"; dong_thongbao1.Visible = true;}} private void nut_giam_Click(object sender, EventArgs e) {if (congcom.IsOpen) {congcom.Write("G"); txtnhietdodat.Text = ""; dong_thongbao2.Text = "Đã gửi giá trị cài đặt";} Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 69/80 else {dong_thongbao1.Text = "Hãy kiểm tra kết cổng Truyền thông"; dong_thongbao1.ForeColor = Color.Red;}} private void nut_camera_Click(object sender, EventArgs e) {if (FinalFrame.IsRunning) {FinalFrame.Stop(); manhinhcamera.Image = BackgroundImage; nut_camera.ForeColor = Color.Red; nut_camera.Text = "Stop Camera";} else {FinalFrame = new VideoCaptureDevice(CaptureDevice[comboBox1.SelectedIndex].MonikerString); FinalFrame.NewFrame += new NewFrameEventHandler(FinalFrame_NewFrame); FinalFrame.Start(); nut_camera.ForeColor = Color.Green; nut_camera.Text = "Playing Camera";}} /*=============Timer ==========================*/ private void timer_quat_Tick(object sender, EventArgs e) {if (congcom.IsOpen) {canhquat1.Visible = false; if (canhquat1.Visible == false) {canhquat1.Visible = true; canhquat2.Visible = !canhquat2.Visible;}}} private void timer_anhngonlua_Tick_1(object sender, EventArgs e) {anh_ngonlua_1.Visible = false; if (anh_ngonlua_1.Visible == false) {anh_ngonlua_1.Visible = true; anh_ngonlua_2.Visible = !anh_ngonlua_2.Visible;}} private void timer_chaychu_Tick(object sender, EventArgs e) {string formdieukhienlosay = this.Text.Substring(1) + this.Text[0]; this.Text = formdieukhienlosay;} private void timer_thoigiansay_Tick(object sender, EventArgs e) {int a = Int32.Parse(gio_say.Text); int b = Int32.Parse(phut_say.Text); int c = Int32.Parse(giay_say.Text); c++; if (c > 59) {c = 0; b++; Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 70/80 if (b > 59) {b = 0; a++;}} if (c < 10) giay_say.Text = "0" + c; else giay_say.Text = c + ""; if (b < 10) phut_say.Text = "0" + b; else phut_say.Text = b + ""; if (a < 10) gio_say.Text = "0" + a; else gio_say.Text = a + "";} /*=======ChươngTrìnhXửLý ==========================*/ int a, phannguyen, phanle, dat, quat, day_say, dongco_bangtai1, dongco_daosan, dongco_daogio; int max, gia_tri_dat, mabatloa; private void congcom_DataReceived(object sender, SerialDataReceivedEventArgs e) {try {a = congcom.BytesToRead; if (a >= 8) {byte[] nhan = new byte[a]; congcom.Read(nhan, 0, a); a = nhan[0]; phannguyen = a; phanle = nhan[1]; dat = nhan[2]; quat = nhan[3]; day_say = nhan[4]; dongco_bangtai1 = nhan[5]; dongco_daogio = nhan[6]; dongco_daosan = nhan[7];} this.Invoke(new EventHandler(type));} catch (System.TimeoutException) { } }void type(object sender, EventArgs e) {if (congcom.IsOpen) {man_hinh_lcdchinh.Text = " Nhiệt độ : " + phannguyen + "," + phanle + " *C"; Giám sát điều khiển mô hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 71/80 lcd_dong2.Text = " Đặt Sấy : " + dat + "," + "0" + " *C"; txtreceive1.Text = "" + quat; text_malosay.Text = "" + day_say; text_madongco1.Text = "" + dongco_bangtai1; text_madaogio.Text = "" + dongco_daogio; text_madaosan.Text = "" + dongco_daosan;} else {man_hinh_lcdchinh.Text = ""; lcd_dong2.Text = "";}} private void timer_thanhnhiet_Tick(object sender, EventArgs e) {max = phannguyen; thanh_nhietdo.Value = max; dongho_nhietdodo.Value = max; text_giatrithanhnhietdododuoc.Text = "" + phannguyen + "," + phanle; triso_giatrithucnhietdodongho.Text = "" + phannguyen + "," + phanle;} private void thanh_caidatnhietdo_ValueChanged(object sender, EventArgs e) {// send(byte.Parse(thanh_caidatnhietdo.Value.ToString()); }private void thanh_caidatnhietdo_Scroll(object sender, EventArgs e) {// hienthi_nhietdodatcuathanh.Text = thanh_caidatnhietdo.Value.ToString(); // thanh_nhietdo.Value = thanh_caidatnhietdo.Value;} private void timer_thanhnhietdodat_Tick(object sender, EventArgs e) {gia_tri_dat = dat; thanh_nhietdodat.Value = gia_tri_dat; triso_giatridatdongho.Text = thanh_nhietdodat.Value.ToString(); hienthi_nhietdodatcuathanh.Text = thanh_nhietdodat.Value.ToString(); dongho_datnhietdo.Value = gia_tri_dat;} private void timer_kiemtra_Tick(object sender, EventArgs e) {if (txtreceive1.Text == "0") {timer_quat.Enabled = true; bat_quat.ForeColor = Color.Green; dong_thongbao4.Visible = true; dong_thongbao4.Text = "Đang Thổi Gió Vào Để Sấy ";} if (txtreceive1.Text == "1") {timer_quat.Stop(); tat_quat.ForeColor = Color.Red; bat_quat.ForeColor = Color.Black; dong_thongbao4.Visible = true; dong_thongbao4.Text = "Quạt Sấy Đã Tắt , Hãy Đảm Bảo Đã Tắt Bộ Phận Gia Nhiệt ";} Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 72/80 if (text_malosay.Text == "0") {timer_thoigiansay.Start(); timer_anhngonlua.Enabled = true; timer_anhngonlua.Start(); dot_lo.ForeColor = Color.Blue; tat_lo.ForeColor = Color.Black; dot_lo.Text = "Doing"; tat_lo.Text = "Tắt Lò"; dong_thongbao3.Visible = true; dong_thongbao3.Text = "Đang sấy nông sản , nhấn đồng hồ số để theo dõi thời gian sấy";} if (text_malosay.Text == "1") {anh_chuadotlo.Visible = true; anh_khidotlo.Visible = false; anh_ngonlua_1.Visible = false; anh_ngonlua_2.Visible = false; timer_anhngonlua.Stop(); dot_lo.ForeColor = Color.Black; tat_lo.ForeColor = Color.Red; dot_lo.Text = "Đốt Lò"; tat_lo.Text = "Stoping"; dong_thongbao3.Visible = true; dong_thongbao3.Text = "Đã Tắt Bộ phận Gia Nhiệt Để Sấy "; timer_thoigiansay.Enabled = false; timer_anhngonlua.Stop();} if (text_madongco1.Text == "0") {// denbao_runbangtai1.BackColor = Color.Green; // denbao_stopbangtai1.BackColor = Color.White; run_bangtai1.ForeColor = Color.Green; stop_bangtai1.ForeColor = Color.Black; green_ledbangtai1.Visible = true; red_ledbangtai1.Visible = false;} if (text_madongco1.Text == "1") {// denbao_stopbangtai1.BackColor = Color.Red; // denbao_runbangtai1.BackColor = Color.White; run_bangtai1.ForeColor = Color.Black; stop_bangtai1.ForeColor = Color.Red; green_ledbangtai1.Visible = false; red_ledbangtai1.Visible = true;} Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 73/80 if (text_madaogio.Text == "1") {green_ledbangtai2.Visible = false; red_ledbangtai2.Visible = true;} if (text_madaogio.Text == "0") {green_ledbangtai2.Visible = true; red_ledbangtai2.Visible = false;} if (text_madaosan.Text == "1") {green_daosan.Visible = false; red_daosan.Visible = true;} if (text_madaosan.Text == "0") {green_daosan.Visible = true; red_daosan.Visible = false;}} private void txtnhietdodat_KeyPress(object sender, KeyPressEventArgs e) {if (char.IsNumber(e.KeyChar) || e.KeyChar == '.') {} else {e.Handled = e.KeyChar != (char)Keys.Back;}} private void textBox_thoigiandaosan_KeyPress(object sender, KeyPressEventArgs e) {if (char.IsNumber(e.KeyChar) || e.KeyChar == '.') {} else {e.Handled = e.KeyChar != (char)Keys.Back;}} private void textBox4_KeyPress(object sender, KeyPressEventArgs e) {if (char.IsNumber(e.KeyChar) || e.KeyChar == '.') {} else {e.Handled = e.KeyChar != (char)Keys.Back;}} private void textBox3_KeyPress(object sender, KeyPressEventArgs e) {if (char.IsNumber(e.KeyChar) || e.KeyChar == '.') {} else {e.Handled = e.KeyChar != (char)Keys.Back;}} private void button_dat_Click(object sender, EventArgs e) {timer_thanhnhietdodat.Start();} private void goi_hengio_Click(object sender, EventArgs e) {if (khay_thoigianhengio.Visible == false) { khay_thoigianhengio.Visible = true;} else { khay_thoigianhengio.Visible = false; }} Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 74/80 private void timer_daogio_Tick(object sender, EventArgs e) {int g = Int32.Parse(gio_chaytext.Text); int k = Int32.Parse(phut_chaytext.Text); int p = Int32.Parse(giay_chaytext.Text); p++; if (p > 59) {p = 0; k++; if (k > 59) {k = 0; g++;} } if (p < 10) giay_chaytext.Text = "0" + p; else giay_chaytext.Text = p + ""; if (k < 10) phut_chaytext.Text = "0" + k; else phut_chaytext.Text = k + ""; if (g < 10) gio_chaytext.Text = "0" + g; else gio_chaytext.Text = g + ""; if ((textBox_gio_daogio.Text == gio_chaytext.Text) && (textBox_phut_daogio.Text == phut_chaytext.Text) && (textBox_giay_daogio.Text == giay_chaytext.Text)) {congcom.Write("E"); timer_daogio.Stop(); giay_chaytext.Text = "00"; gio_chaytext.Text = "00"; phut_chaytext.Text = "00"; timer_2daogiodetat.Start();}} private void timer_2daogiodetat_Tick(object sender, EventArgs e) {int g = Int32.Parse(gio_chaytext.Text); int k = Int32.Parse(phut_chaytext.Text); int p = Int32.Parse(giay_chaytext.Text); p++; if (p > 59) Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 75/80 {p = 0; k++; if (k > 59) {k = 0; g++;}} if (p < 10) giay_chaytext.Text = "0" + p; else giay_chaytext.Text = p + ""; if (k < 10) phut_chaytext.Text = "0" + k; else phut_chaytext.Text = k + ""; if (g < 10) gio_chaytext.Text = "0" + g; else gio_chaytext.Text = g + ""; if ((textBox_gio_daogio.Text == gio_chaytext.Text) && (textBox_phut_daogio.Text == phut_chaytext.Text) && (textBox_giay_daogio.Text == giay_chaytext.Text)) {congcom.Write("5"); timer_2daogiodetat.Stop(); giay_chaytext.Text = "00"; gio_chaytext.Text = "00"; phut_chaytext.Text = "00"; timer_daogio.Start();}} private void textBox9_TextChanged(object sender, EventArgs e) {} private void buttonX3_Click_1(object sender, EventArgs e) {timer_daogio.Start(); buttonX3.BackColor = Color.Blue; buttonX3.Enabled = false;} private void buttonX4_Click(object sender, EventArgs e) {timer_daogio.Stop(); timer_2daogiodetat.Stop(); buttonX3.Enabled = true; congcom.Write("5"); giay_chaytext.Text = "00"; gio_chaytext.Text = "00"; Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 76/80 phut_chaytext.Text = "00";} private void timer_daosan_Tick(object sender, EventArgs e) {int g = Int32.Parse(textbox_giodaosan.Text); int k = Int32.Parse(textBox_phut_daosan.Text); int p = Int32.Parse(textBox_giaydaosan.Text); p++; if (p > 59) {p = 0; k++; if (k > 59) {k = 0; g++;}} if (p < 10) textBox_giaydaosan.Text = "0" + p; else textBox_giaydaosan.Text = p + ""; if (k < 10) textBox_phut_daosan.Text = "0" + k; else textBox_phut_daosan.Text = k + ""; if (g < 10) textbox_giodaosan.Text = "0" + g; else textbox_giodaosan.Text = g + ""; if ((textBox_thoigiandaosan.Text == textbox_giodaosan.Text) && (textBox_phut_daosan.Text == phut_daosan.Text) && (textBox_giaydaosan.Text == giay_daosan.Text)) {congcom.Write("F"); timer_daosan.Stop(); textbox_giodaosan.Text = "00"; textBox_phut_daosan.Text = "00"; textBox_giaydaosan.Text = "00"; timer_2daosan_detat.Start(); // timer_daosan.Start();}} private void button_batthoigiandaosan_Click(object sender, EventArgs e) {timer_daosan.Start(); button_batthoigiandaosan.BackColor = Color.Blue; button_batthoigiandaosan.Enabled = false;} private void button_tatthoigiandaosan_Click(object sender, EventArgs e) Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 77/80 {timer_2daosan_detat.Stop(); timer_daosan.Stop(); button_batthoigiandaosan.Enabled = true; congcom.Write("6"); textbox_giodaosan.Text = "00"; textBox_phut_daosan.Text = "00"; textBox_giaydaosan.Text = "00";} private void timer_2daosan_detat_Tick(object sender, EventArgs e) {int g = Int32.Parse(textbox_giodaosan.Text); int k = Int32.Parse(textBox_phut_daosan.Text); int p = Int32.Parse(textBox_giaydaosan.Text); p++; if (p > 59) {p = 0; k++; if (k > 59) {k = 0; g++;}} if (p < 10) textBox_giaydaosan.Text = "0" + p; else textBox_giaydaosan.Text = p + ""; if (k < 10) textBox_phut_daosan.Text = "0" + k; else textBox_phut_daosan.Text = k + ""; if (g < 10) textbox_giodaosan.Text = "0" + g; else textbox_giodaosan.Text = g + ""; if ((textBox_thoigiandaosan.Text == textbox_giodaosan.Text) && (textBox_phut_daosan.Text == phut_daosan.Text) && (textBox_giaydaosan.Text == giay_daosan.Text)) { congcom.Write("6"); timer_2daosan_detat.Stop(); textbox_giodaosan.Text = "00"; textBox_phut_daosan.Text = "00"; textBox_giaydaosan.Text = "00"; timer_daosan.Start();}} Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 78/80 private void buttonX5_Click(object sender, EventArgs e) {timer_hen_giosay.Start(); buttonX5.Enabled = false;} private void button_tat_saytheothoigian_Click(object sender, EventArgs e) {congcom.Write("2"); congcom.Write("3"); buttonX5.Enabled = true; timer_hen_giosay.Stop(); timer2_hensay.Stop(); text_chay_gio_hensay.Text = "00"; text_chay_phut_say.Text = "00"; text_chay_giay_say.Text = "00";} private void timer2_hensay_Tick(object sender, EventArgs e) {int g = Int32.Parse(text_chay_gio_hensay.Text); int k = Int32.Parse(text_chay_phut_say.Text); int p = Int32.Parse(text_chay_giay_say.Text); p++; if (p > 59) {p = 0; k++; if (k > 59) {k = 0; g++;}} if (p < 10) text_chay_giay_say.Text = "0" + p; else text_chay_giay_say.Text = p + ""; if (k < 10) text_chay_phut_say.Text = "0" + k; else textBox_phut_daosan.Text = k + ""; if (g < 10) text_chay_gio_hensay.Text = "0" + g; else text_chay_gio_hensay.Text = g + ""; if ((text_chay_gio_hensay.Text == text_gio_say.Text) && (textBox_phut_daosan.Text == text_phut_say.Text) && (text_chay_giay_say.Text= text_giay_say.Text)) { congcom.Write("2"); Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 79/80 congcom.Write("3"); if (mabatloa == 1) {var mediaPlayer = new System.Media.SoundPlayer(); mediaPlayer.SoundLocation = @"g:\a better day.wav"; mediaPlayer.PlaySync();} else if(mabatloa==0) {} timer2_hensay.Stop(); text_chay_gio_hensay.Text = "00"; text_chay_phut_say.Text = "00"; text_chay_giay_say.Text = "00"; timer_hen_giosay.Start();}} private void timer_hen_giosay_Tick(object sender, EventArgs e) { int g = Int32.Parse(text_chay_gio_hensay.Text); int k = Int32.Parse(text_chay_phut_say.Text); int p = Int32.Parse(text_chay_giay_say.Text); p++; if (p > 59) {p = 0; k++; if (k > 59) {k = 0; g++;}} if (p < 10) text_chay_giay_say.Text = "0" + p; else text_chay_giay_say.Text = p + ""; if (k < 10) text_chay_phut_say.Text = "0" + k; else textBox_phut_daosan.Text = k + ""; if (g < 10) text_chay_gio_hensay.Text = "0" + g; else text_chay_gio_hensay.Text = g + ""; if ((text_chay_gio_hensay.Text == text_gio_say.Text) && (textBox_phut_daosan.Text == text_phut_say.Text) && (text_chay_giay_say.Text = text_giay_say.Text)) { congcom.Write("B"); Giám sát điều khiển mơ hình lị sấy nông sản SVTH: Lê Văn Đức Thiện ĐỒ ÁN TỐT NGHIỆP Trang 80/80 congcom.Write("C"); timer_hen_giosay.Stop(); text_chay_gio_hensay.Text = "00"; text_chay_phut_say.Text = "00"; text_chay_giay_say.Text = "00"; timer2_hensay.Start();}} private void on_loa_Click(object sender, EventArgs e) { off_loa.Enabled = true; on_loa.Enabled = false; anh_loa.Enabled = true; anh_loa.Visible = true; anh_tatloa.Visible = false; mabatloa = 1; } private void off_loa_Click(object sender, EventArgs e) { off_loa.Enabled = false; on_loa.Enabled = true; anh_loa.Enabled = false; anh_loa.Visible = false; anh_tatloa.Visible = true; mabatloa = 0;}}} Giám sát điều khiển mơ hình lị sấy nơng sản SVTH: Lê Văn Đức Thiện ... (Iđm), Ilv ≤ 40%.Iđm +Chọn Ivan =  I t   9,1  12,8 (A) dòng đỉnh qua Triac + Dịng trung bình: IAV = + Dòng hiệu dụng +Chọn Uvan = IVan  IRMS =  12,8   4,1(A) U IVan 12,8    6, 4(A) 2R... ngược cực đại lặp lại cho phép IGT (Gate Trigger Curent) dịng kích làm việc cho chân cổng triac mở van dẫn điện b Ví dụ: Sau phát điểm điện lưới sóng Sin ứng với nửa chu kì 10ms ta tạo khoảng thời

Ngày đăng: 30/10/2022, 10:06

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN

w