Industrial Automation & PLC

Chapter 15
IIoT, Analytics, AI and Future Automation

Bachelors Program in Electrical Engineering
Industrial Automation & PLC   •   Bachelor

IIoT, Analytics, AI and Future Automation

Introduction

Industrial automation is evolving from isolated programmable logic controllers (PLCs), supervisory control and data acquisition (SCADA) systems, and manufacturing execution systems (MES) toward interconnected cyber-physical production systems. The Industrial Internet of Things (IIoT) connects sensors, actuators, controllers, machines, people, and enterprise applications so that production data can support faster decisions and more adaptive control.

This evolution does not replace PLCs. Rather, it extends the traditional automation pyramid with edge computing, cloud services, digital twins, machine vision, advanced analytics, and artificial intelligence (AI). The central engineering challenge is to obtain useful information without compromising deterministic control, safety, cybersecurity, reliability, or maintainability.

A practical IIoT system therefore separates functions according to their timing and risk requirements. A safety interlock may need a response in milliseconds and remain operational during network failure. A production-planning model may tolerate minutes of delay and use cloud-scale computation. Good architecture places each function at the appropriate layer.

Learning Objectives

After studying this chapter, the reader should be able to:

  1. Explain the roles of field, control, edge, platform, and enterprise layers in an IIoT architecture.
  2. Describe MQTT communication, including publishers, subscribers, brokers, topics, and quality of service.
  3. Distinguish digital twins from simple equipment models and identify their engineering uses.
  4. Select suitable methods for machine vision, condition monitoring, and manufacturing analytics.
  5. Evaluate anomaly-detection, optimization, and predictive-maintenance models.
  6. Assess data quality, explainability, cybersecurity, governance, safety, and ethical risks.
  7. Propose a technically justified architecture for a future automated manufacturing system.

1. From Automation Hierarchies to Connected Systems

A conventional automation architecture commonly contains the following layers:

LayerTypical elementsMain responsibility
FieldSensors, valves, drives, motorsMeasure and influence the process
ControlPLCs, PACs, motion controllersExecute deterministic logic and control loops
SupervisoryHMI, SCADA, historiansMonitor, alarm, record, and supervise
OperationsMES, quality and maintenance systemsCoordinate production and resources
EnterpriseERP, supply-chain and business analyticsPlan, cost, and optimize across sites

IIoT adds two important ideas. First, data can move horizontally between machines and vertically between operational technology (OT) and information technology (IT). Second, computation can occur close to the process rather than exclusively in a central server or cloud.

The distinction between control data and analytical data is essential. A closed-loop controller requires predictable sampling and communication delay. A cloud dashboard generally requires availability and useful aggregation, but not deterministic millisecond timing. Safety functions should be implemented in certified safety hardware or appropriately validated safety PLC logic, not delegated to an uncertain internet connection or an unverified AI model.

2. Edge–Cloud Architecture

2.1 Edge computing

An edge device is located near the industrial process. It may be an industrial PC, gateway, embedded controller, or software component on a capable PLC. Edge functions include protocol conversion, buffering, filtering, feature extraction, local visualization, and inference using a previously trained model.

Edge processing is valuable when bandwidth is limited, data are sensitive, latency is important, or operation must continue during cloud disconnection. For example, a vibration gateway can calculate root-mean-square vibration locally and transmit a one-minute trend instead of every raw sample.

For a sequence of vibration samples x₁, x₂, …, xₙ, the root-mean-square value is:

xRMS = √[(1/n) ∑(i=1 to n) xᵢ²]

Here, xᵢ is the ith sample and n is the number of samples. The result has the same units as xᵢ. The formula assumes equally weighted samples and is useful for quantifying signal magnitude, although it does not by itself identify the cause of vibration.

2.2 Cloud computing

Cloud platforms provide elastic storage, fleet-wide analytics, model training, digital-twin coordination, reporting, and integration with business systems. Their disadvantages include communication dependency, recurring cost, data-sovereignty concerns, possible vendor lock-in, and increased cybersecurity exposure.

A robust architecture is usually hybrid:

  • PLCs perform real-time control and interlocking.
  • Edge devices perform local aggregation, buffering, and rapid analytics.
  • The cloud or data center performs long-term storage, cross-site comparison, model training, and enterprise integration.
  • Commands returning from higher layers are constrained by authorization, validation, and safe operating limits.

2.3 Data pipeline

A reliable pipeline normally includes sensing, timestamping, validation, normalization, transport, storage, feature engineering, analysis, visualization, and action. Time synchronization matters because incorrect ordering can create false conclusions about causality. Industrial systems may use network time protocols or precision time synchronization where the application demands it.

Data should be tagged with asset identity, engineering unit, sampling rate, quality status, time zone, and calibration information. A value of “72” is not meaningful without knowing whether it represents degrees Celsius, bar, percent, or an unscaled controller count.

3. MQTT for Industrial Data Exchange

MQTT is a lightweight publish–subscribe messaging protocol widely used in IIoT. A publisher sends a message to a topic; a broker receives and distributes it to subscribers. Publishers and subscribers do not need direct knowledge of one another.

For example, a temperature gateway may publish to plant1/line2/oven3/temperature. A historian, dashboard, and maintenance application may independently subscribe to that topic.

Important MQTT concepts include:

  • Broker: manages connections, topics, subscriptions, and message distribution.
  • Topic: hierarchical address used for routing messages.
  • Payload: data carried by the message, often encoded as JSON, binary data, or a standardized industrial model.
  • Quality of Service (QoS): delivery assurance. QoS 0 provides at-most-once delivery, QoS 1 provides at-least-once delivery, and QoS 2 provides exactly-once delivery at the MQTT protocol level.
  • Retained message: the broker stores the most recent message for a topic and sends it to a new subscriber.
  • Last Will and Testament: a broker-published message can indicate an unexpected client disconnection.

QoS is not a substitute for application design. At-least-once delivery can produce duplicates, so receiving applications may require message identifiers or idempotent processing. Exactly-once delivery can impose additional overhead and does not guarantee that a physical action occurs exactly once.

Security should include encrypted transport, certificate- or credential-based authentication, authorization by topic, network segmentation, broker hardening, logging, and secure lifecycle management. Topic names should not be treated as secret access controls.

4. Digital Twins

A digital twin is a maintained digital representation of a physical asset, process, or system that is connected to operational data and supports a defined purpose. It is more than a static computer-aided-design model. A useful twin contains identity, structure, state, behavior, history, and links to decisions or actions.

A twin may be used for:

  1. Visibility: showing current operating state.
  2. Diagnosis: relating symptoms to possible causes.
  3. Simulation: testing production changes before implementation.
  4. Prediction: estimating remaining performance or failure risk.
  5. Optimization: selecting operating conditions that satisfy constraints.
  6. Commissioning and training: validating logic and training operators.

A twin can be descriptive, predictive, or prescriptive. Descriptive twins report what is happening; predictive twins estimate what will happen; prescriptive twins recommend what should be done.

The twin must maintain correspondence with the physical asset. If a motor is replaced, its identity, rating, installation date, and model parameters must be updated. Otherwise, the twin becomes a misleading historical database. Model validation should compare predicted and observed behavior over representative operating conditions.

5. Machine Vision in Automation

Machine vision converts images into measurements or decisions. A typical system includes illumination, optics, camera, acquisition hardware, processing software, and an interface to the PLC or robot.

A dependable vision application begins with the inspection requirement, not with the choice of AI algorithm. Questions include: What defect must be detected? What is the smallest relevant feature? What line speed is required? What false-reject rate is acceptable? How will lighting, position, reflection, contamination, and product variation be controlled?

Traditional methods such as thresholding, edge detection, template matching, morphology, and geometric measurement can be preferable when the product and inspection conditions are stable. Machine-learning methods are useful when defects vary in appearance or are difficult to specify with fixed rules. However, training data must represent normal variation and realistic defect types.

Performance should be reported using a confusion matrix. For a binary inspection:

  • True positive: a defect correctly identified.
  • False positive: a good part incorrectly rejected.
  • True negative: a good part correctly accepted.
  • False negative: a defect incorrectly accepted.

Precision and recall are:

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

TP, FP, and FN denote true positives, false positives, and false negatives. Precision is important when unnecessary rejection is costly; recall is critical when missed defects create safety or compliance risk. These metrics assume clearly defined labels and should be evaluated on data not used for training.

6. Condition Monitoring and Predictive Maintenance

Condition monitoring measures equipment health using variables such as vibration, temperature, current, pressure, acoustic emission, lubricant condition, and motor electrical signatures. It differs from preventive maintenance, which replaces or services equipment according to time or usage, and corrective maintenance, which responds after failure.

A predictive-maintenance system commonly follows this sequence:

  1. Identify failure modes using reliability and process knowledge.
  2. Select sensors that are physically sensitive to those failure modes.
  3. Establish a trustworthy baseline under known operating conditions.
  4. Detect deviations or estimate degradation.
  5. Convert predictions into maintenance decisions.
  6. Record outcomes and update the model.

A simple exponentially weighted moving average (EWMA) is:

zₜ = λxₜ + (1 − λ)zₜ₋₁

where xₜ is the current measurement, zₜ is the filtered value, zₜ₋₁ is the previous filtered value, and 0 < λ ≤ 1 is the smoothing factor. The result has the same units as xₜ. A larger λ responds faster but smooths less. EWMA is useful for gradual changes, but it can hide abrupt faults and should not replace safety protection.

Remaining useful life (RUL) estimation attempts to predict the time until a specified functional failure under stated operating conditions. RUL predictions are uncertain. A professional system should provide prediction intervals or confidence information rather than an unjustified single date.

7. Manufacturing Analytics and AI

Manufacturing analytics can be descriptive, diagnostic, predictive, or prescriptive. Descriptive analytics answers what happened; diagnostic analytics investigates why; predictive analytics estimates what may happen; prescriptive analytics evaluates possible actions.

7.1 Anomaly detection

An anomaly is an observation or sequence inconsistent with expected behavior. Methods include statistical limits, clustering, principal component analysis, autoencoders, isolation forests, and time-series models. A model should distinguish process changes, sensor faults, and actual equipment faults.

A standardized score is often written as:

z = (x − μ) / σ

where x is an observation, μ is the reference mean, and σ is the reference standard deviation. This score is informative when the reference population is reasonably stable and σ is nonzero. A threshold such as |z| > 3 is not a universal engineering law; its suitability depends on distribution, sample size, costs, and operating context.

7.2 Optimization

Optimization selects decisions that improve an objective while respecting constraints. A generic formulation is:

minimize f(u)
subject to g(u) ≤ 0 and h(u) = 0

Here, u is the vector of decision variables, f is the objective function, and g and h represent inequality and equality constraints. In manufacturing, objectives may include energy, cycle time, scrap, or maintenance cost. Constraints may include temperature limits, quality specifications, actuator capacity, and safety boundaries.

An AI optimizer must not be allowed to violate hard process constraints merely because a predicted objective improves. Constraint handling, fallback logic, operator approval, and simulation-based validation are essential.

7.3 Model evaluation

Training accuracy alone is inadequate. Data should be separated into training, validation, and test sets without leakage from future operating conditions. For time-dependent data, chronological splitting is generally more realistic than random shuffling.

Evaluation should consider:

  • predictive performance;
  • false alarms and missed faults;
  • latency and computational requirements;
  • robustness to sensor failure and process change;
  • calibration of probabilities or confidence;
  • economic and safety consequences;
  • interpretability for operators and maintainers.

A technically accurate model may still be operationally useless if it produces too many alarms, cannot explain its output, or gives predictions after the maintenance decision window has closed.

8. Data Quality, Governance, and Cybersecurity

AI quality cannot exceed the quality of the data and labels on which it depends. Common problems include missing values, duplicated records, drift in sensor calibration, inconsistent tag names, changing machine recipes, class imbalance, mislabeled failures, and survivorship bias.

A data-quality program should define ownership, validation rules, lineage, retention, access, and correction procedures. Useful dimensions include completeness, validity, consistency, timeliness, uniqueness, and accuracy.

Governance should address:

  • who owns operational data;
  • which data may leave the plant;
  • retention and deletion requirements;
  • model versioning and approval;
  • audit trails for automated decisions;
  • human responsibility for safety-critical actions;
  • intellectual property and supplier access;
  • compliance with applicable privacy, safety, and cybersecurity requirements.

Industrial cybersecurity requires defense in depth: asset inventory, segmentation, least privilege, secure remote access, patch and vulnerability management, backups, monitoring, incident response, and recovery testing. Security measures must be coordinated with availability requirements; indiscriminate patching during production can itself create risk.

Explainability has several forms. A global explanation describes general model behavior, while a local explanation describes one prediction. Feature importance does not prove causality. Explanations should be understandable to the intended user and tested for stability. In safety-related contexts, interpretable physical models or hybrid models may be preferable to opaque predictors.

9. Illustrative Case: Predictive Monitoring of a Packaging Line

Background

A packaging plant operates several high-speed conveyor and sealing stations. Unplanned stoppages cause product loss and lengthy restart procedures. The PLC already records motor status, speed, current, and fault codes, but maintenance is largely calendar-based.

Problem

Maintenance engineers suspect that conveyor-bearing degradation precedes rising vibration and motor current. However, raw data are inconsistent because machines run at different speeds and recipes. A model trained without accounting for operating context would create many false alarms.

Analysis

The team identifies bearing wear, belt misalignment, overload, and sensor failure as separate failure modes. Edge gateways collect vibration and current, synchronize timestamps, and attach machine speed and product recipe. The gateway calculates RMS vibration in fixed windows and stores raw segments around detected events. Data are labeled using work orders and inspection records, while uncertain labels are kept separate from confirmed failures.

Approach and solution

The system uses an MQTT broker to deliver validated measurements to a plant historian and cloud analytics platform. A baseline model is built separately for operating-speed ranges. An EWMA trend detects gradual change, while a rule-based diagnostic checks for simultaneous increases in vibration and current. A machine-learning classifier is evaluated only after sufficient confirmed examples exist.

The dashboard presents health status, contributing signals, trend duration, confidence, and recommended inspection—not an automatic shutdown. A maintenance engineer verifies the condition, and the work-order result is returned to the data system. Model versions, thresholds, and overrides are logged.

Outcome

In the illustrative scenario, the combined approach reduces nuisance alarms because speed and recipe are included as context. It also reveals that two apparent “bearing” events were caused by a loose sensor mount. The principal benefit is not the AI model alone; it is the integrated process of sensing, context, validation, human review, and feedback.

Learning points

  1. Failure-mode analysis should precede model selection.
  2. Context variables can be as important as fault measurements.
  3. Edge processing reduces bandwidth and preserves local operation.
  4. Maintenance records are valuable labels but may be incomplete.
  5. A recommendation system is often safer than unsupervised automatic action.

10. Future Automation and Autonomous Systems

Future systems will combine robots, autonomous mobile equipment, adaptive scheduling, natural-language interfaces, digital twins, and multi-agent coordination. An autonomous system senses, interprets, decides, acts, and evaluates outcomes with limited human intervention.

Autonomy should be introduced progressively. Advisory systems can be evaluated before closed-loop optimization. Human approval may be required for high-consequence decisions, while low-risk repetitive actions can be automated. Clear operating envelopes, emergency stops, fallback modes, and independent safety functions remain necessary.

Emerging directions include edge AI accelerators, federated learning across plants without centralizing raw data, physics-informed machine learning, synthetic data for rare faults, self-supervised representation learning, and autonomous inspection robots. Each introduces limitations. Federated learning can still leak information through updates; synthetic data may not represent real defects; and physics-informed models are only as reliable as their assumptions.

The most credible future architecture is therefore not “AI replacing automation.” It is a layered system in which deterministic control, engineering models, statistical monitoring, machine learning, human expertise, and governance reinforce one another.

Best-Practice Design Principles

  1. Start with a measurable operational or safety problem.
  2. Preserve deterministic PLC and safety functions.
  3. Use standard information models and meaningful asset naming.
  4. Process data at the edge when latency, privacy, or resilience requires it.
  5. Record units, timestamps, quality codes, calibration, and provenance.
  6. Establish baselines before declaring anomalies.
  7. Evaluate models using realistic future data and operational costs.
  8. Monitor model drift and retrain through controlled procedures.
  9. Provide explanations appropriate to operators and engineers.
  10. Design cybersecurity, fail-safe behavior, and recovery from the beginning.
  11. Keep humans accountable for high-consequence decisions.
  12. Measure business outcomes, not merely model accuracy.

Chapter Summary

IIoT extends PLC-centered automation by connecting field devices, edge computers, platforms, and enterprise systems. Edge computing supports low latency, local resilience, and data reduction, while cloud platforms support fleet-wide storage, training, and optimization. MQTT provides flexible publish–subscribe communication, but secure authentication, authorization, encryption, and duplicate-handling remain necessary.

Digital twins maintain purposeful digital representations of physical assets and can support visibility, diagnosis, prediction, simulation, and optimization. Machine vision requires controlled imaging and suitable performance measures such as precision and recall. Condition monitoring combines failure-mode knowledge, sensing, signal processing, and maintenance workflows. AI can detect anomalies, predict degradation, and optimize operations, but its usefulness depends on data quality, representative evaluation, explainability, governance, and safe integration.

Future autonomous systems should be introduced incrementally and constrained by engineering limits, independent safety functions, cybersecurity, human accountability, and reliable fallback behavior. Effective automation is therefore a socio-technical discipline combining control engineering, data engineering, AI, operations, and responsible governance.

Key Terms

IIoT: Industrial Internet of Things connecting industrial assets and information systems.

Edge computing: Processing data near the physical process.

Cloud computing: On-demand centralized or distributed computing and storage services.

MQTT: Lightweight publish–subscribe messaging protocol used in connected systems.

Broker: MQTT service that routes messages between publishers and subscribers.

Quality of Service: MQTT delivery assurance level.

Digital twin: Connected digital representation of a physical asset, process, or system.

Machine vision: Automated extraction of information from images.

Condition monitoring: Assessment of equipment health using measured operating data.

Predictive maintenance: Maintenance planned using predicted condition or failure risk.

Anomaly detection: Identification of observations inconsistent with expected behavior.

Feature: Measured or calculated variable supplied to an analytical model.

Model drift: Decline in model validity as data or operating conditions change.

Precision: Fraction of predicted positives that are actually positive.

Recall: Fraction of actual positives detected by a model.

Explainability: Ability to communicate how or why a model produced an output.

Data lineage: Record of data origin, transformations, and use.

Digital thread: Traceable flow of information across an asset or product lifecycle.

Autonomous system: System that senses, decides, and acts with limited human intervention.

Defense in depth: Layered cybersecurity strategy using multiple protective controls.

Review Questions

Short Answer Questions

  1. Why should safety interlocks generally not depend on cloud connectivity?
  2. What are the roles of a publisher, subscriber, and broker in MQTT?
  3. Distinguish a digital twin from a static CAD model.
  4. Define precision and recall in machine vision inspection.
  5. State two reasons for performing analytics at the edge.

Long Answer Questions

  1. Explain a hybrid edge–cloud architecture for a manufacturing plant and justify the allocation of functions across layers.
  2. Describe the complete lifecycle of a predictive-maintenance project, from failure-mode analysis to model feedback.
  3. Compare rule-based analytics, statistical monitoring, and machine-learning anomaly detection.
  4. Discuss data quality, model drift, explainability, and governance in industrial AI.
  5. Explain how digital twins can support commissioning, diagnosis, simulation, and optimization.

Analytical / Application Questions

  1. A vision system identifies 90 defective parts, of which 72 are truly defective. It misses 18 defective parts. Calculate precision and recall, and explain which operational costs each metric reflects.
  2. Design an MQTT and edge-computing architecture for a bottling line that must continue operating for two hours after loss of cloud connectivity. Identify local functions, cloud functions, security controls, and recovery behavior.
  3. A predictive-maintenance model generates frequent alarms whenever production speed changes. Analyze likely causes and propose a data, feature-engineering, validation, and governance plan to reduce false alarms without hiding real faults.

Multiple Choice Questions with Answers

Question 1

Which function is most appropriately retained in a PLC or safety controller?

A. Long-term fleet benchmarking

B. Cloud model training

C. Emergency interlocking

D. Enterprise production costing

Correct Answer: C. Emergency interlocking

Question 2

In MQTT, what is the primary function of a broker?

A. Physically measure process temperature

B. Route messages between publishers and subscribers

C. Replace all PLC control logic

D. Calibrate industrial sensors

Correct Answer: B. Route messages between publishers and subscribers

Question 3

An edge device is especially useful when an application requires:

A. Guaranteed internet availability

B. High local responsiveness and operation during disconnection

C. Removal of all cybersecurity controls

D. Elimination of field sensors

Correct Answer: B. High local responsiveness and operation during disconnection

Question 4

A digital twin differs from a static CAD model because it:

A. Contains no physical asset information

B. Is necessarily a mechanical drawing only

C. Maintains a purposeful connection with operational state and history

D. Cannot support simulation

Correct Answer: C. Maintains a purposeful connection with operational state and history

Question 5

If TP = 80 and FP = 20, what is precision?

A. 0.20

B. 0.50

C. 0.80

D. 1.25

Correct Answer: C. 0.80

Question 6

Which measure is most directly concerned with missed defective products in a vision system?

A. Recall

B. Precision

C. Throughput

D. Latency only

Correct Answer: A. Recall

Question 7

In the EWMA equation zₜ = λxₜ + (1 − λ)zₜ₋₁, increasing λ generally makes the filtered value:

A. More responsive to the newest observation

B. Independent of new observations

C. Dimensionless

D. Always equal to zero

Correct Answer: A. More responsive to the newest observation

Question 8

Why should an AI optimizer be subject to hard process constraints?

A. To ensure an objective improvement can never be measured

B. To prevent recommendations from violating safety or equipment limits

C. To eliminate the need for sensors

D. To guarantee perfect predictions

Correct Answer: B. To prevent recommendations from violating safety or equipment limits

Question 9

Which practice best addresses MQTT topic security?

A. Keeping topic names secret while allowing anonymous access

B. Using authorization policies and authenticated clients

C. Disabling broker logs

D. Publishing all messages without encryption

Correct Answer: B. Using authorization policies and authenticated clients

Question 10

What is model drift?

A. A physical motor alignment procedure

B. A decline in model validity as data or operating conditions change

C. A type of MQTT delivery guarantee

D. A method of emergency stopping

Correct Answer: B. A decline in model validity as data or operating conditions change

Industrial Automation & PLC
Chapter 15 of 15