Share this

Upgrade and renovation of the unloading machine control system

2026-04-06 06:08:48 · · #1

Updatingelectriccontrolsystemofadecrater

Guan Chong, Beijing Lvchuang Ecological Technology Co., Ltd.

Abstract: This paper describes the ideas and methods for upgrading the electrical control system of the unpacking machine in a beer bottling line from S5 to S7. It describes the corresponding modules for hardware upgrade, the handling methods of difficult statements in the programming process, the addressing method of the AS-i bus, and the ideas and programs for Gray code conversion statements.

Keywords: Siemens S5 and S7, PLC, AS-i bus and Gray code

Our company purchased a 32,000 bottles/hour beer bottling line in 1998, manufactured by the German company KRONES. The unpacking machine of this bottling line has a production capacity of 36,000 bottles/hour and has been operating well for more than ten years. The control system of the unpacking machine uses a Siemens S5-115U series PLC for control, which is stable and reliable. Last May, the PLC malfunctioned and production stopped.

I. Functions and Structure of the Unloading Machine

This unloading machine consists of a bottle conveying device, a carton conveying device, a bottle gripping device, a double four-bar linkage, a frame, a pneumatic device, and an electrical control system. When a plastic carton full of beer bottles passes by on the conveyor belt, a stop cylinder rises to stop the carton, and a separating cylinder drives a separating frame to separate the carton, ensuring each bottle is aligned with a bottle gripping device. Simultaneously, the bottle gripping device descends onto the bottle, the gripping cylinder activates, grabs the bottle, and then the gripping device rises to place the bottle on the conveyor platform. Empty cartons are then released, and full cartons arrive, repeating this process. Six cartons are unloaded at a time, with each carton containing 24 bottles, so one cycle unloads 144 bottles.

The mechanical part is relatively simple, and the wear parts are replaced every year, so it is in good operation. The electrical part is mainly driven by two synchronous motors to drive a double four-bar linkage mechanism. To ensure that the two motors run synchronously, encoders are installed on the motors. The PLC reads the data at any time, compares it, and automatically adjusts to ensure that the two motors are synchronized. The stop box, the split box, and each cylinder all move according to the encoder value, so the encoder value is crucial.

II. Renovation Approach and Process

The malfunction was caused by a damaged PLC. To lay the foundation for future upgrades of other equipment and save money, the company decided to upgrade the unloading machine by replacing the control system with an S7-300 system. The upgrade consisted of both hardware and software modifications.

Hardware upgrades and modifications

Its hardware consists of a power supply module, a CPU main module, an AS-i communication module, and a digital input/output module. The upgrade and replacement modules are shown in Table 1.

Table 1

Module Name

S5 module model

S7 module model

Base plate (rack)

6ES5-700-2LA12

6ES7 390-1AF30-0AA0

Power supply

6ES5—951—7ND21

6ES7 307-1EA01-0AA0

CPU

6ES5—943—7UB11

6ES7 314-6CF01-0AB0

AS-I module

CP2430

6ES7 342_2AH01-0XA0

Input module (input)

6ES5—430—7LA12

SM 321 DI32×DC24V

Output module (out)

6ES5—451—7LA12

SM 322 DO32×DC24V

2. Software upgrades and modifications

The S5 series PLCs were early Siemens products. Their programming software ran on the MS-doc system, which uses completely different language statements than the current S7-200 and S7-300 PLCs, making direct conversion impossible. This posed significant challenges to retrofitting. Furthermore, S5 language statements were difficult to understand, and few engineers were familiar with them. Based on my summary, I believe the main difficulties are as follows:

First, block processing. The S5 program consists of organization blocks (BO), function blocks (PC), data blocks (DB), and program blocks (PB). These blocks have different functions and programming methods. The source program has 20 blocks. My approach is to understand the original S5 program, be familiar with the function, properties, and usage of each block, and understand the relationships and functions between blocks. Then, I convert it line by line into the S7 program. After writing, the organization blocks of S5 and S7 are similar and have few changes. I convert the function blocks of S5 into subroutine blocks of S7, and the program blocks of S5 into program blocks of S7.

Second, statement processing. For statements in S7 and S5 that have the same function, simply copy them. Statements with similar functions, such as LPY13 in S5 (reading the 13th byte) and LIB13 in S7, are essentially similar. Just ensure the function is the same. For example, calling data block 22 uses OPENDB22 in S5 and CDB22 in S7, which are different. Also, data in S5 is double-word, while in S7 it's single-word, corresponding to DBW0, DBW2, DBW4, and DBW6 in S7 (even-numbered), unlike S5. Some statements exist in S5 but not in S7. In such cases, their function needs to be understood, and they can be replaced with combined statements in S7. For example, S5 has the statement DOFW120SLW0, but this statement doesn't exist in the S7 statement table. Conversion is needed; in Table 2, the underlined statements show clever conversions between them. Other statements can also be converted to each other.

Table 2:

S5 statement

S7 statement

L IB 10

L KH 000F

AW

T MW 120

L KH 0001

T MW 178

DO FW 120

SLW 0

T MW 178

L IB 10

LW#16#F

AW

T MW 120

LW#16#1

T MW 178

T #CONV_AKKUL1

TAK

T #CONV_AKKUL2

L MB 121

L #CONV_AKKUL1

SLW

L #CONV_AKKUL1

TAK

T MW178

Third, find the correspondence of AS-i bus addresses. The AS-i bus, also known as the "line-saving mode" in Europe, uses the CP2430 to control two buses (MasterA and MasterB). Its difficulty lies in understanding the bus addresses. By carefully reading the source code and comparing the addresses of field devices, patterns and corresponding sequences can be found. Each bus carries 31 stations, each with a four-bit address. The correspondence is shown in Table 3. In Table 3, only the starting address 64.0 is fixed; the remaining addresses are arranged sequentially, up to 79.7. Special attention must be paid to the address order and the addresses used during programming. Also, the four bits of station #0 cannot be used. Simultaneously, the addresses correspond to these in STEP7 programming, thus solving the difficulty of bus control addresses and simplifying the programming process. Modifying the default addresses in STEP7 only requires changing the starting address.

Station Number

Site #0

Site #1

address

64.3

64.2

64.1

64.0

Station Number

Site #2

Site #3

address

65.7

65.6

65.5

65.4

65.3

65.2

65.1

65.0

And so on, stations 4 through 29 are omitted.

Station Number

Site #30

Site #31

address

79.7

79.6

79.5

79.4

79.3

79.2

79.1

79.0

Fourth, numerical conversion. The main shaft of this unloading machine is driven by two synchronous motors with reducers. To synchronize the two reducers, absolute encoders are installed on them. When the difference between the two encoders exceeds a certain value, it indicates that the main shaft is faulty and the machine must be stopped for correction. These two encoders are Gray code encoders. Gray code is an unweighted code that uses absolute encoding. A typical Gray code has reflective and cyclic characteristics. Gray code must be converted into binary code, and then into decimal code for comparison. Converting binary to decimal is easy. The rule for converting binary Gray code to natural binary code is to retain the highest bit of the Gray code as the highest bit of the natural binary code, and the second highest bit of the natural binary code is obtained by XORing the highest bit of the natural binary code with the second highest bit of the Gray code. The remaining bits of the natural binary code are obtained in a similar way to the second highest bit of the natural binary code. For ease of understanding, I use the double word 1011010011111101 as an example for conversion. The steps are shown in Table 4. The conversion result is 1101100010101101.

Bit Encoding

15

14

13

12

11

10

9

8

7

6

5

4

1

1

0

1

Graymall

1

0

1

1

0

1

0

0

1

1

1

1

1

1

0

1

Shift one position to the right

1

0

1

1

0

1

0

0

1

1

1

1

1

0

1

1 XOR result

1

1

1

0

1

1

1

0

1

0

0

0

1

1

0

1

Shift two positions to the right

1

1

1

01

1

1

1

0

1

0

1

1

0

1

2 XOR results

1

1

0

1

0

1

0

1

0

0

1

0

1

1

0

1

Shift right by 4 bits

1

1

0

1

0

1

0

1

1

1

0

1

3 XOR results

1

1

0

1

1

0

0

0

0

1

1

1

1

1

0

1

Shift right by 8 bits

1

1

0

1

1

1

0

1

binary number

1

1

0

1

1

0

0

0

1

0

1

0

1

1

0

1

The program conversion is shown in Table 5. In the S7 statement, the values ​​read from the input bytes PIB12 and PIB13 are stored in the data word DBW. The binary number is obtained by shifting and XORing and then stored in DB22.

Table 5

S5 statement

S7 statement

C DB 110

L PY 12

TDR 1

L PY 13

L KM 00000000 00000111

AW

T DL 1

L DW 1

T DW 2

L DW 2

SRW 1

XOW

SRW2

XOW

SRW4

XOW

SRW8

XOW

T DW 11

OPN DB 110

L PIB 12

T DBB 3

L PIB 13

L 2#111

AW

T DBB 2

L DBW 2

T DBW 4

L DBW 4

SRW 1

XOW

SRW2

XOW

SRW4

XOW

SRW8

XOW

T DBW 22

III. Renovation Time and Results

1. Specific timeframe for the renovation

On May 20, the company decided to adopt an upgrade approach. Starting from May 21, we contacted Siemens to purchase S7-300 series PLC cards and began writing the program. On June 1, the PLC cards were installed and wiring and debugging began. During this period, some programs were repeatedly modified. Finally, on June 10, the program was successfully delivered to the workshop for use. The upgrade took 20 days.

2. Renovation effect

Regarding the performance of the unloading machine: The upgraded unloading machine, incorporating suggestions from operators, is more practical and easier to operate, reducing downtime. Regarding spare parts management: Due to the use of the S7-300 control system, Siemens S7-300 series spare parts are readily available. Calculations show that the original S5 required 120,000 RMB worth of spare parts, while now it only requires 18,000 RMB, facilitating spare parts management. Regarding cost savings: This upgrade saved 80,000 RMB compared to replacing S5 components.

Read next

CATDOLL 146CM Ya TPE (Customer Photos)

Height: 146cm A-cup Weight: 26kg Shoulder Width: 32cm Bust/Waist/Hip: 64/54/74cm Oral Depth: 3-5cm Vaginal Depth: 3-15c...

Articles 2026-02-22