I. Introduction
I wrote about PLC technology in about 2004. It mainly talks about the internal principles and applications of PLC. In addition, I also comment on various brands of PLC at home and abroad from a technical point of view. Although the age is long, it is good for PLC technology.
There is no development in the technology, and it can be used as a reference for some beginners in industrial control.
Everyone may feel very upset: "What qualifications do you have to make irresponsible remarks? We Chinese people have not developed a decent PLC since the 1970s. It seems that you have mastered the core one.
kind. "
Whether or not you are qualified is one thing, but whether you say it or not is another thing! I said, listen! What's wrong, scold it! If you are right, please unite! If you don’t know if it’s right, please don’t go out
Sounds, just assume that I am right :)
An angry young man next to me jumped and said, "If you are not doing business, you run to the forum to fill the water. Is there any conspiracy?"
Yes! For 20 years, my old man has been busy from morning to night every day. Why did I have nothing to do when I was full, so I came here to show my ugliness?
Lao Mao said: "There is no love without a reason or hatred without a reason". Let me tell you these things. First, I want to increase the popularity of PLC technology research in China, and second, I want to cling to it in recent years.
The persistent platform R&D strategy encourages everyone, and the third is to use our ECS, which saves me from speaking out and everyone thinks that we are not working :)
Here are two points:
First, the technology of any product of any manufacturer mentioned here is a published patent or deduced from the technical manual and test performance of your product. If there is any misleading, please contact the technical experts of each manufacturer.
K. I have limited time and poor memory. If I make a mistake in the rush, please point it out.
Second, because I work in Rectangle Technology, all examples will use rectangular products as examples.
The joke belongs to the joke, let me talk about some stuff I want to communicate with you first! (Editor’s note: There is more content and will be released in several chapters, so stay tuned)
1 Introduction
2. Introduction to PLC and PLC types, including the differences and advantages and disadvantages of each type, and guess the type of each manufacturer at the same time;
3. The significance of PLC to China's industrial control industry;
4. Industry integration;
5. Realization and application of basic functions;
6. The realization and application of communication functions, and fieldbus technology (Modbus, Profibus, FF, CAN, LonWorks);
7. Realization and application of temperature control;
8. Realization and application of motion control;
9. Industry application
10. Miscellaneous
Two, the introduction of PLC and the type of PLC
1 Introduction
At first I wanted to write the inside story, but I felt that the inside story was too formal. I didn’t know if I had the patience to write it down, so I changed it to a technical talk, so there was no responsibility. Ha ha ha, please support me.
Today I’m going to talk to you about "Introduction to PLC and Types of PLC". Many people have already mentioned the previous item in this forum. I think everyone is familiar with this history, so I don’t need to spend much time. Simply put, in 1968, General Motors wanted to replace the relay control device with a new electrical control device to adapt to the changes in the production process. For this reason, the company proposed in the bid:
1) Easy to program, the program can be modified on site;
2) Convenient maintenance and adopts plug-in structure;
3) The reliability is higher than the relay control device;
4) Data can be directly input into the computer;
5) The input power can be city power;
6) The output power supply can be city power, and the load current requires more than 2A, which can directly drive solenoid valves and contactors, etc.;
7) User memory capacity is greater than 4KB;
8) The volume is smaller than the relay device;
9) The original system changes minimally during expansion;
10) Compared with the relay control device, the cost has a certain competitiveness.
In 1969, the American digital equipment company DEC made the world's first programmable logic controller PLC. Since then, PLC has become one of the most commonly used control devices in the industrial field.
DEC was later acquired by MODICON, and MODICON was later acquired by Schneider, so now Schneider claims that they are the inventor of PLC.
The first-generation PLC implementation uses a bit-slice CPUs called 2901, and its manual can be downloaded from the Internet.
If you have a certain understanding of CPU and MCU, you must know that each type of CPU has its specific design and application direction. What are the characteristics of the CPU required by the PLC?
The basic requirements of the first generation PLC processor:
1) Strong logic execution ability;
2) It has a strong bit processing capability, and there are special instructions to facilitate the read, write and operation of bits in the memory;
3) In line with the original habit of controlling parallel processing by relays (Note: Most CPUs are processed in series)
At the same time, there is such a basic situation:
1) 80% of PLCs only need a small number of points (1 to 128 I/O);
2) 78% of PLC I/O is digital;
3) 80% of PLC applications only need to call 20 basic commands.
2901 is an antique of the same generation as 4004 (1971). The most famous one is the AM2901 developed by AMD in 1969. It has many features in in-position processing and is more suitable for the needs of PLCs at that time. Until now, most of the hard PLCs are still Use a new generation of bit processors similar to the 2901 architecture.
Simply put, the PLC at that time consisted of a bit processor + program memory + data memory + IO + power supply, which is also the core of most PLCs now. At that time, in order to allow the electrical engineers who used the relay control device to learn the use of PLC as soon as possible, the ladder diagram language was designed.
2. Technical classification of PLC:
After more than 30 years of development, there are now many variants of PLC, but the implementation methods are mainly divided into two categories: hard PLC and soft PLC:
Hard PLC is divided into parallel vertical scanning and serial horizontal scanning, and soft PLC is divided into two types: compiled type and interpreted (virtual machine).
2.1 Hard PLC
Hard PLC is the traditional form of PLC. Until now, most of the high-end products of mainstream manufacturers are hard PLCs. Because PLCs have higher and higher requirements for communication and data computing capabilities, most hard PLCs use dual-processor structures. A general-purpose processor is responsible for maintenance, communication, IO access, and function block calculations, and another bit processor is responsible for executing logic instructions. This is why high-end ControlLogix series like AB can reach 0.01us/instruction. You may think this is What's so great? Isn't it 100MIPS? Now P4 has reached 4G.
This is very different, because the granularity of instructions is different, and the scope of application is also different. A function block of the PLC is actually equivalent to a function in the C language, that is to say, the block header is relatively large, and it is not the same dimension as the instructions of the CPU.
I just said that most of the hard PLC architectures have two processors. It is also possible that one chip has two functions, one of which is a general-purpose processor and one bit processor. The bit processor is responsible for processing logic, and the general-purpose processor is responsible for communication, driving, function block operations and other tasks. At the same time, hard PLC is divided into parallel vertical scanning and serial horizontal scanning. At present, there are manufacturers that use both processing methods. The difference between the two sides is that the advantages of parallel vertical scanning are:
1) Fast speed (in an ideal situation, parallel scanning is faster than serial scanning. Scanning the rows of the matrix. For example, the nominal speed of the rectangular V80 is 0.2us/instruction, but it is faster than other serial scanning that is also 0.2us/instruction. The PLC can theoretically be 7 times faster);
2) It can support online programming;
3) The programming software can save most of the compilation work.
On the contrary, the advantages of serial scanning are
1) More in line with the thinking habits of software engineers;
2) The size of a single network is not limited by the size of the parallel scan matrix.
If you are interested, you can remove one or two PLCs, such as Mitsubishi's Q series, Schneider's Quantum, etc. There will often be an MCU marked with the manufacturer, and this one is their bit processor. At the same time, you can go to the State Patent Office to download the patents of major PLC manufacturers. In terms of hard PLC, everyone’s technology is actually the same, but everyone deliberately makes their technology more vague, so that they can protect their technology on the one hand. On the other hand, it can easily pass the patent certification.
Note: The parallel processing mentioned here does not mean that all instructions are processed in parallel. The main reason is that instructions and non-instructions are omitted and or instructions are parallel.
I won't say much about the technology of hard PLC. I posted a diagram of the hardware problem-solving processor architecture that was designed ten years ago, and those skilled in it may be able to understand it.
2.2 Soft PLC
Most of the soft PLC architectures only have a general-purpose processor. The emergence of soft PLC is mainly based on such a consideration: the price of general-purpose MCUs is getting lower and lower and the performance is getting higher. In particular, the interpretive virtual machine architecture has been used in DCS for many years, so in the past few years, everyone has launched their own soft PLC.
At present, most small PLCs in China are soft PLCs. The MCUs used are mainly Hitachi H8 and Siemens C164 series, and most of the other low-end PLCs are 89C51. In the realization of the above, most small PLCs use the compiled type, because most small PLCs use low-end and low-speed MCUs, and there is not enough resource cost to use interpreted operations. On the contrary, many medium and large soft PLCs adopt interpretive processing methods. For example, commercial ISAGRAF, KW, and one-sided echelon can all be compiled or interpreted according to the needs of users.
Generally, the hard PLC is 10 to 100 times faster than the compiled soft PLC, and the compiled type is 3 to 10 times faster than the interpreted type. Everyone knows the difference between C language and BASIC. C language is a compiled language, and BASIC is an interpreted language. There are also two similar implementations in the soft PLC.
So which way is better?
This cannot be said simply as good or bad. If it is a DCS or a medium and large PLC that uses a CPU above Atom, then the speed is not the key, and more importantly, the function and flexibility, then the interpretation type can be a good solution online Functions such as programming and custom function blocks. On the contrary, if in a small PLC, cost and performance become a key contradiction, how to achieve the highest performance at a low cost becomes the key. At the same time, most small PLCs do not need very complicated functions, so true compilation should be the best. Choice, but because the reliability is not easy to do, so the interpretation is popular.
Foreign small soft PLCs use Siemens C164 and Hitachi H8. In particular, Hitachi’s H8 has a wealth of bit instructions, which can better solve the bottleneck bit processing speed of soft PLCs. In most cases, PLCs are bit-based. deal with. Most domestic soft PLCs use SMT32 except for a few imitation technologies or OEMs from abroad. They have both compiled and interpreted types in the implementation. How to distinguish between compiled and interpreted? In fact, just look at the speed. The slower single instruction is mostly interpreted, and the opposite is compiled.
The realization of the compiler type, simply means that the PLC instructions and function blocks are first written in C language or assembly language into a function library, and then a framework code is written in C language. After the user writes the program with the ladder diagram, the ladder type The graph compiler will generate a frame file, replace the functions of all instructions, call the C compiler, and finally generate a binary file of the single-chip microcomputer, download it to the controller, and execute it by the controller. I just said that there is a framework code, which realizes communication, IO driver, management and other functions. The logic is all completed by the instruction combination of the function library. If you have the basis of the compilation principle, you will understand when you listen to it. This actually avoids the most troublesome problem in PLC development, which is the compilation tool.
Interpreted implementation is simply a virtual machine architecture. The manufacturer defines a virtual machine instruction. In fact, this virtual machine is equivalent to a soft CPU. It also has its instructions. For example, its instructions are required by IEC61131-3. Instructions etc. The virtual machine retrieves the instructions from the code one by one when it is running, and jumps to the corresponding instruction through a lookup table to run. If you have an understanding of the early mainframe computers, you will know that the mainframe resources at that time are very precious. Generally, many programmers share a mainframe computer, such as the PDP series. After the programmer writes the program, he enters his program into the mainframe and queues it up through the terminal. Because the mainframe manufacturer is different, the machine code of each manufacturer is also different, so everyone runs a virtual machine on the mainframe to unify the programmer's counterpart instructions.
2.3 Selection and comparison of PLC technology:
When Rectangle first started to develop the controller, it was a soft PLC (PPC31 series of medium-sized PLC in 2001), and it was implemented in an interpreted manner. This is suitable for medium and large DCS or PLC, but it is more painful if you want to consider the cost performance. However, especially for the interpretation type, the speed of small-scale PLCs used at home and abroad is generally quite slow, such as several series of Koyo and most of the new small-scale PLCs in China. Of course, it does not mean that the interpretation type is not good, but to achieve the same performance requires higher CPU cost and memory cost.
Later, after a period of time, we developed a compiled soft PLC (PPC22 series medium-sized PLC in 2003). The main feature of this series is that the speed is much faster than the interpretation type. At the same time, it is very convenient for users to add new function blocks. , You only need to call the C function written by the user as a function block. At present, some domestic PLCs and some imported PLCs adopt this technology. PPC22 uses a 486 industrial SOC chip, which has a relatively high cost and is mainly used in engineering and large equipment. On the contrary, many small domestic PLCs use 89C51. Really compile, if you use the standard frequency of 12M 51, you will obviously see that the manufacturer's nominal PLC Boolean instruction execution speed is 1us/instruction.
When Rectangle was preparing to enter the equipment supporting small PLC in 2004, we thoroughly studied the technical structure and implementation methods of most existing small PLC manufacturers, and found that if the hard PLC structure is not adopted, it will not be able to provide at low cost. Higher performance, and at the same time, to actually run online programming, you can only use the parallel vertical scanning hard PLC structure. For example, Mitsubishi's medium-sized A series and Q series are both hard PLC structures. Among them, the A and Q series are parallel vertical scanning hard PLCs. Also use the parallel vertical scanning hard PLC structure and most of AB’s PLCs, except for one of them. Outside of a kind of small PLC. Siemens S7-300 is also a hard PLC, but S7200 is a soft PLC. After understanding, we also did some analysis on the encoding and decoding formats of various PLCs, which are basically the same, but to prevent the trouble of intellectual property rights and deliberately separate the encoding formats by mistake. In the development process with the small PLC V80, we also developed the PPC11 medium-sized PLC with the same hard PLC structure. Both use the same software and hardware structure, but there are some differences in function and performance.
Therefore, we should say that different technologies should be used in different places. Technically, there is no way to say which one is better, but from the mainstream of PLC, hard PLC has irreplaceable performance advantages (far more than the advantage in nominal speed. Many PLC manufacturers like Siemens, Mitsubishi, AB have their own soft PLCs, but their mainstream high-end products are still hard PLCs. The details may not be finished in a day or two. It’s simple It is the difference between reliability and cost performance. An expert from Japan’s Toshiba Corporation’s Automation Division has had several in-depth technical exchanges with me. He said that Toshiba’s next-generation integrated controller is still a hard PLC structure. What’s more special is that they will process multiple blocks. The processor module can run in the same architecture. One processor module handles PLC, another handles DCS, one handles PC, and the other handles operation control. Data can be shared among the four, and each program is compiled and communicated with each other without affecting each other. , It's quite interesting.
Three, summary
The core point of PLC development lies in a stable hardware platform + efficient execution architecture + mature compiler. These core technologies are not convenient to talk about too much. After the popularization of PLC technology in two years, we will write a special book to analyze Our development achievements and gains and losses over the years. Domestic comrades who are engaged in PLC research can also write to me and call us for exchanges.
I fainted. I haven’t sorted it out for a long time. I don’t know how deep it should be, so it’s a bit messy. Please forgive me. I must make it easier to understand in the next few chapters.
RAM/RFM electric heating capacitors
RAM/RFM Electric Heating Capacitors
Electric Heating Capacitor,Film Heating Capacitor,Electric Capacitor Bank,Induction Heating Capacitors
YANGZHOU POSITIONING TECH CO., LTD. , https://www.cndingweitech.com