Introduction to Mechatronics Systems

Chapter 13
Data Analytics, AI and Intelligent Mechatronics

Bachelor Program in Mechatronics Engineering
Introduction to Mechatronics Systems   •   Bachelor

Data Analytics, AI and Intelligent Mechatronics

Introduction and context

A mechatronic system combines mechanics, electronics, sensing, computation, communication and control. Modern systems also generate continuous operational data: motor currents, vibration, temperature, pressure, position, torque, cycle time, alarms and maintenance records. This data can be used not merely to report what happened, but to understand why it happened, predict what may happen next and support safer, more economical decisions.

Data analytics and artificial intelligence (AI) therefore extend the traditional mechatronics loop. A conventional control system measures a process and computes an actuator command. An intelligent mechatronic system additionally learns from historical and current data, detects abnormal behaviour, estimates unmeasured conditions, assists diagnosis and adapts maintenance or operating decisions. Human engineering judgement remains essential: a statistically accurate prediction is not automatically a safe control action.

This chapter develops the foundations of operational-data analytics, condition monitoring, predictive maintenance, machine learning, computer vision, intelligent control and digital twins. It also evaluates model limitations, cybersecurity, privacy, explainability and responsible AI.

Learning objectives

By the end of this chapter, a student should be able to:

  1. Distinguish descriptive, diagnostic, predictive and prescriptive analytics in mechatronic applications.
  2. Prepare sensor and maintenance data for reliable analysis.
  3. Explain common machine-learning models and evaluate them using appropriate metrics.
  4. Design a basic condition-monitoring and predictive-maintenance workflow.
  5. Describe the roles and limitations of computer vision, intelligent control and digital twins.
  6. Identify risks associated with uncertainty, bias, cybersecurity, safety and responsible AI.

1. From operational data to engineering decisions

Operational data has several dimensions. A sensor record normally contains a measured value, a timestamp, a device identity and sometimes operating context such as speed, load, product type or environmental temperature. Maintenance data may contain work orders, replaced components, failure descriptions and time spent repairing equipment. These sources rarely align automatically. A vibration signal sampled at kilohertz frequency has a different time scale from a maintenance log recorded once per shift.

Four analytical questions are useful:

Analytics typeMain questionTypical mechatronics output
DescriptiveWhat happened?Trend, dashboard, alarm history
DiagnosticWhy did it happen?Fault isolation, correlation, root-cause hypothesis
PredictiveWhat is likely to happen?Failure probability, remaining-useful-life estimate
PrescriptiveWhat should be done?Inspection, control adjustment or maintenance recommendation

A dashboard showing motor temperature is descriptive. Identifying that temperature rises only under excessive load is diagnostic. Estimating that a bearing has a high probability of failure within 100 operating hours is predictive. Scheduling an inspection while avoiding production disruption is prescriptive.

The analytical value of data depends on its quality and context. A sensor can be precise but irrelevant, frequent but poorly calibrated, or accurate in one operating regime and misleading in another. Data engineering is therefore part of engineering design, not an administrative afterthought.

Measurement and data quality

Important checks include:

  • Validity: Is the value physically plausible and within the sensor range?
  • Completeness: Are samples missing, and are missing periods related to faults?
  • Consistency: Do timestamps, units and device identifiers agree?
  • Accuracy: Has the sensor been calibrated against a reference?
  • Resolution: Is the sampling rate sufficient for the phenomenon of interest?
  • Context: Are speed, load, tool, material and environmental conditions recorded?

For a regularly sampled signal xk, the sampling frequency fs must be sufficiently high to represent the highest frequency of interest. Under ideal conditions, the Nyquist criterion requires fs > 2fmax, where fmax is the highest relevant frequency. In practice, anti-aliasing filtering and engineering margin are required. Undersampling can make a high-frequency vibration appear as a false low-frequency pattern.

A simple moving average can reduce random noise:

ȳk = (1/N) ∑i=0N−1 xk−i

Here, xk is the current measurement, N is the window length, and ȳk is the smoothed value. The measurements must have the same units. A larger N generally produces more smoothing but also more delay and may hide short faults. Filtering must therefore be selected according to the dynamics and safety requirements of the system.

2. Condition monitoring and predictive maintenance

Condition monitoring observes equipment health through measurable indicators. It may be continuous, periodic or event-triggered. Common techniques include vibration analysis for rotating machinery, motor-current signature analysis, thermography, acoustic emission, oil analysis, pressure monitoring and visual inspection.

Maintenance strategies can be compared as follows:

StrategyTriggerStrengthLimitation
CorrectiveFailureSimple planning for noncritical assetsUnexpected downtime and secondary damage
PreventiveCalendar time or usageEasy to scheduleMay replace healthy parts or miss variable degradation
Condition-basedMeasured conditionMaintenance reflects actual healthRequires sensors and interpretation
PredictiveForecasted future conditionSupports advance planningForecast uncertainty and data requirements
PrescriptiveOptimized recommended actionLinks prediction to decisionHigher complexity and governance needs

A health indicator is a measured or calculated variable related to degradation. For vibration, features may include root-mean-square amplitude, peak value, crest factor or frequency-band energy. The root-mean-square value for a finite signal is:

xRMS = √[(1/n) ∑i=1n xi²]

where xi is sample i, n is the number of samples, and xRMS has the same units as the signal. This expression assumes equally weighted samples over the selected time window. RMS is useful for overall vibration or current magnitude, but it does not by itself identify the fault mechanism.

A common statistical anomaly score is a standardized value:

z = (x − μ)/σ

where x is the observation, μ is the reference mean and σ is the reference standard deviation. The score is dimensionless. It is meaningful only when the reference population is appropriate and relatively stable. A threshold such as |z| > 3 is not a universal fault rule: non-Gaussian data, changing loads and multiple operating modes can make it unsuitable.

Predictive maintenance often estimates either failure probability or remaining useful life (RUL). A binary classifier may estimate:

p(y = 1 | x)

where y = 1 denotes a defined event, such as failure within a specified horizon, and x is the feature vector. The prediction is incomplete unless the horizon, operating conditions, decision threshold and uncertainty are stated.

RUL is commonly represented as:

RUL = tfailure − tnow

where tfailure is the future failure time and tnow is the current time. In practice, tfailure is unknown, so a model should report an estimate or probability distribution rather than false precision.

3. Machine learning for mechatronics

Machine learning (ML) infers patterns or relationships from data. In supervised learning, examples contain inputs and known labels. Classification predicts discrete categories such as normal, misalignment or bearing fault. Regression predicts a continuous quantity such as temperature, torque or RUL. In unsupervised learning, labels are absent; clustering and anomaly detection seek structure or unusual observations. Reinforcement learning learns actions through interaction with an environment and a reward signal, but unrestricted online experimentation can be unsafe in physical machinery.

A supervised model can be written abstractly as:

ŷ = f_θ(x)

where x is the input vector, ŷ is the prediction, f_θ is a model and θ represents learned parameters. Training selects parameters that reduce a loss function. For mean squared error regression:

MSE = (1/n) ∑i=1n (yi − ŷi)²

where yi is the measured target and ŷi is the prediction for sample i. MSE has squared target units and is sensitive to large errors.

For binary classification, accuracy is:

Accuracy = (TP + TN)/(TP + TN + FP + FN)

Here, TP and TN are true positives and true negatives; FP and FN are false positives and false negatives. Accuracy can be misleading when failures are rare. Precision and recall are often more informative:

Precision = TP/(TP + FP)
Recall = TP/(TP + FN)

Precision answers, “When the model raises an alarm, how often is it correct?” Recall answers, “Of the actual failures, how many did it detect?” A maintenance application must consider the costs of missed failures and unnecessary inspections. The classification threshold should therefore be selected using operational consequences, not only a generic score.

Model selection and validation

Typical models include linear regression, logistic regression, decision trees, random forests, gradient-boosting methods, support-vector machines and neural networks. The best choice depends on data volume, interpretability, computational resources, latency and safety requirements.

The dataset should be divided into training, validation and test data. For time-dependent equipment data, random shuffling can cause leakage: near-duplicate observations from the same degradation episode may appear in both training and test sets. A chronological split or equipment-level split is often more realistic. Data preprocessing, feature selection and normalization must be fitted using training data only.

Overfitting occurs when a model learns accidental details of the training data rather than general relationships. It may be reduced through simpler models, regularization, additional representative data and cross-validation. Underfitting occurs when the model cannot represent important structure. Neither a complex neural network nor a high test score guarantees safe deployment.

4. Computer vision in mechatronics

Computer vision converts images or video into measurements or decisions. Applications include detecting missing components, locating parts for robotic manipulation, measuring dimensions, reading instruments, inspecting welds and identifying surface defects.

A vision pipeline commonly contains illumination, image acquisition, calibration, preprocessing, segmentation or detection, feature extraction, classification and decision logic. Illumination is an engineering variable: glare, shadows and changing backgrounds can degrade performance more than the choice of classifier.

Camera calibration relates image coordinates to physical coordinates. A calibrated system can estimate dimensions or robot poses, but accuracy depends on lens distortion, camera rigidity, target geometry and calibration maintenance. A vision decision should include an uncertainty or confidence assessment where possible. A confidence score is not the same as a probability unless it has been appropriately calibrated.

Vision systems can fail through occlusion, reflective surfaces, dust, new product variants, unusual orientations and distribution shift. Safety-critical inspection should use controlled lighting, mechanical fixturing, validation samples and a defined response to uncertain images. “No decision” or human review may be safer than forcing every image into a pass/fail category.

5. Intelligent control

Classical control uses an explicit mathematical model or feedback law. Intelligent control may use fuzzy logic, neural networks, adaptive methods, evolutionary optimization or reinforcement learning. These methods are valuable when the plant is nonlinear, uncertain, difficult to model or exposed to changing conditions.

A fuzzy controller uses linguistic rules such as “if error is positive large and error rate is positive, reduce actuator command.” It can encode expert knowledge without requiring an exact analytical model. However, rule coverage, membership functions and stability must still be evaluated.

Adaptive control changes controller parameters in response to estimated plant behaviour. A learning-based controller may improve performance, but adaptation can be dangerous if it responds to sensor faults or unmodeled disturbances. A practical architecture often places a verified safety layer around the intelligent component: hard limits, watchdogs, rate limits, fallback control and emergency stopping remain active.

AI should not replace feedback, physical constraints or fault protection. In a robot, an intelligent trajectory planner must still respect position, velocity, acceleration, torque, collision and workspace constraints. In a process plant, a learned recommendation may be advisory while a conventional safety instrumented system retains authority over hazardous states.

6. Digital twins

A digital twin is a connected digital representation of a physical asset, process or system that uses data and models to support analysis throughout operation. It is more than a static computer-aided design model. A useful twin has a defined purpose, a correspondence with the physical system, data connections, model assumptions and a method for updating or validating its state.

A twin may combine:

  • geometric and kinematic models;
  • physical equations or simulation;
  • sensor data and state estimation;
  • degradation and reliability models;
  • historical maintenance information; and
  • visualization and decision support.

For a simplified discrete-time state model:

xk+1 = f(xk, uk, wk)
yk = h(xk, vk)

Here, xk is the system state, uk is the input, yk is the measured output, wk represents process uncertainty, and vk represents measurement noise. Functions f and h describe state evolution and measurement generation. These equations are general model forms, not guarantees that the real system is accurately represented.

State estimation methods, such as observers or Kalman-filter variants, combine a model with measurements. Their performance depends on model adequacy, noise assumptions, observability and sensor placement. A digital twin that displays attractive graphics but uses stale, biased or unvalidated data is not a reliable engineering twin.

7. Illustrative case: predictive maintenance of a conveyor drive

Background

Consider an illustrative packaging line driven by an induction motor, gearbox and conveyor. Unexpected gearbox failures stop the line and can damage the belt. Sensors measure motor current, gearbox vibration, bearing temperature, speed and ambient temperature. Maintenance technicians record inspections and component replacements.

Problem

The plant initially replaces gearbox lubricant and bearings every six months. Some gearboxes remain healthy, while others fail earlier under high load. The objective is to detect degradation early without creating excessive false alarms.

Analysis

First, engineers define failure consistently: a gearbox is considered failed when it cannot meet torque and speed requirements or when inspection confirms unacceptable gear or bearing damage. They align sensor data with operating speed and load, remove impossible values, identify sensor outages and separate training data from later test periods.

Vibration RMS, selected frequency-band energy, temperature rise above ambient and current-load residual are calculated. Because vibration depends on speed, features are normalized or evaluated within operating regimes. A simple baseline uses healthy data to estimate the expected temperature for each load condition. A large sustained residual is more informative than a single high temperature during an unusually hot shift.

A classifier is trained to predict whether a confirmed fault will occur within the next 30 operating days. The test set contains later time periods and a gearbox not used during training. This tests temporal and asset-level generalization. The maintenance team chooses a threshold that prioritizes recall, but it also imposes a persistence rule: an alarm must remain above threshold for three consecutive operating intervals unless a safety limit is exceeded.

Approach and solution

The deployed system has four layers:

  1. Data layer: timestamp synchronization, calibration records, quality flags and secure storage.
  2. Analytical layer: feature calculation, baseline comparison, classifier and uncertainty reporting.
  3. Decision layer: alarm severity, recommended inspection and estimated time window.
  4. Human and safety layer: technician review, conventional protective trips and documented override.

The model does not directly stop the conveyor. A high-temperature protective limit remains an independent control function. Technicians inspect lubrication, alignment and bearing condition before a planned shutdown. Their findings are fed back into the data set, including cases where an alarm was judged false.

Outcome

In evaluation, the model detects most confirmed degradations earlier than the fixed six-month schedule, but it also produces alerts during unusual high-load production. Engineers respond by adding load context and reporting alarm precision separately for normal and high-load regimes. The final system is less impressive in a single aggregate score but more useful operationally because its failure modes are understood.

Learning points

The case illustrates that predictive maintenance is a socio-technical system. Sensor placement, failure definitions, data governance, threshold selection, technician workflow and independent safety functions are as important as the algorithm. A model should support a decision with traceable evidence, not create an unquestioned command.

8. Limitations, governance and responsible AI

Technical limitations

Models are built from historical data and may fail when equipment, materials, software, environment or operating policy changes. This is distribution shift. Rare failures create class imbalance and limited examples. Labels may be delayed, inconsistent or biased toward assets that were already inspected. Correlation does not establish causation: temperature may correlate with failure because both increase with load, not because temperature alone causes the fault.

Uncertainty should be communicated. A point estimate of RUL can encourage overconfidence, especially when the model has not seen the current operating regime. Prediction intervals, calibration checks, out-of-distribution detection and conservative fallback policies are valuable, although none eliminates uncertainty.

Safety and cybersecurity

Connected analytics increases attack surface. An attacker could alter sensor data, inject false alarms, suppress warnings or manipulate a model. Security controls include authentication, authorization, encryption, network segmentation, secure updates, logging, backup operation and incident response. Safety and cybersecurity analyses should be linked because compromised data can produce unsafe physical actions.

Responsible AI

Responsible deployment requires:

  • Accountability: a named owner for model performance and decisions;
  • Transparency: documented data sources, assumptions, limitations and intended use;
  • Human oversight: meaningful ability to review, reject or override recommendations;
  • Fairness: checking whether performance differs across products, sites, shifts or operating conditions;
  • Privacy: minimizing and protecting personal data, including worker-related video or identifiers;
  • Safety: independent constraints, validation and fail-safe behaviour;
  • Traceability: versioned data, software, models, thresholds and audit logs.

Regulatory obligations vary by jurisdiction and application. Machinery safety, functional safety, industrial cybersecurity, data protection and AI governance may all apply. Engineers should consult applicable standards and legal requirements rather than treating a model as an exempt software feature.

Best-practice deployment lifecycle

A disciplined lifecycle is:

  1. Define the engineering decision and cost of each error.
  2. Establish a data dictionary, sensor validation plan and failure taxonomy.
  3. Create a safe baseline using physics, rules or conventional control.
  4. Collect representative data across assets, loads and environmental conditions.
  5. Train and validate without leakage.
  6. Test robustness, uncertainty, cybersecurity and human interaction.
  7. Pilot in advisory mode before automation.
  8. Monitor drift, false alarms, missed events and operational outcomes.
  9. Retrain or retire the model under formal change control.

Contemporary developments and professional implications

Edge AI places inference near sensors and actuators, reducing latency and dependence on cloud connectivity. Federated learning can support learning across sites without centralizing all raw data, although it introduces aggregation, security and validation challenges. Physics-informed and hybrid models combine physical relationships with data-driven correction. Explainable AI methods can reveal influential features, but an explanation is not proof that the model is causally correct.

For mechatronics engineers, employability increasingly requires competence across domains: sensor physics, signal processing, databases, Python or equivalent programming, control, machine learning, industrial networking, cybersecurity and communication with maintenance personnel. The most valuable professionals can translate a production problem into a measurable decision, select an appropriate model, quantify limitations and integrate the result safely into a real machine.

Chapter Summary

Operational data enables descriptive, diagnostic, predictive and prescriptive engineering decisions. Reliable analytics begins with calibrated sensors, synchronized timestamps, appropriate sampling, contextual variables and documented data quality. Condition monitoring uses physical and statistical indicators, while predictive maintenance estimates future failure risk or remaining useful life.

Machine learning includes supervised, unsupervised and reinforcement approaches. Model evaluation must reflect class imbalance, time dependence, leakage, operating cost and uncertainty. Computer vision depends on calibration, illumination, representative data and safe handling of ambiguous images. Intelligent control can address nonlinear and uncertain systems but should operate within verified constraints and fallback mechanisms. Digital twins connect physical assets, models and live data; their usefulness depends on purpose, fidelity and validation.

AI systems can suffer from overfitting, distribution shift, biased labels, poor calibration and cyberattack. Responsible deployment therefore requires human oversight, traceability, privacy protection, independent safety functions, cybersecurity and lifecycle monitoring. Intelligent mechatronics is not the replacement of engineering judgement by algorithms; it is the disciplined integration of data, models, people and physical safeguards.

Key Terms

Operational data: Data generated during the use, monitoring or maintenance of a mechatronic system.

Condition monitoring: Observation of equipment condition using measurements and inspection methods.

Predictive maintenance: Maintenance planned using a forecast of future condition or failure risk.

Health indicator: A measured or calculated variable associated with equipment degradation.

Anomaly detection: Identification of observations that differ from expected behaviour.

Feature: An input variable derived from raw data for analysis or modelling.

Supervised learning: Learning from examples with known target labels.

Unsupervised learning: Learning patterns without specified target labels.

Classification: Prediction of a discrete category.

Regression: Prediction of a continuous quantity.

Overfitting: Learning training-specific detail that does not generalize.

Data leakage: Use of information during training that would not be available at deployment.

Precision: Fraction of positive predictions that are true positives.

Recall: Fraction of actual positive cases detected by a model.

Computer vision: Analysis of images or video to obtain measurements or decisions.

Intelligent control: Control that uses learning, fuzzy logic, adaptation or other computational intelligence.

Digital twin: A connected digital representation of a physical asset or process.

Distribution shift: Change between the data used to build a model and deployment data.

Responsible AI: Design and use of AI with accountability, transparency, safety, fairness and respect for rights.

Remaining useful life: Estimated operating time before a defined failure or end-of-service condition.

Review Questions

Short Answer Questions

  1. Distinguish descriptive, diagnostic, predictive and prescriptive analytics.
  2. Why can random train–test splitting be inappropriate for time-dependent equipment data?
  3. What does RMS measure, and why does it not identify a fault by itself?
  4. State two important limitations of computer-vision inspection.
  5. Why should an intelligent controller include safety limits or fallback control?

Long Answer Questions

  1. Explain a complete predictive-maintenance workflow from sensor selection to deployment monitoring.
  2. Compare preventive, condition-based and predictive maintenance, including their practical trade-offs.
  3. Explain how a digital twin combines physical models, sensor data and state estimation.
  4. Discuss precision, recall and the consequences of false positives and false negatives in maintenance.
  5. Evaluate the technical, ethical and cybersecurity requirements for responsible industrial AI.

Analytical / Application Questions

  1. Design a condition-monitoring system for a robotic gearbox. Specify sensors, sampling considerations, features, alarms, validation data and human actions.
  2. A vision system performs well on clean factory images but poorly after a lighting change. Diagnose likely causes and propose an improvement and validation plan.
  3. A predictive model reports high accuracy because only 1% of operating windows contain failures. Explain why this result may be misleading and recommend better evaluation measures and deployment safeguards.

Multiple Choice Questions with Answers

Question 1

Which type of analytics answers the question “What action should be taken to avoid an expected failure?”

A. Descriptive analytics

B. Diagnostic analytics

C. Predictive analytics

D. Prescriptive analytics

Correct Answer: D. Prescriptive analytics

Question 2

For a finite signal, what does the RMS calculation primarily represent?

A. The average time between failures

B. The effective magnitude of the signal over a selected window

C. The highest frequency that can be sampled

D. The probability of a fault

Correct Answer: B. The effective magnitude of the signal over a selected window

Question 3

Which situation is most likely to cause data leakage in a predictive-maintenance model?

A. Using a chronological test set

B. Scaling features using training data only

C. Including a post-failure maintenance code that was unavailable at prediction time

D. Recording operating speed as an input

Correct Answer: C. Including a post-failure maintenance code that was unavailable at prediction time

Question 4

Recall in binary fault classification is the fraction of:

A. Predicted faults that are actual faults

B. Actual faults that are detected

C. Normal cases that are correctly rejected

D. All cases that are correctly classified

Correct Answer: B. Actual faults that are detected

Question 5

If a maintenance system must detect as many actual dangerous failures as possible, which metric is especially important?

A. Recall

B. Training loss only

C. Image resolution

D. Database size

Correct Answer: A. Recall

Question 6

Which statement best describes a digital twin?

A. A static drawing with no operational data

B. A connected digital representation used to analyse and support a physical system

C. A replacement for all physical safety devices

D. A database containing only maintenance invoices

Correct Answer: B. A connected digital representation used to analyse and support a physical system

Question 7

Why can a larger moving-average window be problematic?

A. It always increases sensor noise

B. It removes the need for calibration

C. It can introduce delay and hide short-duration faults

D. It changes the units of the measurements

Correct Answer: C. It can introduce delay and hide short-duration faults

Question 8

Which is an appropriate safety practice for an AI-based controller?

A. Allow the model to bypass all hard limits

B. Use independent constraints and a verified fallback mode

C. Train only on simulated data and deploy without testing

D. Disable monitoring after successful commissioning

Correct Answer: B. Use independent constraints and a verified fallback mode

Question 9

What is distribution shift?

A. A change in the physical dimensions of a sensor

B. A difference between training data conditions and deployment conditions

C. A method for encrypting maintenance records

D. The conversion of analogue data into digital data

Correct Answer: B. A difference between training data conditions and deployment conditions

Question 10

Why can accuracy be misleading when failures are rare?

A. Accuracy cannot be calculated for classifiers

B. A model can classify nearly all cases as normal and still obtain a high score

C. Accuracy is measured only in physical units

D. Accuracy automatically penalizes false negatives more than false positives

Correct Answer: B. A model can classify nearly all cases as normal and still obtain a high score

Introduction to Mechatronics Systems
Chapter 13 of 15