Restoring the pipeline
Restoration of the work of the household chemical bottling conveyor
The statement of the task was as follows: the conveyor of bottling household chemicals stopped working for an unknown reason. The Simatic s7 1200 Siemens controller went into stop mode and refused to work. Restarting the power controller did not help. The conveyor was idle, which led to serious losses. The owners urgently needed to restore the line's operability.
Later it was possible to understand why the old systems on similar PLCs Siemens Simatic s7 1200 get up. If over time there are power supply defects in the control circuits of the 24VDC sensors (if the power supply is combined with the power supply of the PLC), and they begin to "short" on the housing, then the controller perceives this as a critical violation and stops operation, switching to the "Stop" mode.
At the same time, I didn't know how to get out of this mode (reset it) at the time of working with it, especially if there was source code, I just loaded the software into the controller.
This is what cabinets look like after 10 years of operation
The project used the OMRON module, which transformed discrete pulses into an analog signal 0-10V, which then controlled the frequency converter according to the scheme, changing the speed of the conveyor.
The owners really had the source code (PLC program), but from TIA Portal 11. Of course, there was no such thing on my computer, and it seemed inappropriate to install a new image for a single case. But there were versions of TIA Portal v13 and TIA portal v17, which made it possible, with sequential conversion, to make the original project with a relatively fresh version of TIA-Portal. After conversion, I downloaded the software to the s7 1200 controller. The program worked, but not as before.
The first telltale symptom in the work of the program appeared immediately after loading - the main engine of the conveyor stopped starting. According to the staff, in the old erased version of the PLC, the drive was working and the conveyor belt was moving. The principle of operation of the conveyor (its moving part) It was based on the operation of a frequency drive, through the PWM output conversion module (pulses) into an analog signal.
Why this function stopped working and for some reason, it is no longer clear. It was after several conversions and downloads that it stopped working, while there were no other errors and the rest of the code seemed to work.
The style of the Czech project
This is what the project looked like, all variables are executed in Czech. Before understanding the assignment of variables, I had to guess. Given the nesting and the many cross calls of variables, it was difficult to understand what depends on what.
What to do? The conveyor is still standing, but you need to work. We have connected with the Czech authors of the code (fortunately, despite the sanctions, they are responding and trying to help). The Czechs connected via remote online access and started conducting remote Comission, communicated with me in English (I forgot how to say "piston" and was very worried about it). They found some kind of source code (program), downloaded it, and the pipeline started working (went). Everything would be fine, but only the logic of the system did not suit the customer. It did not work as required by the technology, it snacked on the tank supply bar, did not change the tape speed correctly.
It should be said that the conveyor of bottling household chemicals is mechanically arranged quite difficult. Some of the moving axes may come into conflict with others, and mechanical damage to stainless steel elements is likely. It should also be noted that in addition to program logic, hydraulic and pneumatic logic were present. Therefore, the program should work perfectly, taking into account all possible conflicts and joint locks.
In the process of debugging the program code with an employee of a Czech company, there were constant opportunities. Then one axle will go the wrong way, then the other and in the end everything will stop. We dealt with the author of the code for quite a long time, but we could not launch it.
I started to deal with the existing code on my own. It turned out that the program code is made entirely in FBD, the variables are all in Czech, and the comments are very brief. Many variables are read and written many times, from where what connects, it was not possible to figure out right away. And, most importantly, the variables did not have any comments, in any language.
Here you can clearly see from how many places the program code was accompanied by an entry in the same variable. This made it very difficult to understand and find the reasons why a particular device is under the influence of power.
We fiddled with the Czech programmer for at least 5-6 hours until the latter threw up his hands and said that it was easier to write this code again, that at the moment this code could not be restored, because something was lost under the influence of time. Or they can't figure out why it doesn't work now. That this analysis takes time and requested an amount of several hundred euros per hour of work to restore the operability of this pipeline.
Such a request seemed excessive to the customer and he asked if I could rewrite this software so that the conveyor would start conflict-free movement to fill bottles. I replied that I would try to write overnight.
This situation amused me a little, because by this point I was already mentally ready to rewrite the entire program from scratch, since I had been sitting and studying how everything works for a long time. I put the customer at a common table (fortunately, the customer knew the technology well), and together they began to compile descriptions of algorithms. The composition of the controller signals was small, and we quickly compiled an I/O table.
A list of conveyor states was compiled. It turned out that there can be 12 unique states. The status of the discrete outputs in each of them was described.
Forcing the outputs from the program, we analyzed what was happening to the system. Updated data on the control algorithm were received. After that, the state machine was prescribed, and we manually tried bottling, constantly eliminating the identified shortcomings. When we saw in manual mode that the pipeline was working satisfactorily on the whole, we prescribed the transition conditions and launched the algorithm in automatic mode.
So by the middle of the night, all the state variables began to work out relatively correctly.
Along the way, a question arose with the operation of the control panel. I had to call and register the communication variables from the panel to the PLC, since there was no time or energy left to rewrite the panel code.
Then there were several more trips to the facility, as we failed to take into account all the dynamic features of the transitions. We also had to separately register the locking scheme, without which we almost broke the conveyor a couple of times.
At the end of the work, it was necessary to think over and write a code for counting the number of filled bottles. Immediately, I could not create a correct algorithm for calculating the number of filled containers, taking into account the speed of the tape, since the bottles go heterogeneously: sometimes often, then very rarely. When the conveyor is stopped, the yield rate of the product should begin to fall in proportion to the amount of previously produced products. The forecast of output per hour is important to the customer, because based on this number, he calculates the number of workers who need to be involved in the shift.
At the end of the work, the pizza came in just fine
#Restorations7-1200, #writingaconveyorprogram
Be the first to comment