Bachelor Program in Mechatronics Engineering
Embedded Systems in Mechatronics
•
Bachelor
Sensors, Actuators and Data Acquisition
Introduction
A mechatronic system connects the physical world to computation and control. Sensors convert physical variables into electrical signals; actuators convert electrical commands into physical action; and a data-acquisition system conditions, samples, converts, transports, and interprets sensor signals. The quality of this chain determines whether a controller can estimate state accurately and command motion safely.
A temperature sensor may measure only a few millivolts per degree, while an encoder may produce thousands of digital transitions per revolution. Both require appropriate interfaces, but their error mechanisms differ. Sensor selection is therefore not simply a matter of choosing the smallest uncertainty or the highest resolution. The engineer must match the device and acquisition architecture to the required bandwidth, environment, dynamic range, cost, safety, and maintenance strategy.
Learning objectives
By the end of this chapter, students should be able to:
classify sensors and actuators and explain their operating principles;
distinguish accuracy, precision, resolution, sensitivity, linearity, hysteresis, repeatability, and uncertainty;
construct a calibration relationship and estimate measurement uncertainty;
explain noise, sampling, aliasing, quantization, and filtering;
design an encoder-feedback and data-acquisition pipeline;
select interfaces and actuators for a mechatronic application;
evaluate practical, safety, ethical, and reliability implications of measurement and actuation.
1. The measurement–decision–action chain
A typical closed-loop system follows this sequence:
A physical variable, such as position, pressure, or temperature, exists in the plant.
A sensor produces a transduced signal.
Analog conditioning provides excitation, amplification, isolation, linearization, and filtering.
An analogue-to-digital converter (ADC), or a digital sensor interface, creates data.
Firmware validates and processes the data.
A controller calculates a command.
A power stage drives an actuator.
The actuator changes the plant, closing the loop.
Closed-loop sensor acquisition and actuation pipeline
Figure: Closed-loop sensor acquisition and actuation pipeline
Figure: A closed-loop acquisition and actuation pipeline.
The pipeline introduces latency and error at every stage. A high-quality sensor cannot compensate for poor grounding, inadequate sampling, saturation, or an actuator that cannot supply the required force.
2. Sensors and transduction
A sensor uses a physical effect to relate a measurand to an output. Common transduction mechanisms include:
Sensor class
Typical measurand
Principle
Common interface
Resistive
temperature, force, displacement
resistance changes
voltage divider, bridge, ADC
Capacitive
proximity, pressure, humidity
capacitance changes
oscillator, capacitance-to-digital
Inductive
position, metal proximity
magnetic coupling
oscillator, demodulator
Piezoelectric
vibration, impact
charge from strain
charge amplifier
Hall-effect
magnetic field, speed
transverse Hall voltage
analogue or digital
Optical
position, speed, presence
light interruption/reflection
photodiode, pulse output
Thermoelectric
temperature
Seebeck voltage
low-noise amplifier, ADC
A sensor may be passive, requiring excitation, or active, producing a signal from an external energy source. A strain gauge, for example, is passive and is often used in a Wheatstone bridge. A photodiode is also passive in its sensing function but normally needs biasing and amplification.
Important static characteristics include sensitivity, defined as output change per unit input. For an approximately linear sensor,
S = ∆y / ∆x
where S is sensitivity, ∆y is the output change, and ∆x is the measurand change. Units must be stated, such as mV/°C or V/mm. The intercept is not necessarily zero, so a more realistic model is
y = a + bx + e
where y is measured output, x is the input, a is offset, b is sensitivity, and e represents error or random variation. This model is appropriate only over the range in which linearity is acceptable.
Resolution is the smallest distinguishable increment. Accuracy describes closeness to the accepted reference value; precision describes the scatter of repeated measurements. A device can be precise but inaccurate if it has a stable calibration offset. Repeatability concerns agreement under the same conditions, whereas reproducibility concerns agreement when conditions such as operator, instrument, or laboratory change.
Other specifications include hysteresis, the difference in output for the same input approached from increasing and decreasing directions; drift, a change with time or environment; response time; bandwidth; overload capacity; and cross-sensitivity to unwanted variables.
3. Actuators and drive interfaces
Actuators transform energy into controlled motion or process change. Electrical actuators include DC motors, brushless motors, stepper motors, solenoids, voice coils, relays, and piezoelectric stacks. Pneumatic and hydraulic cylinders offer high force density, while thermal and shape-memory actuators are useful where motion is small and response speed is moderate.
The actuator must be selected from the required force, torque, speed, stroke, acceleration, duty cycle, precision, efficiency, and environment. For rotary motion, mechanical power is
P = τω
where P is power in watts, τ is torque in newton-metres, and ω is angular speed in radians per second. This equation describes instantaneous mechanical power; losses mean that electrical input power is greater than mechanical output power.
For a translational load,
P = Fv
where F is force in newtons and v is velocity in metres per second. A motor driver must also handle starting current, regenerative energy, thermal limits, electromagnetic compatibility, and fault isolation. A microcontroller pin should not directly drive a motor, solenoid, or relay unless the load and protection requirements explicitly permit it. A power transistor, gate driver, flyback path, current limit, and suitable supply are normally required.
Open-loop stepper control is simple but can lose synchronism under overload. Closed-loop servo control uses position or velocity feedback and can detect following error. Brakes, interlocks, emergency stops, and a defined failure state are essential when unintended motion can injure people or damage equipment.
4. Accuracy, calibration, and uncertainty
Calibration compares an instrument with a reference under specified conditions. It does not automatically improve the hardware; it establishes a relationship, identifies error, and may enable correction. A two-point calibration for a linear sensor uses reference points (x1,y1) and (x2,y2):
b = (y2 − y1)/(x2 − x1), a = y1 − bx1
The corrected estimate for a measured output y is then
x̂ = (y − a)/b
This is valid only when the sensor is sufficiently linear, the reference values are traceable, and the operating conditions are comparable to those in use. Multi-point calibration may use a polynomial or lookup table, but extra mathematical complexity does not remove drift or extrapolation risk.
Uncertainty quantifies doubt about a measurement. If independent input quantities qi contribute to a result y = f(q1,q2,…), the combined standard uncertainty under a first-order approximation is
uc(y) = √[∑(∂f/∂qi)²u²(qi)]
where u(qi) is the standard uncertainty of input qi. The expression assumes small uncertainties, a sufficiently smooth model, and independent inputs. If inputs are correlated, covariance terms must be added. An expanded uncertainty is commonly reported as U = kuc, where k is a stated coverage factor; its interpretation depends on the uncertainty model and probability assumptions.
Worked example: bridge measurement
Suppose a calibrated force sensor has sensitivity 2.00 mV/N and an offset of 10.0 mV. The measured output is 210 mV. The estimated force is
F̂ = (210 mV − 10.0 mV)/(2.00 mV/N) = 100 N
If sensitivity uncertainty is 0.5% of reading and voltage-measurement uncertainty is 1.0 mV, approximate independent contributions are 0.50 N and 0.50 N, respectively. Thus,
uc = √(0.50² + 0.50²) N ≈ 0.71 N
This excludes unmodelled hysteresis, temperature effects, and installation errors. Reporting 100.000 N would therefore imply unjustified precision.
5. Signal conditioning and noise
Conditioning adapts a sensor to an acquisition input. Typical functions are excitation, differential measurement, amplification, level shifting, isolation, linearization, anti-alias filtering, and protection against overvoltage and electrostatic discharge. A differential amplifier rejects voltage common to both inputs. Its common-mode rejection ratio is
CMRR = 20 log₁₀(Ad/Ac)
where Ad is differential gain and Ac is common-mode gain. The expression is valid for voltage gains expressed as a ratio; real CMRR varies with frequency and gain.
Noise can arise from thermal agitation, semiconductor devices, power supplies, electromagnetic interference, quantization, and mechanical vibration. Shielding and grounding must be designed with current paths in mind. A shield connected incorrectly at multiple points can create a ground loop. Twisted differential wiring reduces magnetic pickup, while physical separation from motor cables reduces capacitive and inductive coupling.
A low-pass filter attenuates rapid variation. For a first-order RC filter,
fc = 1/(2πRC)
where R is resistance in ohms, C is capacitance in farads, and fc is the −3 dB cutoff frequency. The filter is not an ideal brick-wall filter: signals above the cutoff are attenuated progressively, and the filter introduces phase delay. The cutoff must therefore be selected with both noise reduction and control-loop dynamics in mind.
6. Sampling, quantization, and aliasing
Sampling converts a continuous-time signal into values at discrete times. If the sampling frequency is fs, the sampling interval is
Ts = 1/fs
A band-limited signal with highest frequency fmax can theoretically be reconstructed when fs > 2fmax, the Nyquist condition. In engineering systems, sampling exactly at twice the maximum frequency is unsafe because real filters are not ideal and signal frequencies may be uncertain. Anti-alias filtering must attenuate out-of-band content before the ADC.
Aliasing occurs when a frequency component above half the sampling frequency appears as a false lower frequency. For a sinusoid of frequency f, the aliased frequency can be expressed as the frequency equivalent to f modulo fs, folded into the interval from zero to fs/2. This is irreversible after sampling; digital filtering cannot recover the original frequency.
An ideal N-bit ADC with input range from Vmin to Vmax has nominal quantization step
q = (Vmax − Vmin)/2N
The actual code transition structure may differ slightly. Quantization error is often modelled as uniformly distributed between −q/2 and +q/2 when the signal exercises multiple codes and is not correlated with the sampling process. Under that model, its standard deviation is q/√12. This model is not reliable for very small, slowly varying, or highly deterministic signals.
Worked example: sampling choice
A vibration sensor must measure useful content to 800 Hz. A theoretical minimum is greater than 1.6 kHz. Choosing 4 kHz provides transition-band margin for an analogue anti-alias filter, with a sampling interval of
Ts = 1/4000 s = 250 µs
If a 12-bit ADC spans 0–5 V, its nominal step is
q = 5 V/4096 ≈ 1.22 mV
This is resolution, not guaranteed accuracy. Reference error, gain error, noise, and nonlinearity may dominate it.
7. Digital filtering and acquisition architecture
A moving average of the most recent M samples is
y[k] = (1/M)∑i=0M−1x[k−i]
where x[k] is the input sample and y[k] is the filtered output. It reduces uncorrelated noise but introduces delay and attenuates rapid changes. An exponential low-pass filter is
y[k] = αx[k] + (1−α)y[k−1]
with 0 < α < 1. Larger α responds faster and smooths less. Digital filters must be analysed relative to the sampling rate; a filter that is harmless for monitoring may destabilize a fast control loop through phase lag.
A robust acquisition pipeline includes sensor identification, excitation, protection, anti-alias filtering, ADC conversion, timestamping, range and plausibility checks, calibration, unit conversion, filtering, and diagnostics. Data should carry status information such as disconnected sensor, saturation, stale sample, checksum failure, or out-of-range value. For safety-related systems, invalid measurements should lead to a defined safe response rather than silently becoming zero.
Interfaces include analogue voltage and current loops, pulse-frequency outputs, quadrature encoders, I²C, SPI, UART, CAN, and industrial Ethernet. Selection depends on distance, noise, timing determinism, addressing, bandwidth, diagnostics, and interoperability. Digital transmission does not eliminate measurement error: sensor quantization, clock jitter, packet loss, timing latency, and incorrect scaling remain possible.
8. Encoder feedback
Incremental encoders generate pulses as a shaft rotates. A quadrature encoder provides channels A and B displaced by approximately 90 electrical degrees. The phase relationship indicates direction. Counting rising and falling transitions gives one, two, or four counts per cycle, depending on the decoding method.
If an encoder produces N counts per revolution under the selected decoding convention, angular position is
θ = 2πC/N
where C is the signed accumulated count and θ is in radians. The convention for N must be explicit: datasheets may quote cycles per revolution, pulses per revolution, or counts per revolution after quadrature multiplication.
Speed estimated over a measurement interval is
ω̂ = 2π∆C/(N∆t)
where ∆C is the count change and ∆t is the interval. At low speed, a fixed-time count method has poor resolution; measuring the period between edges improves low-speed resolution but can be sensitive to jitter. Index channel Z provides a once-per-revolution reference and is useful for homing and correction of accumulated position.
Absolute encoders report a position code directly, reducing ambiguity after power loss. Their protocols may include error detection and multi-turn information, but they cost more and still require correct mechanical alignment and communications design.
Background. An illustrative packaging machine moves a gripper 0.5 m horizontally, places products at 1 mm positional accuracy, and operates near a variable-speed motor.
Problem. An initial design used a potentiometer for position and open-loop stepper control. Results varied with vibration, potentiometer wear, and occasional missed steps. Motor switching also contaminated the analogue signal.
Analysis. The accuracy requirement made a worn contact sensor unsuitable for continuous feedback. The mechanical transmission required position feedback at the driven axis, not merely a command count at the motor. The acquisition system needed to distinguish genuine motion from electrical interference and detect loss of feedback.
Approach. The redesign used a magnetic or optical incremental encoder on the axis, with differential signalling and a hardware quadrature counter. A reference switch and encoder index established a repeatable home position. The controller sampled position at 2 kHz, while a low-pass filter was selected only after considering the servo bandwidth. The motor driver included current limiting, regenerative-energy handling, an enable interlock, and a normally safe stop condition. Software checked count plausibility, index consistency, communication status, and following error.
Outcome. Closed-loop feedback detected missed motion instead of allowing an invisible position error to accumulate. Differential wiring and separation from motor conductors reduced interference. Calibration of the axis scale and mechanical backlash characterization improved placement performance. The system remained limited by backlash, structural compliance, encoder mounting error, and stopping distance; sensor resolution alone did not define total accuracy.
Learning points. Feedback must be located where the controlled variable is physically realized. Acquisition rate, filter delay, mechanical dynamics, and fault handling are as important as nominal encoder counts. A complete specification should state accuracy, repeatability, response time, environmental rating, diagnostic coverage, and maintenance requirements.
10. Professional practice, safety, and contemporary development
Engineers should maintain traceable calibration records, document units and scaling, control configuration changes, and verify the complete signal chain rather than testing components only in isolation. Sensor data may affect worker safety, product quality, or automated decisions; therefore access control, integrity checks, and audit logs are appropriate where data are networked.
Functional safety requires hazard analysis, independent protective measures where necessary, and validation of safe states. A software limit is not always an adequate substitute for a physical stop or an independent safety circuit. EMC compliance, electrical isolation, ingress protection, and relevant machinery and measurement standards should be considered during design rather than after assembly.
Modern systems increasingly use smart sensors, time-synchronized networks, self-diagnostics, edge analytics, and machine-learning models for anomaly detection. AI can identify patterns in vibration or current, but it cannot correct an incorrectly calibrated sensor or guarantee safety outside its validated operating domain. Training data, false alarms, explainability, cybersecurity, and human override must be addressed. The fundamental engineering disciplines—calibration, uncertainty analysis, sampling theory, and fault containment—remain necessary.
Chapter Summary
Sensors transduce physical variables, actuators create controlled physical effects, and data acquisition connects both to computation. Good integration requires matching range, sensitivity, bandwidth, environmental capability, interface, and safety requirements. Accuracy and precision are different; resolution is not accuracy; and calibration establishes a traceable relationship but does not eliminate drift, hysteresis, or installation error. Uncertainty should be propagated from relevant input quantities using a valid model.
Analogue conditioning protects and adapts signals, while anti-alias filtering must precede sampling. Sampling above twice the highest signal frequency is a theoretical condition, not a complete practical design rule. ADC quantization, noise, latency, and filter phase affect control performance. Quadrature encoders provide direction and position, but count conventions, mounting, backlash, and low-speed estimation must be considered. A professional acquisition pipeline includes diagnostics, timestamping, calibration, validation, safe fault responses, and documented interfaces.
Key Terms
Sensor: Device that converts a physical measurand into a usable signal.
Actuator: Device that converts energy into controlled physical action.
Transduction: Conversion from one physical domain to another.
Sensitivity: Output change per unit input change.
Accuracy: Closeness of a result to an accepted reference value.
Precision: Degree of agreement among repeated results.
Resolution: Smallest distinguishable input or output increment.
Repeatability: Agreement under the same measurement conditions.
Hysteresis: Different output for the same input depending on input history.
Drift: Change in output or calibration with time or conditions.
Calibration: Comparison with a reference to establish measurement behaviour.
Uncertainty: Quantified doubt associated with a measurement result.
Aliasing: False frequency representation caused by inadequate sampling.
Quantization: Mapping of continuous amplitude to discrete ADC codes.
Anti-alias filter: Analogue filter that limits unwanted content before sampling.
Quadrature encoder: Two-phase encoder providing position increments and direction.
Bandwidth: Frequency range over which specified performance is maintained.
Common-mode rejection: Suppression of signals common to differential inputs.
Following error: Difference between commanded and measured actuator position.
Review Questions
Short Answer Questions
Distinguish accuracy, precision, and resolution.
Why is an anti-alias filter placed before an ADC?
State two differences between an incremental and an absolute encoder.
What information does encoder channel phase provide?
Why should a motor normally not be driven directly from a microcontroller pin?
Long Answer Questions
Explain the complete sensor-to-controller-to-actuator pipeline and identify major error sources at each stage.
Compare resistive, capacitive, inductive, optical, and piezoelectric sensors for mechatronic use.
Explain calibration, linearity, hysteresis, drift, and uncertainty using a suitable measurement model.
Discuss how sampling frequency, analogue filtering, quantization, and digital filtering affect a control system.
Describe the design and validation of an encoder-feedback system for a motorized axis.
Analytical / Application Questions
A 0–3.3 V, 12-bit ADC measures a sensor with a 0–100 °C range and an ideal linear output. Calculate the nominal voltage step and ideal temperature increment per code. What non-ADC errors must still be investigated?
An encoder provides 2,500 cycles per revolution and is decoded in four-edge mode. Determine the counts per revolution and the angular increment per count. State the convention used.
Design an acquisition and safety architecture for a motorized laboratory mechanism operating near people. Justify sensor choice, sampling, filtering, actuator drive, diagnostics, interlocks, and safe-state behaviour.
Multiple Choice Questions with Answers
Question 1
Which statement best distinguishes accuracy from precision?
A. Accuracy is closeness to a reference; precision is repeatability of results.
B. Accuracy is the number of ADC bits; precision is sensor bandwidth.
C. Accuracy describes resolution; precision describes sensitivity.
D. Accuracy and precision always have identical meanings.
Correct Answer: A. Accuracy is closeness to a reference; precision is repeatability of results.
Question 2
A first-order RC low-pass filter has R = 1 kΩ and C = 100 nF. What is its approximate cutoff frequency?
A. 1.59 Hz
B. 159 Hz
C. 1.59 kHz
D. 15.9 kHz
Correct Answer: C. 1.59 kHz
Question 3
What is the principal purpose of an analogue anti-alias filter?
A. To increase ADC resolution
B. To remove unwanted high-frequency content before sampling
C. To convert binary data into analogue voltage
D. To provide motor torque directly
Correct Answer: B. To remove unwanted high-frequency content before sampling
Question 4
A 12-bit ADC spans 0 to 5 V. What is its nominal quantization step?
A. 0.122 mV
B. 1.22 mV
C. 12.2 mV
D. 122 mV
Correct Answer: B. 1.22 mV
Question 5
In a quadrature encoder, the phase relationship between channels A and B is primarily used to determine:
A. Supply voltage
B. Absolute temperature
C. Direction of motion
D. ADC quantization noise
Correct Answer: C. Direction of motion
Question 6
An encoder produces 1,000 counts per revolution under the selected decoding convention. What angular increment corresponds to one count?
A. 0.036°
B. 0.36°
C. 3.6°
D. 36°
Correct Answer: B. 0.36°
Question 7
Which action most directly reduces electromagnetic pickup in a low-level differential sensor connection?
A. Use longer parallel unshielded wires beside motor cables
B. Use twisted differential wiring and appropriate grounding
C. Increase ADC code width without changing wiring
D. Remove all analogue conditioning
Correct Answer: B. Use twisted differential wiring and appropriate grounding
Question 8
What does a two-point linear calibration primarily estimate?
A. Offset and sensitivity
B. Sampling frequency and alias frequency
C. Motor torque and inertia
D. Encoder direction and index position
Correct Answer: A. Offset and sensitivity
Question 9
For a rotary actuator, mechanical power is calculated as:
A. P = τ/ω
B. P = τω
C. P = ω/τ
D. P = τ + ω
Correct Answer: B. P = τω
Question 10
Why can a high-resolution sensor still produce poor system accuracy?
A. Resolution always limits accuracy to zero
B. Mechanical errors, calibration errors, noise, and drift may dominate
C. High resolution prevents sampling
D. Digital interfaces eliminate all physical errors
Correct Answer: B. Mechanical errors, calibration errors, noise, and drift may dominate