Sensing, System Identification and State EstimationIntroductionIntelligent control depends on information. A controller cannot regulate a motor, vehicle, robot, or process directly from physical reality; it acts on measurements and on estimates inferred from those measurements. The quality of sensing, modeling, and estimation therefore places a fundamental limit on control performance. This chapter develops an integrated treatment of three activities: - Sensing: converting physical quantities into usable digital data.
- System identification: obtaining a mathematical model from experimental data.
- State estimation: reconstructing variables that are not measured directly.
These activities are closely related. Sensors provide observations, identification uses observations to determine model parameters, and estimation combines a model with observations to infer the evolving internal state. In practice, all three are affected by noise, bias, quantization, delays, missing data, nonlinearities, and uncertainty. Learning ObjectivesAfter studying this chapter, you should be able to: - distinguish physical variables, measurements, states, and outputs;
- select and characterize sensors for mechatronic systems;
- explain sampling, aliasing, quantization, calibration, and sensor noise;
- formulate discrete-time state-space models;
- identify model parameters from step, impulse, frequency-response, and random-input experiments;
- design and interpret Luenberger observers;
- apply the prediction and correction equations of the Kalman filter;
- combine heterogeneous sensors using sensor fusion;
- handle missing data and assess estimation uncertainty;
- evaluate data-driven methods while recognizing their limitations.
1. From Physical Reality to Digital InformationA sensor converts a physical quantity into a signal. The measured quantity is often called the measurand. Examples include position, velocity, acceleration, temperature, pressure, current, voltage, force, and angular rate. A sensor interface may include signal conditioning, amplification, filtering, isolation, analog-to-digital conversion, and communication. The measurement should not be confused with the true physical quantity. A useful model is yk = h(xk,uk) + vk + bk where yk is the measurement at sample k, xk is the system state, uk is the input, h(·) is the measurement function, vk is random measurement noise, and bk is measurement bias. The model assumes that the measurement can be represented as a deterministic component plus error; in nonlinear systems, h may be nonlinear. A state is a minimum set of variables that, together with future inputs, determines future system behavior. For a translational mass, position and velocity form a natural state. Temperature alone may be an adequate state for a lumped thermal model, whereas a distributed thermal object may require several temperatures. 1.1 Sensor performance characteristicsImportant characteristics include: - Range: minimum and maximum measurable values.
- Resolution: smallest distinguishable change.
- Accuracy: closeness to the reference value.
- Precision: repeatability under repeated measurements.
- Sensitivity: output change per unit input change.
- Linearity: deviation from an ideal input-output relationship.
- Hysteresis: dependence of output on the direction of input variation.
- Bandwidth: frequency range over which the sensor responds adequately.
- Latency: time between a physical event and the reported value.
- Drift: slow change in output for a constant measurand.
- Cross-sensitivity: response to an unwanted variable.
Accuracy and precision are distinct. A biased sensor may be precise but inaccurate. Calibration against a traceable reference can reduce systematic error, but it cannot remove random noise or a fundamentally inadequate bandwidth. 1.2 Sampling and aliasingA digital controller receives samples at intervals Ts, with sampling frequency fs = 1/Ts. A sinusoidal signal with frequency f is represented without aliasing only when the sampling frequency exceeds twice the highest relevant signal frequency: fs > 2fmax This is the Nyquist condition for band-limited signals. In practice, engineers sample substantially faster than the control bandwidth and place an analog anti-aliasing filter before the analog-to-digital converter. If a signal at frequency f exceeds the allowable range, it may appear as a false lower frequency. Digital filtering after sampling cannot reliably undo this ambiguity. 1.3 Quantization and resolutionAn ideal N-bit converter with input span from [[MATH,V_min]] to [[MATH,V_max]] has an approximate quantization interval Δq = (Vmax − Vmin)/2N where Δq is in volts if the input limits are in volts. The quantization error is commonly modeled as uniformly distributed between −Δq/2 and +Δq/2, provided the signal exercises several quantization levels and is not correlated with the sampling process. Its variance is approximately σq2 = Δq2/12 This model is an approximation, not a guarantee. Saturation, code nonlinearity, electrical interference, and inadequate grounding may dominate quantization noise. 1.4 Noise and filteringNoise may arise from thermal effects, electromagnetic interference, vibration, optical fluctuations, quantization, or communication errors. A moving average of window length M is yk = (1/M) ∑_(i=0)^(M−1) x_(k−i) where xk is the raw sample and yk is the filtered sample. It reduces zero-mean independent noise but introduces delay and attenuates rapid changes. A filter is therefore part of the measurement dynamics, not a free improvement. For a first-order low-pass filter with time constant τ, τ dy(t)/dt + y(t) = x(t) where x(t) is the input signal and y(t) is the filtered output. Its cutoff frequency is fc = 1/(2π τ). The equation assumes a linear time-invariant filter and continuous time. 2. Modeling Dynamic SystemsA continuous-time state-space model is ẋ(t) = f(x(t),u(t),t) + w(t) y(t) = h(x(t),u(t),t) + v(t) Here x is the state vector, u is the input, y is the output, and w and v represent process and measurement disturbances. For a linear time-invariant system, ẋ(t) = Ax(t) + Bu(t) + w(t) y(t) = Cx(t) + Du(t) + v(t) The dimensions must be compatible: if the state has n components, A is n×n, B is n×m for m inputs, C is p×n for p outputs, and D is p×m. The entries of A, B, C, and D depend on the selected units and state definitions. A discrete model used by a digital controller is x_(k+1) = Ad xk + Bd uk + wk yk = Cd xk + Dd uk + vk For zero-order-held input over a sampling interval Ts, an exact discretization of a continuous linear model is Ad = e^(A Ts), Bd = ∫0Ts e^(Aτ)B dτ The integral is valid for constant input during each interval. Numerical approximations can be used, but the sampling period must be small enough to capture relevant dynamics. Example: position measurement of a massConsider a mass m subject to an applied force u and viscous friction coefficient c. Newton’s law is m q̈ + c q̇ = u Choose x1=q and x2=q̇. Then ẋ = [0 1; 0 −c/m]x + [0; 1/m]u If only position is measured, y = [1 0]x + v Velocity is a hidden state. Direct numerical differentiation of noisy position data is possible but usually amplifies high-frequency noise; an observer or filter is preferable. 3. System IdentificationSystem identification is the construction or refinement of a mathematical model from measured inputs and outputs. It is valuable when first-principles modeling is incomplete, parameters are uncertain, or unmodeled effects are significant. An identification experiment should be designed before data collection. The engineer must specify the purpose, operating region, sampling rate, excitation, safety limits, sensors, and validation procedure. A model intended for controller design need not reproduce every physical detail; it must reproduce the behavior relevant to the control objective. 3.1 Experimental excitationCommon experiments include: - Step tests: reveal gain, delay, rise time, settling time, and dominant time constants.
- Impulse or pulse tests: emphasize transient dynamics, though ideal impulses are not physically realizable.
- Ramp tests: reveal tracking and rate-dependent behavior.
- Frequency sweeps: estimate gain and phase as functions of frequency.
- Pseudo-random binary sequences: provide broad excitation while remaining easy to generate.
- Multisine or broadband random inputs: excite several frequencies efficiently.
The input must be persistently exciting over the frequency range needed for identification. If an actuator is commanded almost constantly, many different models may explain the data equally well. 3.2 Parametric identificationA parametric model assumes a chosen structure with unknown parameters. For a first-order discrete model, yk = a y_(k−1) + b u_(k−1) + ek where a and b are unknown and e is a residual. Define θ = [a; b], φk = [y_(k−1); u_(k−1)] Then yk = φkT θ + ek. With N observations, ordinary least squares estimates the parameters by θ̂ = (ΦT Φ)^(−1) ΦT Y where Φ contains the regression rows φkT and Y contains measured outputs. The inverse exists only when Φ has full column rank. Poor excitation causes ill-conditioning and unreliable estimates. In practice, QR or singular-value decomposition is numerically safer than explicitly forming an inverse. The residuals should be examined. A useful model should leave residuals approximately uncorrelated with past inputs and outputs. If residuals show periodicity, changing variance, or correlation, the model may omit dynamics, nonlinearities, delays, or noise structure. 3.3 Nonparametric identificationFrequency-response identification estimates complex gain at selected frequencies without committing to a low-order differential equation. For a sinusoidal input at frequency ω, the steady-state output amplitude ratio estimates magnitude and the phase shift estimates phase. This is useful for controller design and model validation, but it may be expensive for slowly varying systems and does not by itself identify behavior outside the tested range. 3.4 Validation and overfittingData should be divided into identification and validation sets, preferably collected under different input realizations. Useful measures include root mean square error: RMSE = √[(1/N)∑_(k=1)N (yk − ŷk)2] where yk is measured output and ŷk is predicted output. RMSE has the same units as the output. It should not be interpreted in isolation: a model can have low average error while failing dangerously during saturation or fast transients. A model that is excessively complex may fit noise rather than system behavior. Regularization, physical constraints, cross-validation, and independent testing reduce this risk. Identification data must also include actuator saturation, sensor delays, and disturbances when these matter in operation. 4. Observability and Luenberger ObserversA system is observable if its internal state can be uniquely inferred from a finite sequence of known inputs and measured outputs. For the discrete linear model x_(k+1) = Axk + Buk, yk = Cxk the observability matrix is 𝒪 = [C; CA; CA2; …; CA^(n−1)] For an n-state system, the system is observable if rank(𝒪)=n. Observability is a structural property of the model and sensor placement; it is not the same as numerical estimation quality. A formally observable system may still be poorly conditioned in the presence of noise. A full-order Luenberger observer is x̂_(k+1) = A x̂k + B uk + L(yk − C x̂k) where x̂k is the estimated state and L is the observer gain. The term yk − Cx̂k is the innovation or output estimation error. If the true system follows the assumed model, the estimation error ek=xk−x̂k evolves as e_(k+1) = (A − LC)ek Thus L is selected so that the eigenvalues of A−LC lie inside the unit circle for a discrete-time stable observer. Pole placement can make the observer faster than the plant, but excessively fast poles amplify measurement noise and sensitivity to modeling errors. The observer is appropriate when model parameters are reasonably known and noise statistics are not the primary design uncertainty. It is less suitable when disturbances are large, stochastic uncertainty is important, or the system is strongly nonlinear. 5. Kalman Filtering and UncertaintyThe Kalman filter is a recursive minimum-variance estimator for a linear stochastic model under standard assumptions. Consider xk = A x_(k−1) + B u_(k−1) + w_(k−1) yk = C xk + vk Assume that process noise w and measurement noise v have zero means, are white, and are mutually uncorrelated, with covariances E[wk wjT] = Q δkj, E[vk vjT] = R δkj where Q and R are positive semidefinite and positive definite, respectively, and δ is the Kronecker delta. These assumptions make the classical filter mathematically tractable; real data may violate them. 5.1 Prediction and correctionGiven the previous estimate x̂_(k−1|k−1) and covariance P_(k−1|k−1), the prediction is x̂_(k|k−1) = A x̂_(k−1|k−1) + B u_(k−1) P_(k|k−1) = A P_(k−1|k−1) AT + Q The innovation is rk = yk − C x̂_(k|k−1) and its covariance is Sk = C P_(k|k−1) CT + R The Kalman gain is Kk = P_(k|k−1) CT Sk^(−1) The corrected estimate is x̂_(k|k) = x̂_(k|k−1) + Kk rk A numerically robust covariance update is the Joseph form: P_(k|k) = (I−KkC)P_(k|k−1)(I−KkC)T + Kk R KkT The covariance matrix represents uncertainty, not an error value. Its diagonal entries are variances and their square roots are standard deviations, in the squared units of the corresponding states. Correlations appear in off-diagonal entries. When Q is large relative to R, the filter trusts the model less and measurements more. When R is large relative to Q, it trusts the model more. Incorrect tuning can cause lag, excessive noise, divergence, or unjustified confidence. Covariance consistency should be checked using innovation statistics, not chosen only by trial and error. 5.2 Missing measurementsIf a measurement is unavailable at time k, perform the prediction step but omit the correction step: x̂_(k|k) = x̂_(k|k−1), P_(k|k) = P_(k|k−1) The uncertainty generally grows during a measurement outage. If only some sensor channels are missing, use the available rows of C and the corresponding submatrix of R. Time stamps should be honored; irregular sampling may require a modified transition matrix for the actual interval. 5.3 Nonlinear systemsFor nonlinear models, the extended Kalman filter linearizes the dynamics and measurement function around the current estimate. If the Jacobians are inaccurate or the initial estimate is poor, the filter can become inconsistent or diverge. The unscented Kalman filter propagates selected sigma points and can better represent some nonlinear transformations without explicitly computing Jacobians. Neither method removes the need for realistic noise models and observability. 6. Sensor Fusion and Data-Driven EstimationSensor fusion combines measurements with complementary strengths. An encoder may provide accurate position but no absolute reference after power loss. An inertial measurement unit provides high-rate acceleration and angular velocity but drifts after integration. A camera supplies geometric information but may be delayed or affected by lighting. Fusion uses the model and uncertainty of each source rather than simply averaging values. For two independent scalar measurements z₁ and z₂ of the same constant quantity, with variances σ₁² and σ₂², the minimum-variance weighted estimate is ẑ = [z₁/σ₁² + z₂/σ₂²] / [1/σ₁² + 1/σ₂²] Its variance is σ̂² = 1/[1/σ₁² + 1/σ₂²] These equations assume unbiased, independent measurements of the same quantity. Correlated errors require covariance terms and cannot be handled by treating the sources as independent. Data-driven estimators include regression, neural networks, support-vector methods, Gaussian processes, and recurrent sequence models. They can learn nonlinear mappings from sensor histories to states or outputs. Their use in safety-relevant control requires attention to training coverage, distribution shift, uncertainty quantification, explainability, and fallback behavior. A learned estimator should not be accepted solely because its test error is low; its performance must be evaluated under sensor faults, environmental changes, saturation, and rare but consequential conditions. 7. Applied Case: Sensor Fusion for a Mobile RobotBackgroundConsider an illustrative autonomous warehouse robot moving on a level floor. It has wheel encoders, an inertial measurement unit, and a lidar-based position measurement. The controller requires estimates of planar position and velocity. ProblemWheel slip causes encoder integration to drift. IMU acceleration is available at high frequency but contains bias and noise. Lidar position is more absolute but arrives less frequently and may be temporarily unavailable when shelving blocks the scan. AnalysisA simplified one-dimensional state is xk = [pk; vk; bk] where p is position, v is velocity, and b is accelerometer bias. A constant-acceleration approximation is p_(k+1) = pk + Ts vk + (Ts²/2)(ak − bk) v_(k+1) = vk + Ts(ak − bk) b_(k+1) = bk + wb Here a is measured acceleration, Ts is the sampling interval, and wb models slow bias variation. The state transition matrix is formed from these equations. Lidar supplies approximately yk=pk+vkL, where vkL is lidar noise. ApproachAn extended or linear Kalman filter predicts position and velocity from the IMU, estimates the slowly changing bias, and corrects the prediction when lidar data arrive. During lidar outages, the prediction continues while covariance increases. Encoder velocity can be added as another measurement with a slip-dependent noise covariance. A slip detector may increase encoder noise when wheel speed disagrees with IMU or lidar motion. The engineering workflow is: - synchronize time stamps and estimate sensor delays;
- calibrate axes, scale factors, and fixed biases;
- collect data during straight motion, turning, acceleration, and stopping;
- estimate Q and R from residuals and calibration experiments;
- test observability of position, velocity, and bias;
- validate on routes not used for tuning;
- monitor innovations and covariance during operation;
- define a safe degraded mode when all absolute measurements are lost.
OutcomeThe fused estimate is typically smoother than lidar alone and less drift-prone than inertial integration alone. The result is not guaranteed: incorrect synchronization, unmodeled wheel slip, or overconfident covariance values can cause the filter to reject valid lidar corrections or accept faulty data. Learning pointsThe case illustrates that sensor fusion is a model-based reasoning process. Sensor selection, calibration, time alignment, uncertainty modeling, fault detection, and fallback control are as important as the filter equations. 8. Practical Design and Governance ConsiderationsA robust sensing and estimation system should: - define the control objective and required accuracy before selecting sensors;
- use physically meaningful units and documented coordinate frames;
- calibrate gain, offset, alignment, temperature dependence, and delay;
- prevent aliasing with suitable analog filtering;
- time-stamp measurements at their source;
- retain raw data and metadata for diagnosis;
- test saturation, dropout, stuck values, bias, outliers, and communication delay;
- use innovation and residual monitoring for fault detection;
- preserve positive semidefiniteness of covariance matrices;
- validate under operating conditions, not only laboratory conditions;
- separate training, tuning, validation, and final test data;
- provide safe behavior when estimates become unreliable.
In industrial and safety-related systems, estimation software may be subject to functional-safety, cybersecurity, quality-management, and traceability requirements. Sensor data can also reveal location, behavior, or biometric information. Data collection should therefore follow purpose limitation, access control, retention policies, and applicable privacy law. An AI estimator must be governed by version control, documented training data, performance monitoring, and a human-approved change process. 9. Challenges and LimitationsNo estimator can recover information that the sensors and system dynamics do not make observable. Common failure modes include: - Unmodeled dynamics: flexible structures, friction, backlash, and actuator saturation;
- Non-Gaussian noise: outliers, impacts, heavy tails, and quantization artifacts;
- Correlated errors: common clocks, shared power supplies, or common environmental disturbances;
- Parameter drift: temperature, wear, payload changes, and aging;
- Poor excitation: insufficient information for identification;
- Numerical ill-conditioning: nearly dependent regressors or weak observability;
- Data leakage: using future information during offline validation;
- Distribution shift: deployment conditions unlike training data;
- Latency and asynchronous sensors: measurements describing different physical times;
- Fault masking: fusion that produces plausible but incorrect estimates.
The appropriate response is not always a more sophisticated algorithm. Better calibration, sensor placement, excitation, time synchronization, physical modeling, or fault isolation may provide greater benefit. Chapter SummarySensing converts physical variables into imperfect digital observations. Range, resolution, accuracy, precision, bandwidth, latency, drift, sampling, aliasing, and quantization determine the usefulness of those observations. Dynamic systems can be represented in continuous or discrete state-space form, with process and measurement disturbances explicitly modeled. System identification obtains models from experiments. Effective identification requires suitable excitation, careful sampling, appropriate model structure, numerically stable estimation, residual analysis, and independent validation. Observability determines whether hidden states can theoretically be reconstructed. Luenberger observers use deterministic model correction, whereas Kalman filters combine model prediction and measurements according to uncertainty covariance. Sensor fusion is most effective when sensor errors, timing, correlations, and failure modes are understood. Missing measurements can be handled by prediction, but uncertainty must increase and degraded operation must be recognized. Data-driven estimators can represent nonlinear behavior but require rigorous validation against distribution shift and safety risks. Professional practice combines mathematical estimation with calibration, diagnostics, governance, cybersecurity, privacy, and safe fallback design. Key TermsSensor: Device or subsystem that converts a physical measurand into a signal. Measurand: Physical quantity intended to be measured. State: Minimum set of variables needed to describe future system behavior with known inputs. Output: Quantity made available through a measurement model. Measurement noise: Random error added to an observation. Bias: Systematic offset or slowly varying error. Sampling: Representation of a continuous signal at discrete time instants. Aliasing: Misrepresentation of a high-frequency signal as a lower-frequency signal after sampling. Quantization: Mapping a continuous-amplitude signal to discrete digital levels. System identification: Estimation of a dynamic model from measured data. Persistent excitation: Input richness sufficient to distinguish model parameters. Observability: Ability to infer internal states from inputs and outputs. Luenberger observer: Deterministic state estimator using output-error feedback. Kalman filter: Recursive stochastic estimator based on a state model and noise covariances. Innovation: Difference between an actual measurement and its predicted value. Covariance: Matrix describing variances and correlations of uncertain quantities. Sensor fusion: Combination of multiple measurements and a model to estimate a quantity. Residual: Difference between measured and model-predicted output. Distribution shift: Change between the data distribution used for development and that encountered in deployment. Review Questions5 Short Answer Questions- Distinguish accuracy from precision and give an example of a sensor that is precise but inaccurate.
- Why is an analog anti-aliasing filter normally placed before an analog-to-digital converter?
- What is the physical meaning of the innovation in a Kalman filter?
- State the rank condition for observability of an n-state linear system.
- Why does a Kalman-filter covariance usually grow during a measurement outage?
5 Long Answer Questions- Explain the complete path from a physical measurand to a digital controller, including calibration, conditioning, sampling, quantization, and communication effects.
- Describe how you would design and validate a system-identification experiment for a motor-driven positioning stage.
- Derive the estimation-error dynamics of a Luenberger observer and explain the trade-off in selecting observer poles.
- Explain the prediction and correction stages of the Kalman filter and discuss the roles of Q and R.
- Compare physics-based, parametric, and data-driven estimators for a nonlinear mechatronic system.
3 Analytical / Application Questions- A position sensor has a 0–5 V range and a 12-bit converter. Calculate the approximate voltage resolution and explain two reasons why actual accuracy may be worse.
- A robot uses wheel encoders and lidar. Design a fault-tolerant fusion strategy for temporary lidar loss and wheel slip, including measurements, uncertainty changes, and fallback behavior.
- A fitted model has low RMSE on training data but correlated residuals on validation data. Analyze at least three possible causes and propose an investigation plan.
Multiple Choice Questions with AnswersQuestion 1Which condition is required for a band-limited signal with highest frequency f_max to avoid ideal sampling aliasing? A. f_s < f_max B. f_s = f_max C. f_s > 2f_max D. f_s > f_max/2 Correct Answer: C. f_s > 2f_max Question 2For an N-bit converter spanning V_min to V_max, which expression approximates one quantization interval? A. (V_max + V_min)N B. (V_max − V_min)/2^N C. 2^N/(V_max − V_min) D. (V_max − V_min)^N Correct Answer: B. (V_max − V_min)/2^N Question 3A discrete linear system with n states is observable when which condition holds? A. rank(𝒪)=0 B. rank(𝒪)=1 C. rank(𝒪)<n D. rank(𝒪)=n Correct Answer: D. rank(𝒪)=n Question 4What is the innovation in the standard Kalman filter? A. The difference between the actual and predicted measurement B. The process-noise covariance C. The control input multiplied by B D. The prior state covariance Correct Answer: A. The difference between the actual and predicted measurement Question 5If measurement noise covariance R becomes much larger while the model remains unchanged, the Kalman filter generally does what? A. Trusts the measurement more B. Trusts the model prediction more C. Removes process noise Q D. Makes the system automatically observable Correct Answer: B. Trusts the model prediction more Question 6When a measurement is missing at one time step in a standard Kalman filter, the appropriate basic operation is to: A. Set the state estimate to zero B. Perform prediction and omit the correction C. Set covariance to zero D. Replace the missing value with an arbitrary constant Correct Answer: B. Perform prediction and omit the correction Question 7Why can an excessively fast Luenberger observer be undesirable? A. It always makes the plant unstable B. It eliminates observability C. It can amplify measurement noise and modeling errors D. It prevents use of any input signal Correct Answer: C. It can amplify measurement noise and modeling errors Question 8A 12-bit converter has a 0–5 V input span. Its approximate quantization interval is closest to: A. 0.00122 V B. 0.0122 V C. 0.122 V D. 1.22 V Correct Answer: A. 0.00122 V Question 9Which experimental input is specifically intended to provide broad excitation for identifying dynamic behavior? A. A constant input with no variation B. A persistently exciting pseudo-random sequence C. A disconnected actuator D. A saturated signal held indefinitely Correct Answer: B. A persistently exciting pseudo-random sequence Question 10Which statement about RMSE is correct? A. It has squared output units B. It is always independent of data scale C. It has the same units as the measured output D. It proves that a model is physically correct Correct Answer: C. It has the same units as the measured output
|