1. Introduction
Metal forming is a fundamental process in manufacturing, particularly in sectors such as vehicle production and aviation [
1]. Such operations are characterized by high energy consumption due to the low efficiency of the metal forming presses [
2]. In this context, monitoring consumption is essential in order to optimize efficiency, especially if, as this article proposes, the part in production is detected along with its cycle time and the energy per cycle.
Energy analysis in industrial applications is a typical domain for artificial intelligence (AI) techniques [
3]. With respect to energy consumption estimation, AI-based applications are typically focused on long-term consumption forecasting, whereas real-time monitoring is more often oriented toward other aspects, such as product quality assessment [
4,
5]. For instance, in [
6], convolutional neural networks (CNNs) are applied to electrical signals to identify the operational state of the painting sector in an automotive manufacturing plant at daily and weekly timescales. On the other hand, ref. [
7] presents an example of a manufacturing process in which CNNs are used to classify process conditions by extracting parameters from acoustic signals in real time; however, this approach is not directly related to energy consumption estimation.
Previous works of the research group, see [
8,
9], have shown that detailed analysis of metal forming presses from electrical measurements and the use of Neural Network (NN) techniques have enabled identification of both the operating state of the presses and a breakdown of the energy consumed per cycle to give a precise characterization of the machine’s dynamic behavior. However, this analysis is performed offline, using records acquired with a commercial power quality analyzer, which allows the extraction of statistical results but does not enable real-time implementation. In contrast, the present article proposes the use of Support Vector Machine (SVM) techniques, which, in addition to their widespread adoption in industrial applications, offer several advantages over NNs, such as lower data requirements and greater robustness to noise [
4,
5,
10].
Accordingly, this paper presents a method for the real-time identification of the parts being produced, their production rate, and the energy consumption per manufactured part. For the classification task related to identifying the part under production, Support Vector Machine (SVM) techniques are employed, which are widely used in the manufacturing industry [
10,
11], and are combined here with time-domain features and a time–frequency analysis based on the Continuous Wavelet Transform (CWT). Finally, the production time required to manufacture each part and its associated energy consumption are obtained.
Additionally, the proposed system addresses a limitation associated with the slow update rate of conventional electrical measurements such as root mean square (RMS). Power quality analyzers commonly comply with the IEC 61000-4-30 standard [
12], which establishes minimum intervals of ten cycles (for a 50 Hz power system) when calculating magnitudes such as RMS voltage or RMS current. Although this requirement is adequate for electrical supply supervision, it does not record in sufficient detail the rapid current variations that occur throughout the different phases of the metal forming cycle. These short-lived phenomena, associated with abrupt load changes (such as the mechanical impact during part forming), contain relevant information not only on the machine’s operational state but also on its instantaneous energy behavior. Therefore, limited acquisition at ten-cycle intervals can lead to an underestimation of the effective energy consumed and a loss of useful information for accurately identifying working regimes.
With the aim of addressing the limitations of conventional measurement systems and advancing the energy characterization of metal forming presses, this study presents the development of a high-speed electrical parameter measurement system capable of real-time processing, designed specifically to acquire one-cycle RMS voltage and current signals. The system enables automatic classification of the production state using ML techniques and provides real-time estimates of both the cycle time and the associated energy consumption.
The article is organized as follows:
Section 2 describes the electrical parameter measurement system developed;
Section 3 details the preparation of the datasets and the classification procedure;
Section 4 presents the estimation methods for the cycle time and its associated energy;
Section 5 shows the results obtained; and, finally,
Section 6 contains the conclusions.
2. Electrical Parameter Measurement System
The sheet metal stamping line analyzed in this article is fed from a main switchboard that has four dependent electrical panels that supply various subprocesses or stamping stages. To obtain the line’s total consumption, current probes (Rogowski type) and a voltage probe were installed in the main switchboard (see
Figure 1). Furthermore, to facilitate detection of the part in production, a current probe was installed in the switchboard of the first process stage. The voltage and current signals were sent to a data-acquisition system (DAQ) and a processing unit (CPU), which was responsible for real-time energy calculations, cycle-time estimation and part detection. The measurement system also had a display interface that allowed the results to be monitored. The main features of the equipment developed are shown in
Table 1, which highlights the high speed of the power and RMS value calculations as well as its capacity to implement algorithms for detecting parts in production, with their corresponding cycle time and energy.
This equipment enabled the development of non-intrusive detection systems for the production characteristics of a specific process, such as the stamping line addressed in this article, which allowed implementation without interrupting the operation of the installation.
3. Dataset Preparation and Classification
3.1. Characterization and Time Segmentation
Initial analysis of the current signals acquired showed a behavior that, although cyclical in both cases, was markedly non-stationary on the main switchboard (attributable to the aggregate nature of the consumption by multiple pieces of equipment) and more stable on the first process-stage switchboard.
Figure 2 shows an example of the current signals acquired simultaneously on both switchboards during several production cycles while forming a part.
In order to structure the signals for processing compatible with real-time implementation, they were segmented into 20 s windows. This duration was chosen after verifying that the typical production cycle time ranged between five and seven seconds per part, which ensured that each window contained at least two complete cycles.
3.2. Dataset Labeling and Construction
To permit dataset construction, the company provided the part reference being produced at each time instant, which made it possible to associate a label with each 20 s window corresponding to the manufactured part. Although nine distinct parts or references were analyzed (P1 to P9), a total of ten classes were used: the nine identified parts and an additional class called “idle” (IDLE), which was assigned to those windows in which no part was being processed. The inclusion of this class prevented the classifier from incorrectly assigning unproductive periods to a specific part and enabled detection of inactive states, a necessary requirement for the subsequent calculation of cycle-dependent metrics, such as the cycle time.
Despite data being compiled for model construction over three months, actual production was not evenly distributed to reflect the different classes, and therefore some parts appear more often than others. To avoid bias while training the classifiers, the dataset was balanced by randomly downsampling the majority classes until an equal number of samples per class was reached. Although downsampling may lead to information loss in majority classes, it remains a widely adopted strategy for mitigating class imbalance problems [
13].
A total of seven thousand 20 s windows were used for feature extraction, with 700 representations of each class, using information from both the main switchboard and the first process-stage switchboard.
3.3. Feature Extraction in the Time and Time–Frequency Domains
To address the variability of the current signals within each window, classical spectral analysis methods such as the Fourier Transform are insufficient as they assume stationarity and do not adequately capture time-varying frequency components [
14].
A common alternative for analyzing non-stationary signals is the Short-Time Fourier Transform, based on the application of a sliding window on the signal. Although this technique provides information in both the time and the frequency domains, it has a fundamental limitation: the window size is fixed, which imposes a constant time or frequency resolution throughout the signal. This approach is not suitable for highly dynamic processes, where the aim is to capture with precision both time information in high-frequency transients and more-persistent patterns in low-frequency bands [
15].
To overcome this trade-off between time and frequency resolution, the Continuous Wavelet Transform (CWT) was employed, as it has been shown to outperform other techniques in the analysis of non-stationary signals [
7,
16]. The CWT calculates the similarity between the signal and a base function (mother wavelet) shifted and scaled in time (wavelet), which enables adaptive decomposition: the small scales correspond to high-frequency components, while the large scales represent low-frequency variations [
17]. These scales are logarithmically distributed, and the choice of their density introduces a trade-off between frequency resolution and computational cost.
In this study, the Morlet wavelet was chosen as the mother wavelet as it represents the best balance between time and frequency resolution [
18]. Analysis was performed using the MATLAB Wavelet Toolbox (R2025a) [
19], setting a value of four voices per octave to control the scale density. Given this configuration and the RMS computation rate (50 Hz, i.e., one value per cycle), the software automatically determined the range of frequencies considered, which in this case spanned from approximately 0.14 to 18.41 Hz, leading to a total of 29 scales (seven octaves in addition to the minimum scale). Statistical features were extracted from the coefficients obtained in each scale: mean, skewness, kurtosis, RMS and variance. Previous studies [
20,
21] have demonstrated the effectiveness of such statistical features derived from wavelet coefficients when representing non-stationary dynamics.
Furthermore, to enhance signal representation, some of the most commonly used descriptors from the time domain were included in the classification: mean, range, RMS, variance, skewness and kurtosis.
3.4. Normalization and Partitioning
After feature extraction, each dataset was divided into two subsets: 85% of the samples were used for training and validation, while the remaining 15% were reserved for final testing.
Since the extracted features exhibited heterogeneous numerical ranges, Z-score normalization was applied [
22]. The normalization parameters (mean and standard deviation) were computed using only the training data and subsequently applied to the test set, ensuring that no information leakage occurred.
Figure 3 and
Figure 4 show the scatter plots of the training samples for both datasets, indicating the part in production (P1 to P9) and the idle state (IDLE). The figures show better separation in the classes corresponding to the current probe installed at the first process-stage switchboard compared to those obtained from the current probe installed at the main switchboard.
3.5. Classification Using SVM
Support Vector Machines (SVMs) are supervised learning models that have demonstrated strong performance in both regression and classification problems [
23]. This model is based on the creation of a hyperplane that maximizes the margin between classes [
24].
To fit the model to both datasets, the hyperparameters, which control the learning process and cannot be learned from the data, were tuned [
25]. To this end, a grid search was used in combination with cross validation [
21,
26]. Grid search is an exhaustive search technique that evaluates different combinations of hyperparameters within a predefined space [
27,
28]. In this study, the error in classification was calculated for each hyperparameter combination by means of five-fold cross validation, finally selecting the set that minimized this error.
The search space included the kernel function (linear, polynomial and radial basis function (RBF)); the cost parameter (C), explored on a logarithmic scale from 0.001 to 1000, and the gamma parameter () which was explored over the same range (only considered in the case in which the kernel function was RBF).
All the models were trained using features previously normalized by means of Z-score, following the procedure described in
Section 3.4. The multiclass classification was implemented using the one-vs-one decomposition, a strategy recommended because of its good performance in multiclass problems [
29].
The structure and specifications of both models are summarized in
Table 2.
6. Conclusions
This study develops and implements a high-speed measurement system for electrical parameters, capable of acquiring power and RMS values every 20 ms, in addition to allowing the implementation of algorithms to characterize parts in production in real time.
The detection algorithm for parts in production relies exclusively on the current signals acquired by the monitoring system. Features from both the time–frequency domain (via CWT) and the time domain are extracted to train SVM classifiers, whose hyperparameters were selected by grid search to identify the state of the line. The resulting models show notable performance, particularly in the disaggregated dataset (corresponding to the first process stage), where a test accuracy of 99.9% was reached. Nevertheless, the dataset was balanced through downsampling of majority classes, which may reduce the variability present in real production conditions. Therefore, additional validation under imbalanced production scenarios is required to further assess the generalization capability of the model.
Once the state of the line was identified, a peak-detection algorithm was applied to estimate the cycle time. As the electrical measurements from both switchboards are synchronized, it is possible to associate each cycle with its individual energy consumption.
This procedure enables real-time disaggregation at the part level, obtaining both its cycle time and the energy consumed. In this way, through non-intrusive techniques and the use of ML algorithms (SVM with linear kernel), a quantitative basis was provided that enabled verification of the production line’s operation and optimization of the energy demand.
Future work will focus on validating the proposed methodology over longer operating periods and under varying production conditions, as well as on optimizing the approach parameters. For instance, reducing the analysis window size may improve synchronization between part detection and the actual operation of the stamping line.