Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 25 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
25
Dung lượng
1,25 MB
Nội dung
HO CHI MINH UNIVERISTY OF TECHNOLOGY FACULTY OF ELECTRICAL AND ELECTRONICS ENGINEERING -o0o - INTERNSHIP REPORT Pizitech Co., Ltd Topic: Researching and understanding about IoT to collect data in the solar power system Instructor: Mai Bá Lộc Student: Trần Quốc Huy Student ID: 1851072 HO CHI MINH CITY, MARCH 2022 THANK YOU First of all, I would like to thank the members of Pizitech Co., Ltd and Mr Le Duc Toan for creating favorable conditions and guiding me wholeheartedly so that I could study and complete this internship I would like to thank Mr Toan for guiding, introducing documents, answering questions and helping me during the whole internship process Thanks to that, I accumulated more knowledge, experience and practical working environment Since then, I have gained more experience and applicable knowledges on my own I would like to thank Professor Mai Ba Loc for enthusiastically guiding and answering all questions during the internship at the company From there, I was able to complete the internship in the most complete way In the process of interning and making reports, due to lack of practical experience, errors cannot be avoided I would like to thank the members of Pizitech Co and Professor Mai Ba Loc who have guided and supported me so that I can complete the report in the most complete way Ho Chi Minh City, March 5, 2022 Student Trần Quốc Huy i Industrial Internship Instructor: Mai Bá Lộc CONTENTS ABOUT PIZITECH CO., LTD 1.1 Introduction 1.2 Duties and functions of the company 1.3 Organizational structure and personnel of Pizitech company .2 INTERNSHIP CONTENT 2.1 Task assignment: 2.2 Timetable and schedule of the internship progress .3 ASSIGNMENTS CONTENT 3.1 Research about Modbus 3.2 RS485 interface 3.3 Modbus RTU 3.4 Modbus TCP/IP 10 3.5 Research on PV panels system in solar energy and apply Modbus for monitoring and management 11 3.6 Connecting to the solar system and designing the monitoring interface .14 INTERNSHIP SUMMARY 19 4.1 Internship results 19 4.2 Experiences learned during the internship 19 RERFERENCES .20 ii Industrial Internship Instructor: Mai Bá Lộc FIGURE LIST Figure 1.1 Figure 3.1 Figure 3.2 Figure 3.3 Figure 3.4 .10 Figure 3.5 .11 Figure 3.6 .12 Figure 3.7 .12 Figure 3.8 .15 Figure 3.9 .15 Figure 3.10 .16 Figure 3.11 .16 Figure 3.12 .17 iii Industrial Internship Instructor: Mai Bá Lộc TABLE LIST Table 2.1 Table 3.1 14 iv Industrial Internship Instructor: Mai Bá Lộc ABOUT PIZITECH CO., LTD 1.1 Introduction - Pizitech Co., Ltd was established in 2017, with the strength of young people working with Microsoft technology The company focuses on bringing the best product experience to customers The company is developing products in the transportation industry such as parking solutions, CRM, cargo management solutions - Besides, the company also has a consulting department to deploy technology solutions to help customers and partners of the company have the best IT infrastructure The company will provide the right solution for your company/organization One of the main tasks of the company is product development, which aims to solve life's problems Products that combine software, cloud computing, IoT hardware to get the most complete solution IT infrastructure is one of the core things of the company Figure 1 Industrial Internship Instructor: Mai Bá Lộc 1.2 Duties and functions of the company - With a right IT strategy, your business or organization can survive in the digital age and avoid potential risks Areas of operation of the company - Website design: Website will create many advantages in business The company will help create an amazing virtual representation of you in the digital world - Mobile application development: Mobile application is the key of business So the company will bring the best experience to the palm of your hand - Business management solutions: The company provides comprehensive management solutions such as ERP, CRM, HRM for your organization to improve business efficiency and reduce potential risks - IT Strategy: With the right IT strategy, your business or organization can survive in the digital age and avoid risks The company will always be by your side to provide the right and timely IT strategy - Development and application of IoT infrastructure: In parallel with the development of IT strategy, where everything is connected and linked together, it is impossible not to have a modern and stable IoT system 1.3 Organizational structure and personnel of Pizitech company - Pizitech offers experienced and dedicated resources combined with a modern organization and strong management structure With the goal of combining employees, customers and partners to deliver the best results and service quality in this highly competitive market segment The organizational structure of Pizitech is divided into divisions, performing separate, cooperative and mutually supportive jobs: Executive Management Board, Solutions Department and Product Department: Industrial Internship Instructor: Mai Bá Lộc Solution Department: Carrying out the tasks of infrastructure survey consulting, strategic consulting and project implementation and planning Production Department: Provide hardware and software needed for the project INTERNSHIP CONTENT 2.1 Task assignment: - Task 1: Read documents and learn about Modbus in industry, which includes RS485 protocol, Modbus RTU, Modbus TCP/IP - Task 2: Research and analyze the company's solar power system and how to apply Modbus in monitoring and controlling the system - Task 3: Connect to the system via Modbus TCP/IP to collect and monitor, design a simple GUI interface to connect and display information 2.2 Timetable and schedule of the internship progress Internship schedule at Pizitech Co 3/1/2022 – 27/3/2022 Week Week Week Week Week Week Assignments -Research and learn about Modbus -Learn about RS485, Modbus RTU, Modbus TCP/IP protocol -Take courses about Modbus on Udemy.com -Do research on the solar grid power system -How to apply Modbus in monitoring and managing the system -Use ModbusTool.exe to connect to Industrial Internship Instructor: Mai Bá Lộc Modbus system in the grid -Design a simple GUI interface to monitor the power parameters of the grid Week Table 2.1 ASSIGNMENTS CONTENT 3.1 Research about Modbus - - - - - What is Modbus? MODBUS [1] [3] developed by Modicon (now part of Schneider Electric) in 1979, is a means of communicating with multiple devices over a single twisted pair of cable Initially, it worked on RS232, but later it used RS485 for higher speeds, longer distances, and multi-drop networks MODBUS quickly became the standard in the automation industry, and Modicon made it available to the public as a free protocol There are main types of Modbus protocol being used widely in the industry: Modbus ASCII Modbus TCP Modbus RTU Working principle of Modbus MODBUS is a "master - slave" system, "master" is connected to one or more "slaves" The “master” is usually a PLC, PC, DCS, or RTU The MODBUS RTU “slaves” are typically field devices, all connected to the network in a multi-drop configuration When a MODBUS RTU master wants information from a device, the master sends a required data message, a debug summary, to the device address Every other devices on the network will receive this message, but only the specified device will respond Devices on the Modbus network operate in a reactive mode following the commands sent down from the Master Transmitted data structure in Modbus protocol Including main parts: Device Address: This address field helps the master determine which slave it is working with Slaves will be assigned addresses from 1-247 and must ensure that no Slaves have the same address Industrial Internship Instructor: Mai Bá Lộc This field is in the first position in a Modbus message and is bits in size Function Code: This field follows the Device Address field and is bits in size, which specifies the action the Master requires the Slave to perform, such as reading/writing one or more data in the device Data: Is used to store data exchanged between slave and master The Data field of the Query message contains additional information that the Slave must use to take action according to the Function Code For Response messages, the Data field will contain the data requested by the Master Error Check: This field is used to check for frame errors, it occupies 16-bits corresponding to bytes Modbus RTU uses Cyclical Redundancy Check method Hình 3.1 - Security fallbacks of Modbus Lack of security: All Modbus messages are transmitted in clear text over the media If somehow an attacker can install a transceiver into the Modbus network, the attacker can read the entire message content and then perform malicious actions - Lack of data integrity: Unable to check data integrity in Modbus TCP/IP application protocol (because Error Check CRC is removed) An attacker can make requests to the Master or Slave, from which it is Industrial Internship Instructor: Mai Bá Lộc possible to inject invalid messages into the network causing network failures - Lack of authentication: No authentication at any level of the Modbus protocol All Modbus devices not need to authenticate access to the network An attacker can inject another device into an existing Modbus network without authentication - Simple Frame: Modbus TCP/IP uses TCP/IP and Ethernet to carry Modbus message structure data between devices that are compatible with the network standard (TCP/IP) Modbus messages have a size limit of 256 bytes If an attacker enters error messages that exceed the allowed size, it can cause a buffer overflow - The control system integrates many different communication protocols connected to Modbus to transmit and receive data to serve the function of control and monitoring of production equipment An attacker can use another protocol to access the data and signals of the device using Modbus to perform destructive actions - In systems using Modbus, control stations with similar functions often use the same design An attacker can use information available from one control station to attack another control station that has a repeater function - Control devices, network devices, etc can usually be accessed, because the username and password are set to the manufacturer's default An attacker can use the credentials to infiltrate the Modbus network and perform destructive actions - The number of connections Modbus allows is more than actually used In practice using the user to default to the manufacturer's settings allowing the maximum number of connected devices, an attacker could break in, use unused connection addresses, and perform acts of sabotage - Industrial systems are not regularly updated or updates are slow or not synchronize software Attackers can take advantage of vulnerabilities of old versions, infiltrate the system to perform Industrial Internship Instructor: Mai Bá Lộc destructive actions This is true for all protocols in the industrial environment in general, not just Modbus - Application of Modbus Modbus is also the most common communication protocol in building industrial automation systems and the most common means available for connecting automated electronic devices, collectively known as IoT (Internet of Things) - Modbus was the first widely accepted fieldbus standard In a short time, hundreds of vendors have implemented the Modbus communication system in their equipment, and Modbus has become the de facto standard for industrial communication networks 3.2 RS485 interface What is RS485? - RS485 [2], also known by its full name RS485 communication standard or RS485 cable, this is a communication method that connects to computers and other devices RS485 is not just a single interface but it is a communication complex capable of creating simple networks of many devices - RS485 communication standard can connect up to 32 devices on a single wire pair and a ground wire system at a distance of up to 1200m Construction of RS485 - RS485 cable is constructed very simply, only from wires twisted together in pairs However, this very structure creates a serious drawback, when interference occurs in one pair of wires, immediately the other pair of wires will also suffer This leads to the operating voltage between the wires will not have too much difference, the receiver of RS485 can still receive the signal because the receiver has eliminated all interference Working principle of RS485 Industrial Internship - Instructor: Mai Bá Lộc The principle of operation of RS485 is quite simple, data will be transmitted through wires twisted together, this wire is called twisted cable When the wire is twisted, it will give RS485 high antiinterference ability and better long-distance signal transmission - RS485 is divided into types of configuration, currently the most commonly used is 2-wire configuration and 4-wire configuration Advantages, disadvantages of RS485 - Advantages: Is the most advanced product today, overcoming the weaknesses left by RS232 RS485 cable is the only communication standard that can connect multiple transmitters and receivers on the same network at the same time Receivers with input resistance up to 12kΩ RS485 can still connect up to 32 devices In addition, with other inputs, RS485 can connect up to 256 devices When RS485 is connecting devices at quite a distance, users can overcome it by installing more repeaters to increase the number of connected devices, making the signal more stable, and avoiding line interference RS485 has signal transmission lines installed, so the signal will be transmitted faster over longer and wider distances - Disadvantages: When transmitting too many devices on the same line, the response time will be slow Devices need to use the same RS485 standard instead of the existing Analog standard A certain knowledge is required to use RS485 effectively 3.3 Modbus RTU - Modbus RTU [4] protocol is a serial communication protocol Industrial Internship - Instructor: Mai Bá Lộc In a device communication network using the Modbus RTU protocol, sensors or actuators often act as slaves; Devices such as computers, PLCs, microcontrollers, HMI devices, etc can be Master devices, but sometimes they can also act as slaves Figure 3.2 - The transmission frame of the Modbus RTU protocol builds on the UART serial communication protocol UART protocol is also a serial communication protocol, used in microcontrollers, it defines the structure of a packet to send a byte how to send bits And the content of Modbus messages is built up of multiple packets Figure 3.3 Industrial Internship - Instructor: Mai Bá Lộc In the OSI structure, Modbus RTU is an application layer protocol, so it needs the underlying physical layer to connect with other devices Standard physical links RS232 and RS485 are used for this protocol Figure 3.4 3.4 Modbus TCP/IP - Modbus-TCP/IP [5] is a Modbus protocol used on Ethernet lines, using TCP/IP model for communication - Modbus-TCP is an open industrial Ethernet network recognized by the Modbus-IDA User Organization - Like other modbus types, Modbus TCP/IP also uses Master-Slave model for communication However, deployed over Ethernet, using the TCP protocol suite over IP - Modbus TCP changes the traditional Master-Slave definition Because Ethernet allows peer-to-peer communication In the TCP network, the Slaves can actively transmit information about the central management device - the Master Use IP addresses on the Masters for centralized management from the software 10 Industrial Internship - Instructor: Mai Bá Lộc Modbus TCP/IP is used on modern TCP/IP networks, there are types of Modbus TCP implementations: - Modbus RTU over TCP, which simply uses TCP as the transport layer for RTU messages - Modbus TCP is normal and there are some changes in the message format - Because it is transmitted on TCP/IP platform, Modbus TCP/IP transmission speed is high, real-time response Much higher than Modbus RTU - Modbus TCP/IP can be combined with modbus RTU Called Hybrid Modbus As shown below - Figure 3.5 - Modbus RTU uses RS485, RS232 Modbus TCP is used over Ethernet So if you want to combine these two types of modbus, you need to find a device that supports these two ports This will greatly benefit you when expanding the production scale, the number of devices 3.5 Research on PV panels system in solar energy and apply Modbus for monitoring and management Solar power system: 11 Industrial Internship Instructor: Mai Bá Lộc Figure 3.6 - The solar power generation system [6] includes key components: Photovoltanic panels are responsible for absorbing energy from the sun to produce electricity The generated DC current is then led to the inverters (MPPT Inverters) by electrical wires with the MC4 connector Figure 3.7 12 Industrial Internship Instructor: Mai Bá Lộc MPPT inverter [7]: used to receive DC power generated from solar panels, then its roles are to charge batteries to store electricity (DC) or connect to the national grid (AC) The device includes the MPPT (Maximum Power Point Tracker) circuit to control the operation of the inverter to always reach its maximum capacity to optimize the power obtained from the solar panels One MPPT Inverter can connect 18-20 panels Data logger: used to collect information about the power generated from the MPPT Inverter Thanks to these Data loggers, the operator can monitor important information about the operation of the system The MPPT Inverter is connected to the Data logger via an RS485 connection and the data is collected via the Modbus RTU protocol In the protocol data logger will play the role of Master and inverters will be slaves System Datalogger can monitor up to 31 different inverters at the same time (due to limitation of RS485 interface) Then this Data logger will connect to an IoT Gateway to convert over Modbus TCP/IP protocol This IoT Gateway will be connected to the internet via LAN cable/Fiber cable/Sim 4G Through this IoT Gateway, we can connect to the system from anywhere with an internet connection Application of Modbus in solar power system - Reasons for using Modbus in monitoring and controlling solar power systems: Is a widely accepted fieldbus standard Therefore, finding vendors is easy because most of the related products support this protocol The transport layer of Modbus RTU is very simple and straightforward RS485 connection supports up to 32 clients and has outstanding noise immunity The amount of information exchanged in a solar power system is usually very small and insensitive Cost savings in the application process 13 Industrial Internship Instructor: Mai Bá Lộc 3.6 Connecting to the solar system and designing the monitoring interface Using ModbusTool.exe - The purpose of the connection is to read the data stored in the memory cell of the Data logger, spread from 40069 to 40098, including parameters such as amperage, voltage, power output Information is stored at the following addresses: Table 3.1 14 Industrial Internship - Instructor: Mai Bá Lộc IP address of the Data logger is 14.161.28.32 with Port 11502 Byte order is 4321 Figure 3.8 - The data collected from the system: Figure 3.9 15 Industrial Internship - Instructor: Mai Bá Lộc At 9:00 AM, based on the obtained data, we can see that the power supply is phase (address 40069), the amperage is 4.75 A (obtained parameter is divided by 100) (address 40071), voltage is 235.1 V (obtained parameter is divided by 10) (address 40076), and power generated output is 11139 x10-1 W (addresses 40083 and 40084) Using C# to design monitoring UI for the solar power system: - The UI we get is: Figure 3.10 - Input IP address of the data logger: 12.161.28.32 and Port 11502 and connect, the status showed successful connection is obtained: Figure 3.11 16 Industrial Internship - Instructor: Mai Bá Lộc Click on Read and we get power parameters from the solar power system: Figure 3.12 - Source code for the system monitoring UI: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; 10 using EasyModbus; 11 12 13 14 namespace WindowsFormsApp1 15 { 16 public partial class Form1 : Form 17 { 18 public Form1() 19 { 20 InitializeComponent(); 21 } 22 ModbusClient datalogger = new ModbusClient(); 23 private void Form1_Load(object sender, EventArgs e) 24 { 25 17 Industrial Internship 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 Instructor: Mai Bá Lộc } private void label1_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void label2_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { datalogger.IPAddress = txtIP.Text; datalogger.Port = Convert.ToInt32(txtPort.Text); try { datalogger.Connect(); if (datalogger.Connected == true) { lblStatus.Text = "Connected"; btnConnect.Enabled = false; btnDisconnect.Enabled = true; } } catch (Exception) { lblStatus.Text = "Connection Error!"; } } private void btnDisconnect_Click(object sender, EventArgs e) { datalogger.Disconnect(); lblStatus.Text = "Disconected"; btnConnect.Enabled = true; btnDisconnect.Enabled = false; 18 Industrial Internship 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 } 90 } Instructor: Mai Bá Lộc } private void button1_Click_1(object sender, EventArgs e) { int[] amp = datalogger.ReadHoldingRegisters(40071, 1); int[] volt = datalogger.ReadHoldingRegisters(40076, 1); int[] power = datalogger.ReadHoldingRegisters(40083, 1); int[] powersf = datalogger.ReadHoldingRegisters(40084, 1); int value1 = amp[4] / 100; int value2 = volt[4] / 100; txtCurrent.Text = amp.ToString(); txtVolt.Text = volt.ToString(); txtPower.Text = power[0].ToString(); txtPF.Text = powersf.ToString(); } INTERNSHIP SUMMARY 4.1 Internship results - After weeks of internship and research at Pizitech Co., Ltd., I have been able to obtain a lot of knowledge and practical experience in the working environment In it, there are important knowledge for me later in the process of developing my thesis as well as my future work: Functions and importance of Modbus in the process of forming IoT systems in industrial automation Solar grid management system makes monitoring work simpler and easier than ever 4.2 Experiences learned during the internship - Experience working in a team, especially in a highly specialized company - Analytical and problem solving skills for arising problems during development - Research skills and learn self-study materials as well as reputable sources 19 Industrial Internship - Instructor: Mai Bá Lộc The importance of self-study and self-study for the development of an engineer RERFERENCES [1] Khái niệm giao thức Modbus - https://bkaii.com.vn/tin-tuc/tinnganh/102-khai-niem-co-ban-ve-giao-thuc-modbus [2] RS485: Cấu tạo – Nguyên lý – Ưu nhược điểm https://thietbikythuat.com.vn/rs485/ [3] https://modbus.org/ [4] Modbus RTU gì? - https://huphaco.vn/modbus-rtu-la-gi/ [5] Modbus TCP/IP gì? - https://doluongtudong.com/modbus-tcp-ip-la-gi/ [6] Hệ thống lượng mặt trời gì? - https://sunemit.com/he-thong-dien-nangluong-mat-troi-la-gi/ [7] MPPT ý nghĩa MPPT hệ thống điện mặt trời https://sunemit.com/mppt/ 20 ... Internship Instructor: Mai Bá Lộc 3.6 Connecting to the solar system and designing the monitoring interface Using ModbusTool.exe - The purpose of the connection is to read the data stored in. .. all questions during the internship at the company From there, I was able to complete the internship in the most complete way In the process of interning and making reports, due to lack of practical... using System. Collections.Generic; using System. ComponentModel; using System .Data; using System. Drawing; using System. Linq; using System. Text; using System. Threading.Tasks; using System. Windows.Forms;