PLC special function application

First, the traditional instrument design process Review modern automatic instrumentation equipment has the following aspects of performance and characteristics:
Front-end signal detection, timely data acquisition, data processing, auto-mechanical and electromechanical automation devices that fulfill its functions, and man-machine interface, in addition to a complete software package for controlling the upper and lower machines. In order to realize the above-mentioned several aspects of performance, the embedded single-board machine based on the high-performance microprocessor seems to have become the only choice of the instrument design so far. Therefore, after the specific performance requirements of the instrument are determined, the design and manufacturing of the hardware and software of the single board machine will enter the agenda.
Second, the proposed new design and feasibility analysis and single board aircraft program comparison The concept of the so-called new program stems from personal experience and exposure to different technical areas, the author was engaged in precision instrument design and industrial automation work , PLC technology, especially the performance of the domestic HOLLiAS LM series of small PLC gives me a technical space to re-examine the design of precision instruments.
From the point of view of design methodology, no one in the world stipulates that automatic instruments must be based on single-board machines. As long as users can implement instrument designs that favor user requirements, they are successful products. In other words, users and users are not Concerned about the design process and internal construction of the instrument, they only care about the instrument's cost performance. As a designer, what we need to consider is all the design schemes, methods, and technical approaches that can achieve the desired performance. This is more in line with the design methodology methodology and design procedures.
Considering the technical feasibility, first look at the electronic control hardware requirements. Generally, the system needs to have a high-performance CPU, a certain amount of memory, DI, DO, AI, AO, communication ports with the human-machine interface, and according to the specific Operational requirements for the preparation of the program. These tasks are no different than the preparation of a set of dedicated small operating systems for a single board or DSP system. In terms of hardware, it is often even necessary to design single-board computer or DSP PCBs. It is not easy to design such a system in today's SMT technology. Needless to say, even a one or two DI expansions need to be redesigned. PCB board.
Let's look at the performance of PLC. PLC is the abbreviation of Programmable Logic Controller. It is not unfamiliar to those who have experience in industrial automation control, but for those who are only engaged in instrument design, they may not be familiar with or have never been involved. PLC usually has a high-performance CPU, a considerable amount of memory, any expansion of the DI, DO, AI, AO interface, which AI resolution is 16 BIT or more, its DO interface can directly drive 1A current power devices or relays, Therefore, the PLC can completely replace the SBC in hardware.
From the aspects of software programming and operation, single-board machines or DSPs, even with the help of C language or other specialized development environments, are quite prolific and do not use assembly language. The direct control of hardware is not easy. Observe and debug difficult. For the special application of instrument control, there are many subroutine calls in runtime and it is difficult to debug online. For PLC, its own function blocks and instruction groups are much more complete than C language for such system control applications, such as various micromotor control, timing, counting, pulse width modulation, pulse output, etc. . In addition, when the PLC program is running, it is a real-time repetitive scan. It can perform arbitrary subroutine program or function block operation in real time according to the requirements of logical calculation results. For a long program with nearly 120K of memory, it takes only tens of milliseconds for a single scan to be very large. For most applications, the speed is fast enough. In terms of programming, PLC's instruction system is easy to learn, easy to use, and easy to debug. Compared with embedded programs, PLC has better readability and readability, and it can enable more companies and more engineering and technical personnel to engage in development work.
Looking at the cost performance ratio, obviously in the development phase, the PLC's cost is very low, it is the industrial control of the market-oriented mass production of products, only a small amount of external dedicated circuit design, the software environment is also easy to set on the PC, often the PLC manufacturers provide free . In the production phase, the cost difference between PLC and SBC is not very different. Moreover, PLC has a wider user area than single-board machines. The products are mature and the quality is stable and reliable, thus saving time in production ordering.
To sum up, the functions and real-time running capabilities of the PLC and the ease of development of the system are more than the single board machines in the general sense. Even with real-time online performance that the SBC does not have. Therefore, from the perspective of theory to practice, PLC as a core instrument has more advantages.
Third, the design process is detailed (take automatic biochemical analyzer as an example)
The automatic biochemical analyzer is a complex instrument used in hospitals to test blood biochemical indicators. The basic function of the biochemical analyzer is to set the test parameters according to their respective biochemical method requirements, and then the automatic mechanism samples and adds the required reagents to the different tests for each sample and the same sample according to the settings, and dilutes according to the specific ratio required. Further, the cuvettes are respectively injected into the cuvette to incubate and delay the reaction liquid (the diluted sample is called reaction liquid), and the next step is to test the reaction liquid according to the test method and time required to be arranged, finally calculate and store and print. Test Results. In order to obtain the hardware and software requirements of the biochemical analyzer for the electronic system, the software and hardware configuration of the PLC is selected accordingly.
1) Hardware Requirements
120K program memory
3 AI input
24 DI input
16 DO output including 2-PTO, 1-PWM output
2 AO output
RS232 (and 485) serial port
If necessary, 2 or more PLC CPU modules can be selected for joint control.
2) Software functions and internal function requirements
Enter the high speed count
High-speed pulse output
Stepper motor pulse control module
PID control function block
Free communication function block
ST text based data processing subroutine
A variety of logic and calculation results determine the instructions.
3) General control program, automatic mechanism micro-motor control, data acquisition and data processing hardware and software arrangements
The PLC control software of the instrument is composed of a main control program, an initialization reset subroutine, an automatic mechanism action algorithm subroutine, an automatic mechanism motion execution subroutine, a data read control subroutine, and a data calculation processing subroutine.
The main control program completes the selection and execution of each subroutine and the communication with the human-machine interface. It is a ladder diagram program.
The initialization reset subroutine completes the automatic mechanism return and data initialization and is a ladder diagram program.
The automatic mechanism motion algorithm subroutine completes the arrangement of the automatic mechanism's motion sequence and is a ladder diagram program.
The automatic mechanism motion execution subroutine drives the automatic mechanism to complete the required actions, and is a ladder diagram program.
The data read control subroutine performs the reading of the detection data and the mechanism is the coordinated action of reading the data, and is a ladder diagram program.
The data calculation processing subroutines perform the analysis and calculation required for the biochemical analysis, and the subroutines are written by the ST language.
4) Arrangement of hardware
The movement and control of the automatic mechanism (including the automatic selection and conversion of the light sources with different wavelengths for colorimetry) are realized by the high-speed pulse output port and the common DO port selection to control multiple micro stepping motors, wherein the movement of the mechanism is controlled by DI, high speed DI and The AI ​​accepts motion and position feedback signals to control the stepper motor.
The temperature of the constant temperature bath receives the temperature sensor from the AI ​​and is realized by the PLC's PID combined with pulse width modulation to drive the heating element. Control accuracy up to ±0.05°C, typical values ​​up to ±0.1°C.
The data is read into the AI ​​by the front-end logarithmic operational amplifier. Since the PLC can set the digital filter parameters. Therefore, data acquisition can completely maintain the required accuracy.
The communication between the PLC and the man-machine interface is realized by the RS232 serial port of the PLC. The PLC's own MODBUS protocol can be adopted, and the free protocol function block provided by the PLC can also be used, so that the programming is more convenient. This system uses a free communication protocol.
IV. Conclusions and Prospects In recent years, the new PLC brand on the industrial control market has no shortage of small, high-performance PLCs. Moreover, if instrument designers use more PLC products, PLC manufacturers will surely continue to improve the performance of PLCs and accommodate single-board machines. In this way, designers will have more convenient design methods and software and hardware options. This will shorten the development cycle of new products and increase product varieties, so that users, instrument developers and PLC manufacturers will all benefit.

Posted on