A PLC analog automatic calibration method and system
Through an automatic calibration system composed of a module platform, scanner and upper computer, the problems of complex and low efficiency of the PLC analog calibration process are solved, and intelligent and efficient calibration is achieved.
Patent Information
- Application Number
- CN202210504778.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-05-10
AI Technical Summary
The calibration process of existing PLC analog input and output modules is complicated, resulting in waste of human resources and low calibration efficiency, and inaccurate calibration.
An automatic calibration system consisting of a module platform, a scanner and a host computer is adopted to obtain module information through the scanner and upload it to the host computer. The calibration coefficients and values are obtained by fitting the least squares algorithm to achieve automatic calibration.
The degree of intelligence of simulated quantum calibration is improved, human intervention is reduced, and calibration efficiency and accuracy are improved.
Smart Images

Figure CN114879634B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial control technology, and in particular to a PLC analog automatic calibration method and system. Background Art
[0002] Industrial control refers to industrial automation, primarily achieved through a combination of electronics, electrical systems, mechanics, and software. This is also known as industrial control, or factory automation control. It primarily uses computer technology, microelectronics, and electrical means to make factory production and manufacturing processes more automated, efficient, and precise, with controllable and visible processes. The emergence and widespread use of industrial control technology ushered in the Third Industrial Revolution, increasing factory production speed and efficiency by over 300%. In the early 1980s, with the introduction of advanced foreign industrial control technology into China, widely used industrial control products such as PLCs, inverters, servo motors, and industrial computers became a major driver of China's manufacturing automation efforts and made significant contributions to the country's modernization drive. An industrial control computer is a general term for tools that utilize a bus architecture to monitor and control production processes, electromechanical equipment, and process equipment. It has important computer properties and characteristics, such as: computer CPU, hard disk, memory, peripherals and interfaces, real-time operating system, control network and protocol, computing power, friendly human-computer interface, etc. The main categories of industrial computers are: IPC (PC bus industrial computer), PLC (programmable control system), DCS (distributed control system), FCS (fieldbus system) and CNC (numerical control system).
[0003] Industrial control PLCs often require extensive analog data acquisition. The accuracy of analog data acquisition and output is crucial to product quality, making calibration crucial. Current PLC analog input and output modules utilize analog-to-digital (A / D) and digital-to-analog (DA / A) converter chips with excellent linearity. However, due to variations in channel circuit hardware parameters, each channel requires analog calibration to meet operational requirements. Current analog calibration is primarily performed manually, a complex and repetitive process that wastes human resources and leads to low and inaccurate calibration, severely hindering efficiency. Summary of the Invention
[0004] One of the purposes of the present invention is to provide a PLC analog automatic calibration method to solve the technical problem of how to improve the efficiency of analog calibration.
[0005] The first object of the present invention is achieved by adopting the following technical solutions (means): a method for automatic calibration of PLC analog quantities, comprising the following steps:
[0006] The module platform fixes the module to be calibrated and provides power, communication, and calibration signal source for the module to be calibrated;
[0007] The scanning device obtains the information of the module to be calibrated and uploads it to the host computer. The host computer recognizes the information of the module to be calibrated, generates a pop-up window, and enters the calibration mode;
[0008] After the module platform receives the calibration command from the host computer through the serial port, it enters the offline calibration mode and uploads the module data to be calibrated to the host computer through the serial port for self-test. If the self-test is incorrect, it is necessary to obtain the module information to be calibrated again through the scanning device. If the self-test is correct, it proceeds to the next step.
[0009] The host computer automatically selects the calibration mode according to the data information of the module to be calibrated;
[0010] The host computer selects the channel of the module to be calibrated, and obtains the standard signal source and the channel data of the module to be calibrated respectively. The standard signal source is used as the reference value xi, and the channel data of the module to be calibrated is used as the actual value yi. The calibration coefficient and calibration value are obtained through multiple sampling points (xi, yi) within the sampling interval.
[0011] The host computer sends the calibration coefficient and calibration value through the channel of the module to be calibrated. When the module to be calibrated receives the data from the host computer, it sends a return value to the host computer for confirmation. The host computer determines whether the channel of the module to be calibrated has been calibrated based on the return value. If all the channels of the module to be calibrated have been calibrated, the calibration process ends. Otherwise, repeat the above steps.
[0012] Furthermore, the module platform includes a test baseboard and a power module. The power module is arranged on the test baseboard, and the test baseboard is connected to the module to be calibrated through a terminal connector.
[0013] Furthermore, the scanning device includes a scanner, which scans the identification code of the module to be calibrated and uploads the acquired information of the module to be calibrated to the host computer.
[0014] Furthermore, the identification code of the module to be calibrated includes a barcode or a QR code. The scanner directly obtains the product model and board address information of the module to be calibrated by scanning the barcode or QR code of the module to be calibrated, and uploads it to the host computer for processing via the transmission line.
[0015] Furthermore, the module platform is connected to the host computer via an RS232 serial port.
[0016] Furthermore, the host computer selects voltage input calibration mode, current input calibration mode, temperature input calibration mode, voltage output calibration mode or current output calibration mode according to the input and output mode configured on the board with the calibration module.
[0017] Furthermore, the method for obtaining the calibration coefficient and calibration value through multiple sampling points (xi, yi) within the sampling interval is: obtain multiple sampling points (xi, yi) within the sampling interval, and fit the sampling points (xi, yi) through the least squares algorithm and the undetermined coefficient method to obtain the calibration coefficient K, B and calibration value of the straight line y=K*x+B, which are used to replace the analog quantity input and output of the module to be calibrated.
[0018] The second invention object of the present invention is to provide a PLC analog automatic calibration system to solve the technical problem of how to improve the efficiency of analog calibration.
[0019] The second inventive object of the present invention is achieved by adopting the following technical means: a PLC analog automatic calibration system, including a module platform, a scanner and a host computer, the module platform fixes the module to be calibrated, and provides power supply, communication, and calibration signal source for the module to be calibrated, the scanning device obtains the information of the module to be calibrated and uploads it to the host computer, after the module platform receives the calibration command issued by the host computer through the serial port, it uploads the data information of the module to be calibrated to the host computer through the serial port for self-test, the host computer automatically selects the calibration mode according to the data information of the module to be calibrated, and selects the channel of the module to be calibrated, respectively obtains the standard signal source and the channel data of the module to be calibrated, uses the standard signal source as the reference value xi, and uses the channel data of the module to be calibrated as the actual value yi, and obtains the calibration coefficient and calibration value through multiple sampling points (xi, yi) in the sampling interval.
[0020] The beneficial effects of the present invention are: it has a high functional integration for analog quantity calibration and is applicable to the calibration of different types of PLC equipment. Compared with the manual calibration mode, the present invention is more intelligent and greatly improves the efficiency of analog quantity calibration; it uses a scanning method to read information, greatly reducing human intervention, and provides new ideas for the intelligentization of PLC analog quantity calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0022] Figure 1 Flowchart of the present invention;
[0023] Figure 2 This is a system block diagram of the present invention;
[0024] Figure 3 It is a flowchart of the present invention. DETAILED DESCRIPTION
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0026] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0027] The present invention addresses the problem that current PLC analog input and output modules all use analog-to-digital / digital-to-analog conversion chips with good linearity. However, due to differences in channel circuit hardware parameters, each channel needs to be calibrated for analog quantity to meet usage requirements. Analog quantity calibration is mainly performed manually, and the calibration process is relatively complicated and the work is repetitive and monotonous, which not only wastes human resources but also leads to low calibration efficiency and inaccurate calibration, seriously hindering calibration efficiency. The present invention proposes a PLC analog quantity calibration method and system that can replace manual operation and realize intelligent automatic calibration. For details, please refer to the embodiments of the present invention.
[0028] The following embodiments of the present invention are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0029] Example 1:
[0030] See Figure 1-3 , a PLC analog automatic calibration method, comprising the following steps:
[0031] The module platform fixes the module to be calibrated and provides power, communication, and calibration signal source for the module to be calibrated;
[0032] The scanning device obtains the information of the module to be calibrated and uploads it to the host computer. The host computer recognizes the information of the module to be calibrated, generates a pop-up window, and enters the calibration mode;
[0033] After the module platform receives the calibration command from the host computer through the serial port, it enters the offline calibration mode and uploads the module data to be calibrated to the host computer through the serial port for self-test. If the self-test is incorrect, it is necessary to obtain the module information to be calibrated again through the scanning device. If the self-test is correct, it proceeds to the next step.
[0034] The host computer automatically selects the calibration mode according to the data information of the module to be calibrated;
[0035] The host computer selects the channel of the module to be calibrated, and obtains the standard signal source and the channel data of the module to be calibrated respectively. The standard signal source is used as the reference value xi, and the channel data of the module to be calibrated is used as the actual value yi. The calibration coefficient and calibration value are obtained through multiple sampling points (xi, yi) within the sampling interval.
[0036] The host computer sends the calibration coefficient and calibration value through the channel of the module to be calibrated. When the module to be calibrated receives the data from the host computer, it sends a return value to the host computer for confirmation. The host computer determines whether the channel of the module to be calibrated has been calibrated based on the return value. If all the channels of the module to be calibrated have been calibrated, the calibration process ends. Otherwise, repeat the above steps.
[0037] In this embodiment, the module to be calibrated is a PLC module board.
[0038] In this embodiment, the module platform is an integrated platform for fixing, powering, and communicating the module to be calibrated according to the present invention. The module platform includes a test base, a power module, and a standard signal source. The power module is arranged on the test base, and the test base is connected to the module to be calibrated via a terminal connector. The module to be calibrated is automatically transferred from the assembly line to the module platform and fixed to the test base of the module platform by an automatic device. The module to be calibrated is connected to the test base via a terminal connector, providing power supply, communication, and a standard signal source for analog signals such as voltage and current for the module to be calibrated. The module platform is connected to the host computer via an RS232 serial port and can be used for collecting reference values xi, analog output, and module information data transmission.
[0039] In this embodiment, the host computer includes a master calibration algorithm, a communication interface for controlling read and write operations on the modules to be calibrated, and a built-in library for identifying information about different modules. Specifically, the host computer is a computer that can directly issue control commands, typically a PC / host computer / master computer / upper computer, and displays various signal changes (such as hydraulic pressure, water level, and temperature) on its screen. The slave computers are computers that directly control the equipment and obtain its status, typically PLCs / single-chip microcomputers / slave computers / lower computers. Commands issued by the host computer are first transmitted to the slave computers, which then interpret these commands as corresponding timing signals to directly control the corresponding equipment. The slave computers periodically read device status data (typically analog), convert it into digital signals, and feed it back to the host computer. In short, while actual scenarios vary greatly, the fundamental principle remains: both the host and slave computers require programming and have dedicated development systems. Conceptually, the controller and service provider are the host computer, while the controlled and serviced devices are the slave computers. This can also be understood as a master-slave relationship, but the two can be interchanged. Typically, the host and slave computers communicate using different protocols, such as RS232 serial or RS485 serial. When a computer communicates with a PLC, traditional D-type serial communication can be used, as well as the two-wire PROFIBUS-DP communication, which is more suitable for industrial control. Communication between the PLC and the host computer can be achieved using packaged development tools, and of course, it is also possible to write your own driver-type interface protocol to control communication between the host and slave computers.
[0040] In this embodiment, the scanning device includes a scanner, which is the primary intelligent auxiliary tool of the present invention. Its function is to replace manual completion of information transmission and self-test functions of the module to be calibrated. It includes a scanning gun and a host computer data transmission line. During use, the scanning gun is aligned with the identification code of the module to be calibrated to scan and upload the acquired information of the module to be calibrated to the host computer. The scanner has a fast response time, completely replacing manual input, greatly improving the calibration rate, and can be compared with the information obtained by the host computer for self-test, thereby improving accuracy. Specifically, a scanner is a device that captures images. As an optical, mechanical, and electrical integrated computer peripheral product, the scanner is the third largest computer input device after the mouse and keyboard. It can convert images into a digital format that can be displayed, edited, stored, and output by the computer, making it a very powerful input device.
[0041] In this embodiment, the identification code of the module to be calibrated includes a barcode or a QR code. The scanner directly obtains the product model and board address information of the module to be calibrated by scanning the barcode or QR code of the module to be calibrated, and uploads it to the host computer for processing via the transmission line.
[0042] In this embodiment, the host computer selects voltage input calibration mode, current input calibration mode, temperature input calibration mode, voltage output calibration mode or current output calibration mode according to the input and output mode configured on the board with the calibration module.
[0043] In this embodiment, the method for obtaining the calibration coefficient and calibration value through multiple sampling points (xi, yi) within the sampling interval is: obtain multiple sampling points (xi, yi) within the sampling interval, and fit the sampling points (xi, yi) through the least squares algorithm and the undetermined coefficient method to obtain the calibration coefficients K, B and calibration value of the straight line y=K*x+B, which are used to replace the analog input and output of the module to be calibrated.
[0044] In this embodiment, the host computer sends the K and B coefficients and calibration values based on the calibration module's channel number. Upon receiving the host computer data, the calibration module sends a return value to the host computer for confirmation. The host computer then determines whether the channel has been calibrated based on the return value. After each channel is calibrated, all channels are checked to ensure they are calibrated. If any channels remain uncalibrated, the steps following the initial calibration are repeated. If all channels are calibrated, the calibrated module information is stored in a built-in library for easy access. At the same time, the host computer sends a stop calibration command to the module platform, ending the calibration process.
[0045] In addition, see Figure 2 The present invention also provides a PLC analog automatic calibration system, including a module platform, a scanner and a host computer. The module platform fixes the module to be calibrated and provides power, communication, and a calibration signal source for the module to be calibrated. The scanning device obtains information of the module to be calibrated and uploads it to the host computer. After the module platform receives the calibration command issued by the host computer through the serial port, it uploads the data information of the module to be calibrated to the host computer through the serial port for self-test. The host computer automatically selects a calibration mode according to the data information of the module to be calibrated, selects the channel of the module to be calibrated, obtains a standard signal source and channel data of the module to be calibrated respectively, uses the standard signal source as a reference value xi, and uses the channel data of the module to be calibrated as an actual value yi, and obtains the calibration coefficient and calibration value through multiple sampling points (xi, yi) in the sampling interval.
[0046] The present invention is a scanning automatic calibration system designed for PLC analog calibration in the industrial control field. The system consists of three parts: a module platform, a scanner, and a host computer. The module platform is used to provide a power link and a communication link; the scanner can directly read the module to be calibrated and transmit it to the host computer. After the identification information is correct, the calibration process can be directly entered; the host computer contains calibration programs for various PLC modules and uses the Modbus protocol for data transmission to meet the calibration requirements of large, medium and small PLC modules. The present invention has a high functional integration for analog calibration and can be applied to the calibration of different types of PLC equipment. Compared with the manual calibration mode, the calibration process is more intelligent, using both the scanner and the host computer to obtain module information, realize the self-test function, effectively avoid missed detection and false detection, and greatly improve the efficiency of analog calibration.
[0047] The terms "one embodiment" or "embodiment" herein refer to specific features, structures, or characteristics that may be included in at least one implementation of the present invention. In describing the present invention, it should be understood that the terms "upper," "lower," "front," "back," and the like, indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They do not indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limiting the present invention.
[0048] The above embodiments describe the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Without departing from the spirit and scope of the present invention, modifications and variations made by those skilled in the art without departing from the spirit and scope of the present invention should be within the scope of protection of the appended claims.
Claims
1. A method for automatic calibration of PLC analog quantity, characterized in that: The steps include: The module platform fixes the module to be calibrated and provides power, communication, and calibration signal source for the module to be calibrated; The scanning device obtains the information of the module to be calibrated and uploads it to the host computer. The host computer recognizes the information of the module to be calibrated, generates a pop-up window, and enters the calibration mode; After the module platform receives the calibration command from the host computer through the serial port, it enters the offline calibration mode and uploads the module data to be calibrated to the host computer through the serial port for self-test. If the self-test is incorrect, it is necessary to obtain the module information to be calibrated again through the scanning device. If the self-test is correct, it proceeds to the next step. The host computer automatically selects the calibration mode according to the data information of the module to be calibrated; the host computer selects the voltage input calibration mode, current input calibration mode, temperature input calibration mode, voltage output calibration mode or current output calibration mode according to the input and output mode configured on the board with the calibration module; The host computer selects the channel of the module to be calibrated, and obtains the standard signal source and the channel data of the module to be calibrated respectively, takes the standard signal source as the reference value xi, takes the channel data of the module to be calibrated as the actual value yi, and obtains the calibration coefficient and calibration value through multiple sampling points (xi, yi) in the sampling interval; the method for obtaining the calibration coefficient and calibration value through multiple sampling points (xi, yi) in the sampling interval is: obtain multiple sampling points (xi, yi) in the sampling interval, and fit the sampling points (xi, yi) through the least squares algorithm and the undetermined coefficient method to obtain the calibration coefficient K, B and calibration value of the straight line y=K*x+B, which are used to replace the analog quantity of the input and output of the module to be calibrated; The host computer sends the calibration coefficient and calibration value through the channel of the module to be calibrated. When the module to be calibrated receives the data from the host computer, it sends a return value to the host computer for confirmation. The host computer determines whether the channel of the module to be calibrated has been calibrated based on the return value. If all the channels of the module to be calibrated have been calibrated, the calibration process ends. Otherwise, repeat the above steps.
2. A PLC analog quantity automatic calibration method according to claim 1, characterized in that: The module platform includes a test base plate and a power module. The power module is arranged on the test base plate. The test base plate is connected to the module to be calibrated through a terminal connector.
3. A PLC analog quantity automatic calibration method according to claim 1, characterized in that: The scanning device includes a scanner, which scans the identification code of the module to be calibrated and uploads the acquired information of the module to be calibrated to the host computer.
4. A PLC analog quantity automatic calibration method as claimed in claim 3, characterized in that: The identification code of the module to be calibrated includes a barcode or a QR code. The scanner directly obtains the product model and board address information of the module to be calibrated by scanning the barcode or QR code of the module to be calibrated, and uploads it to the host computer for processing via the transmission line.
5. A PLC analog automatic calibration method according to claim 1, characterized in that: The module platform is connected to the host computer via the RS232 serial port.
6. A PLC analog automatic calibration system, used to implement a PLC analog automatic calibration method according to any one of claims 1 to 5, characterized in that: The system includes a module platform, a scanner and a host computer. The module platform fixes the module to be calibrated and provides power, communication and calibration signal source for the module to be calibrated. The scanning device obtains the information of the module to be calibrated and uploads it to the host computer. After the module platform receives the calibration command issued by the host computer through the serial port, it uploads the data information of the module to be calibrated to the host computer through the serial port for self-test. The host computer automatically selects the calibration mode according to the data information of the module to be calibrated, selects the channel of the module to be calibrated, obtains the standard signal source and the channel data of the module to be calibrated respectively, takes the standard signal source as the reference value xi, and takes the channel data of the module to be calibrated as the actual value yi, and obtains the calibration coefficient and calibration value through multiple sampling points (xi, yi) in the sampling interval.
Citation Information
Patent Citations
Calibration method and system of analog quantity basic module and storage medium
CN114139382A