MEGR 3171  |  UNC Charlotte Mechatronics 2
Dr. Roger Tipton
Mechanical Engineering & Engineering Science
Back to Course Hub
Week 10 — Module 2: Advanced Sensor Systems

Inertial & Vision-Based Sensing

MEMS inertial sensors, IMU architecture, sensor fusion algorithms, and the fundamentals of machine vision for position measurement.

Learning Objectives

1. MEMS Accelerometer

A MEMS accelerometer contains a proof mass suspended by springs. Applied acceleration displaces the mass, and the displacement is measured capacitively. The spring-mass system has a natural frequency; signals below this frequency are faithfully measured, while the device also measures gravity (DC component).

Key Accelerometer Specs
Sensitivity: e.g., 300 mV/g or 1 LSB/mg Full-scale range: ±2g, ±4g, ±8g, ±16g (selectable) Zero-g offset: DC bias at zero acceleration Noise density: µg/√Hz (lower = better) Cross-axis sensitivity: coupling between axes (<2% typical)

Accelerometers measure specific force: the sum of kinetic acceleration and gravity. At rest, a flat accelerometer reads +1g on the vertical axis. To isolate kinetic acceleration, gravity must be subtracted using orientation knowledge.

2. MEMS Gyroscope

A MEMS gyroscope uses the Coriolis effect: a vibrating proof mass experiences a force perpendicular to both its vibration direction and the rotation axis. This Coriolis force is proportional to angular rate and is measured capacitively.

Angular Rate Output

Output in °/s (or rad/s). Integrate once to get angle. Integration accumulates bias error over time (gyroscope drift).

Bias Instability

The floor of the bias error. Cannot be calibrated out over long periods. Expressed in °/hr. Key long-term accuracy spec.

Angle Random Walk

Noise-induced angular error that grows as √time. Expressed in °/√hr. Dominates short-term accuracy.

Scale Factor Error

Gain error in the rate-to-output relationship. Creates proportional error at high rotation rates. Calibrated at factory.

3. Sensor Fusion: Complementary Filter

Accelerometers give absolute orientation (gravity reference) but are noisy and measure all accelerations. Gyroscopes give smooth, fast rate measurements but drift over time. A complementary filter combines the best of both:

Complementary Filter (Pitch Angle)
θ[k] = α · (θ[k-1] + ω_gyro · dt) + (1 − α) · θ_accel where: α = high-pass weight (typically 0.95 to 0.99) ω_gyro = gyroscope angular rate (rad/s) dt = sample period θ_accel = arctan(a_y / a_z) (from accelerometer) α acts as HPF on gyro; (1-α) acts as LPF on accelerometer
Choosing Alpha (α) High α (e.g., 0.99) trusts the gyroscope more — smooth but slow to correct drift. Low α (e.g., 0.90) trusts the accelerometer more — faster correction but more sensitive to vibration. The complementary filter time constant: τ = α·dt / (1-α).

4. Camera Fundamentals for Machine Vision

For position measurement using a camera, the pixel-to-physical mapping converts pixel coordinates to real-world coordinates:

Pixel-to-Physical Mapping
Physical size per pixel = (physical field of view width) / (image width in pixels) Example: 200 mm FOV, 1920 pixel width: Scale = 200 / 1920 = 0.1042 mm/pixel Object position = (pixel_x - image_center_x) × scale

Calibration using a known reference target (checkerboard) is required to determine pixel scale, lens distortion coefficients, and camera-to-world transformation. Without calibration, position errors from lens distortion can be several percent of the field of view.

Practice Problems

Problem 1 — Complementary Filter At time k-1, the estimated pitch angle is 10.0°. The gyroscope reads ω = 5.0 °/s, dt = 0.01 s, and the accelerometer gives θ_accel = 10.6°. Using α = 0.98, compute the new estimated pitch angle at time k.

Gyro integrated: θ_prev + ω·dt = 10.0 + 5.0×0.01 = 10.0 + 0.05 = 10.05°

θ[k] = 0.98 × 10.05 + 0.02 × 10.6 = 9.849 + 0.212 = 10.061°

θ[k] ≈ 10.06°
Problem 2 — MEMS Noise A gyroscope has an angle random walk (ARW) of 0.1 °/√hr. After 30 minutes of integration with no corrections, what is the expected 1-sigma attitude error?

ARW = 0.1 °/√hr. Time = 0.5 hr. Error = ARW × √t = 0.1 × √0.5 = 0.1 × 0.707 = 0.0707°

1-sigma error ≈ 0.071° (after 30 min with no corrections)