IT in Manufacturing


Machine learning optimizes real-time inspection of instant noodle packaging

April 2021 IT in Manufacturing

Instant noodles can be found in just about every food store in China. In order to reduce the number of products with packaging errors and the resulting customer complaints, a large Chinese producer of instant noodles decided to use the Beckhoff control technology including TwinCAT Machine Learning. This made intelligent and reliable real-time inspection of the packaging quality possible.

Tianjin FengYuLingKong Electrical and Mechanical Equipment Company, a system integrator specializing in industrial automation, was awarded the contract to supply a state-of-the-art packaging inspection system to one of China's largest producers of fast food and beverages. According to the food manufacturer, it has the world's largest instant noodle production lines, with an average throughput of around 500 packs per minute per line and an annual total throughput of up to 4,8 billion packs.

High customer satisfaction through error-free packaging

Packaging and sealing are essential tasks in the manufacture of instant noodles. A noodle pack usually contains a pre-cooked noodle block plus several small sachets with spices, e.g. flavoring powders, sauces and dried vegetables. In the production line, these individual sachets are arranged on a conveyor belt moving at high speed, placed on the associated noodle block and then forwarded together to the cross-cutting sealing and packaging machine.

During the production process there are various factors that can potentially lead to the seasoning sachets slipping between two noodle blocks and being cut open by the cutting machine or being packed separately in two packets side by side. Such defective products would result in consumer complaints and damage to the company's reputation, for which reason delivery of such products to dealers should be reduced as far as possible. Since the machine type upgraded by Tianjin FengYu already produced with a very low error rate before, another aspect of quality control is critical: It must be ensured that only the defective and not the defect-free products are reliably sorted out.

Because the processes inside the sealing and packaging machine cannot be viewed and any packaging defects often are also not visible from the outside during the subsequent optical inspection, it is very difficult to find out the exact cause of the errors mentioned above. It is therefore virtually impossible to avoid defective products on principle. In order to avoid delivering substandard goods despite that, instant noodle manufacturers use highly automated quality inspection devices with minimum latency.

Image copyright ThamKC, AdobeStock

Tianjin FengYu supported the end user in this project with the fast implementation of a high-performance quality control system. First of all, the mechanical and electrical parts of the machine were examined. According to Tianjin FengYu, in the process they found out that due to its openness and flexibility, PC-based control technology from Beckhoff is ideally suited for acquiring the necessary analysis data. The system integrator installed several sensors inside the machine and was able to acquire the first datasets for prototypical analysis quickly and easily via TwinCAT Scope View. The subsequent data analysis showed a certain sensitivity of the measurands that occurred when a machine had wrongly cut a seasoning sachet. However, such disruptive events resulting in faulty products could not be reliably detected using conventional engineering methods. The reasons are several uncertainty factors that can affect the data, such as machine vibrations as well as changes in the packaging material or the conveying speed and the cutting tension. To find a solution for this demanding analysis application, Tianjin FengYu decided to use TwinCAT Machine Learning as a means of implementing data-based engineering with machine learning (ML).

Machine learning in industrial applications

The basis for an inspection of products is classifiers, the use of which enables flawless products to be distinguished from faulty ones. If ML-based classifiers are to be used, a mathematic model is trained on the basis of exemplary data so that from then on correct decisions can be made without explicit programming.

Beckhoff offers various tools and open interfaces to support the entire engineering cycle from data acquisition and model training through to the deployment of the learned model directly within the control system:

• Data acquisition: The quantity and quality of the data have crucial effects on ML applications. A wide range of I/O and software products from Beckhoff enable the acquisition of almost any data. Various functions of the TwinCAT software, such as Scope View, Database Server, Data Agent and Analytics Logger, enable the data to be saved on an Industrial PC, in local or remote databases or the cloud.

• Model training: The data acquired must initially be preprocessed in order to find a correlation between the data and the desired results or to strengthen the correlation. Subsequently, a suitable ML algorithm is identified and parameterized for model training. Beckhoff recommends the use of open and established ML frameworks for this purpose, such as PyTorch, Keras or Scikit-learn. Finally, the trained model can be saved as a file in the standard exchange format ONNX (Open Neural Network Exchange). The ONNX file describes the operations and parameters of the trained model and can then be converted into a binary format (BML) that is better suited for serialization in TwinCAT.

• Model deployment: The TwinCAT runtime environment for machine learning (TF3800 and TF3810) can load the trained model files (BML format) dynamically into the controllers, where the models can be run in real-time with execution cycles of less than 1 ms. In this way, the results of the inference (execution of a trained ML model) can be directly processed, transmitted to the output devices via the ultrafast EtherCAT communication and so the machine can be controlled in real-time.

The detection of faulty products in the instant noodle production line was implemented exactly according to the three-step method described above. First of all, sensor data was acquired via EL1xxx or EL3xxx EtherCAT digital and analog input terminals and TwinCAT Scope View. Subsequently, the ML model was trained via the open source framework Scikit-learn, and the model description file was generated from it. The necessary preprocessing of sensor data was implemented with TwinCAT Condition Monitoring in the control system. Then the corresponding BML file was deployed to a CX51xx Embedded PC, which runs the model in real-time with the help of the TwinCAT Machine Learning runtime and outputs the inference results for the identification of faulty products via an EL2xxx EtherCAT digital output terminal. According to Tianjin FengYu, the system openness is a great advantage of the Beckhoff control technology and was very beneficial here, because it could be integrated with the existing third-party main controller of the production line with no great effort.

Open platform accelerates algorithm development

The validation of ML algorithms is often a time-consuming and laborious process because of the necessary tests and the associated frequent visits to end customers. With the TwinCAT open software platform, however, algorithms can be validated efficiently without requiring direct access to the machine. The data recorded on a production machine is separated into training and validation data before model training is started. Only the training data set is then used to train the ML algorithm. The validation data set can initially be used in the training environment to test how well the learned algorithm performs on unknown data.

After successfully porting the data preprocessing and integrating the ML algorithm into TwinCAT, validation can be performed based on the production code. The code is executed on a test system – or the actually used Embedded or Industrial PC – and the validation dataset is streamed to the TwinCAT real-time environment for use as a virtual data source by means of TwinCAT Database Server functions. The same sampling frequency as with the on-site sensors is adopted, therefore the scenario at the end customer’s site can be optimally simulated. Similarly, new datasets collected on the production machine can be used in the test environment to explore a wide variety of situations. Ultimately, the test data serve to validate the entire ML application on the Embedded PC, to assess it and ensure safe operation.

The development, verification and validation using the open TwinCAT platform eliminates the need for testing the ML algorithms on industrial plants and considerably accelerates the implementation phase. According to Tianjin FengYu, this contributed to the fact that the progress of the joint project at this food company was barely affected by the coronavirus pandemic.

Multi-tasking and multi-core capabilities secure ML in real time

The ML algorithm is executed on the CX51xx in three steps:

1. Acquisition of sensor data.

2. Pre-processing of the data.

3. Execution of ML models for the detection of faulty products

On the one hand, it should be noted that the product inspection requires a high sampling frequency in order to acquire sensor data during the entire cutting process. On the other hand, a lower execution frequency is necessary in order to be able to process the acquired data and to execute the ML model. However, this apparent contradiction for two real-time sequences in one PLC task can be solved very well through the multi-tasking and multi-core capabilities of TwinCAT, because this ensures both the reliable execution of multiple tasks on different processor cores and the error-free exchange of data between multiple PLC tasks. Another advantage is that these functions can be implemented through simple configuration and via ready-made PLC function blocks with little development effort. In the project described for the instant noodle production, the two-step execution of the ML algorithm through the use of two PLC tasks and two processor cores was realized reliably.

Machine learning and PC-based control minimize effort

Through the approaches of machine learning and with the help of data mining, production problems can be solved faster and more efficiently, thus saving R&D; costs. The experiences of Tianjin FengYu with the instant noodle production line have shown that TwinCAT Machine Learning is superior to the traditional engineering methods in the detection of anomalies. With the open TwinCAT platform, it was possible to automate the complete workflow for data acquisition, training and ML inference. As of the end of 2020, the new quality inspection system has already been running fully automatically on several of the end customer's production lines for about four months. The customer's conclusion: Due to the open Beckhoff solution it was possible to implement the inspection system without modifying the existing main control system; faulty products are detected promptly and reliably, which effectively reduces customer complaints.

System integrator Tianjin FengYu pointed out that the use of the machine has become much simpler and more flexible through the Beckhoff products CX51xx, EtherCAT I/Os and TwinCAT. Despite the complex mechanisms of the production line on site, commissioning and maintenance was very simple with the great support of the Beckhoff engineers. Moreover, the open PC-based control technology has solved the problem of the quality inspection of packaging, also by using ML methods to acquire the data from existing noodle machines, irrespective of their make. Tianjin FengYu is convinced that more and more end users will benefit from TwinCAT Machine Learning in the near future.


Credit(s)



Share this article:
Share via emailShare via LinkedInPrint this page

Further reading:

Siemens’ PAVE360 to support new Arm Zena Compute Subsystems
IT in Manufacturing
Siemens Digital Industries Software is expanding its longstanding relationship with Arm and adding support for the newly launched Arm Zena Compute Subsystems in its PAVE360 software, designed for software-defined vehicles

Read more...
Fortifying the state in a time of cyber siege
IT in Manufacturing
In an era where borders are no longer physical, South Africa is being drawn into a new kind of conflict, one fought not with tanks and missiles, but with lines of code and silent intrusions. The digital battlefield is here, and cyber space has become the next frontier of conflict.

Read more...
Levelling up workplace safety - how gamification is changing the rules of training
IT in Manufacturing
Despite the best intentions, traditional safety training often falls short, with curricula either being too generic, too passive, or ultimately unmemorable. Enter gamification, a shift in training that is redefining how businesses train for safety and live by those principles.

Read more...
Reinventing data centre design: critical changes to meet surging
Schneider Electric South Africa IT in Manufacturing
AI technologies are pushing the boundaries of what is possible which, in turn, is presenting data centres with a whole new set of challenges. Fortunately, several options are emerging which include optimising design and infrastructure for efficiency, cooling and management systems

Read more...
Watts next - can IT save the planet
IT in Manufacturing
The digital age’s insatiable demand for computing power has collided with an urgent and pressing need for sustainability. As data centres and AI workloads consume unprecedented energy, IT providers are pivotal in redefining how technology intersects with environmental stewardship.

Read more...
South Africa’s digital revolution:
IT in Manufacturing
South Africa stands at a pivotal moment in its technological evolution, poised to redefine itself as Africa’s leading digital powerhouse. Over the past two years, political leaders and media narratives have painted a picture of rapid digital transformation, underscoring the government’s ambition to position South Africa at the forefront of innovation.

Read more...
Smart manufacturing, APC and the SA marketplace
Schneider Electric South Africa IT in Manufacturing
Manufacturers are prioritising the integration of smart technologies into their daily operations to stay one step ahead of the competition. In South Africa, some experts believe the country has the potential to leapfrog its global peers through the creation of smart factories.

Read more...
Schneider Electric’s Five-Pillar Strategy takes the guesswork out of equip
Schneider Electric South Africa IT in Manufacturing
Schneider Electric’s Field Service Cycle, otherwise known as the Five-Pillar Strategy, is a structured approach to managing the lifecycle of equipment to prolong asset lifespan while reducing the total cost of ownership for customers.

Read more...
Enhancing operational safety and efficiency through advanced risk-based modelling
IT in Manufacturing
Now, more than ever, capital and operational cost can be reduced while enhancing operational safety and increasing production uptime by applying transformative methods such as Computational Fluid Dynamics modelling.

Read more...
Beckhoff’s XPlanar boosts productivity in medical device assembly
Beckhoff Automation Fieldbus & Industrial Networking
The intelligent transport system, XPlanar from Beckhoff provided the basis for an innovative system concept allowing the specialists at Automation NTH to reduce the space requirement of an assembly machine for medical diagnostic devices by a factor of 10.

Read more...









While every effort has been made to ensure the accuracy of the information contained herein, the publisher and its agents cannot be held responsible for any errors contained, or any loss incurred as a result. Articles published do not necessarily reflect the views of the publishers. The editor reserves the right to alter or cut copy. Articles submitted are deemed to have been cleared for publication. Advertisements and company contact details are published as provided by the advertiser. Technews Publishing (Pty) Ltd cannot be held responsible for the accuracy or veracity of supplied material.




© Technews Publishing (Pty) Ltd | All Rights Reserved