Share this

Cutting-edge technology | How to automate machine learning? It only takes three steps!

2026-04-06 06:06:03 · · #1

When it comes to the hottest cutting-edge technology right now, artificial intelligence ( AI ) is undoubtedly at the top of the list. And the core of artificial intelligence is machine learning ( ML ). In other words, mastering machine learning means mastering artificial intelligence technology.

So, for industrial users, how can machine learning be introduced into the field of automation to break through the limitations of traditional automation technology? How can we quickly understand and master these complex concepts such as artificial intelligence, machine learning, deep learning, and neural networks?
This article, which can be read in just 5 minutes, will give you an easy grasp of machine learning concepts, key technologies, and how to apply them to industrial automation!

First , let's look at a motion control case that uses machine learning for optimization, so that you can have a basic understanding of machine learning.

These are two identical straight-line and circular-arc transfer tracks. However, we can see that the workpiece transport on the left track is very smooth, while the workpiece transport on the right track is very unstable, with rapid acceleration, almost causing the products to be thrown off. This not only greatly affects the workpieces on the track, but also causes severe wear on the track itself. The design of the workpiece movement curve on the right track is clearly inferior to that of the left transfer track.
So how can we design a motion curve like the one on the left? This is where machine learning comes in. By recording the workpiece's speed, acceleration, position, and other information multiple times, and then building a data model and continuously optimizing (training) the model, we can finally obtain an optimal motion curve. Why use machine learning for design? Because there are no existing curves (such as perfect circles, ellipses, involutes, etc.) for this motion curve design, and it cannot be calculated using mathematical equations. Therefore, we can only solve it by using machine learning's " algorithm model plus training . "

After reviewing this example, you should have a basic understanding of the role of machine learning. Now let's understand a few more common concepts.

Artificial Intelligence (AI)

AI that can mimic human intelligence is divided into weak AI and strong AI . Currently, AI is in the weak AI stage.

Machine Learning (ML)

To reach the level of weak AI, optimization can be performed based on mathematical models that can learn specific tasks through " training data " .

Deep learning (DL)

Focusing on deep neural networks ( DNNs ) as models, these are complex models that require large datasets for training and are currently mainly used for powerful vision applications.

The relationship among the three is one of subordination, as shown in the diagram below:

Simply put, machine learning involves building mathematical models based on various algorithms, continuously training these models with data to improve their accuracy, and finally running the trained models in real-world application scenarios to perform inference calculations and solve practical problems that are difficult to solve using ordinary mathematical methods.
Therefore, we can summarize that introducing machine learning into industrial automation requires three steps: collecting industrial field data, building and training the model, and downloading and running it in a real-world application, as shown in the diagram below:

Doesn't the process look simple?
Of course, the actual usage process is not that simple. Each step involves professional knowledge and tools. Below, we will introduce them one by one so that you can not only get started but also become an " expert " !

first step

Collect industrial field data

First, in the data collection phase, we need to collect field data using various sensors and test and measurement tools. This step will utilize many products from our automation control system, such as Beckhoff's TwinCAT3 Scope , TwinCAT3 Database Server , TwinCAT3 Data Agent , and TwinCAT3 Analytics Logger . These tools can be used to collect data into a local database or store and present it in the cloud for the next step of modeling and training.

Step Two

Model building and training

This step is crucial and arguably the most challenging and researched in machine learning. It begins by preprocessing the data collected in the previous step, including data cleaning to remove outliers, data transformation, and data integration. Next, feature data is selected to determine the mathematical model, which is then fine-tuned and validated using unknown data. After model training, a description file ( XML or ONNX file) is generated and exported for use in model execution environments such as TwinCAT3 . Feature data mining in this step—determining which data to extract for modeling—is critical to the success of the entire machine learning process and often requires expertise in the relevant industry.

In this step, building the model often requires the use of third-party frameworks (platform tools), such as Python SciKit , MATLAB Machine Learning Toolbox , and deep learning frameworks like TensorFlow ( Google ) , Keras (frontend for TensorFlow, CNTK, …) , PyTorch ( Facebook ) , MxNet ( Amazon ) , CNTK ( Microsoft ) , and MATLAB Deep Learning Toolbox (MathWorks) , most of which are open source and based on Python .

Of course, besides these frameworks, another important aspect is the selection and establishment of mathematical models. Mathematically, all problems can be divided into two main categories: regression problems and classification problems. Regression problems are typically used to predict a value, such as predicting house prices or future weather conditions. Classification problems are used to label things, usually resulting in discrete values, such as determining whether an animal in a picture is a cat or a dog. Solving these two types of problems requires different mathematical models, such as Support Vector Machines ( SVM ), neural networks, decision trees and random forests, linear regression, and Bayesian linear regression. These models already exist within the framework and can be used directly.
Here, it's also worth mentioning ONNX, an open neural network exchange file. This is an open file format designed for machine learning to store trained models. It allows different AI frameworks (such as PyTorch and MXNet ) to store model data in the same format and interact with each other. It is primarily developed by Microsoft and Amazon.   It was developed jointly by companies such as Facebook and IBM .

Step 3

Load the model into the controller and run it.

Having discussed model building and training, the final step is to load the model into an industrial computer or controller for computation. Since model description files cannot be recognized by industrial controllers, an automation control software platform like Beckhoff TwinCAT 3 is needed as an engine to load the trained model file onto the controller, enabling the application of machine learning in automation.
Currently, TwinCAT 3 has seamlessly integrated a machine learning engine interface. The trained model files (XML or ONNX ) can be converted into BML (Beckham's machine learning files) using the Machine Learning Converter ( ML Converter ) for encryption protection. After loading through TwinCAT 3 's ML Runtime , the trained model can be executed in real-time by the TwinCAT TcCOM object, and can also be called by PLCs and C/C++ -encapsulated TcCOM interfaces! If the neural network is small, such as a multilayer perceptron ( MLP ) with 10K weights, it can be called multiple times within a sub-millisecond task cycle to ensure real-time performance!

Furthermore, TwinCAT 3 's multi-core support is also applicable to machine learning applications, allowing different tasks to access the same specific TwinCAT 3 inference engine without mutual limitations. Machine learning applications have full access to all available fieldbus interfaces and data in TwinCAT , enabling them to utilize large amounts of data.

TwinCAT 3 now has two machine learning inference engines, TF380x TC3 and TF381x TC3 . The former is an inference engine for classic machine learning models, including Support Vector Machine (SVM), Principal Component Analysis (PCA), k - means , etc., while the latter is a neural network ( NN ) inference engine, including Multilayer Perceptron ( MPL ) , Convolutional Neural Network ( CNN ) , Long Short-Term Memory ( LSTM ) models, etc.

For example

How is the optimal motion curve determined by machine learning ?

Having reviewed the general methods above, let's now examine how the optimal motion curve of the transport track, mentioned at the beginning of the article, is optimized using machine learning.
First, we transform this motion curve optimization problem into a mathematical problem: within a certain time, find the optimal (gentlest) motion curve from pi clockwise to pf , while minimizing the acceleration during the motion.

first step

The goal is to collect data, including the workpiece's position, speed, acceleration, and time, and store this data for further optimization.

Step 2

Extracting feature data from step one to build a model

Step 3

The trained model is deployed to TwinCAT 3 via an ONNX file , thereby enabling the controller to achieve the optimal motion curve.

For example

A fan anomaly detection method that does not require fault data

Typically, predictive maintenance using big data analytics requires a large amount of fault data. However, in real-world industrial scenarios, there is often not much fault data available. For example, a wind turbine may not experience many faults in its first few years, with fault data only becoming available later. Machine learning methods can solve this problem, enabling fault detection without the need for existing fault data.
For example, to detect whether the fan on the server workstation shown in the image below is abnormal, machine learning can be used.

First, a large amount of data on fan pressure, speed, and vibration under normal conditions is collected using TwinCAT 3 Scope . This data is then read using MATLAB and trained using a one-class SVM (Support Vector Machine) model. After the model has learned from a large amount of normal data, it will automatically generate a boundary for normal data. Finally, the model is exported from MATLAB as an ONNX file, converted, and loaded into the TwinCAT 3 controller . This way, when the collected data exceeds the boundary, the controller will detect an abnormal situation in the fan.
This application appears quite simple, but the most challenging part is feature data mining and extraction, also known as feature engineering. As for data acquisition, model creation, training, and finally, execution on the controller, many existing tools and platforms exist, such as MATLAB and Beckhoff's TwinCAT 3. Standing on the shoulders of these giants, you can easily introduce this sophisticated new technology of machine learning into industrial automation by focusing on your industrial field knowledge and experience .

Read next

CATDOLL Beth Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22