Skip to content
HYHanie Yazdi
CV
← All projects

Project · 2026 · Independent

Closed-loop pressure control rig

A bench rig built to reproduce a real control problem: a pressure sensor that is blind over part of its range. Feedforward from a measured curve, feedback only where the sensor is valid, and a supervisor with a defined safe state.

RoleIndependent: rig, firmware, analysis
MCUSTM32F411, FreeRTOS
SensorBMP280 pressure
RepoHani256/pressure-control-rig
73%mean faster adaptation (67, 70, 82%)
72%less model error after one 180 s run
9blind-range crossings measured
2.21 Pamean drift, worst case 3.10 Pa
7faults found from logged traces

The problem

A pressure sensor that is blind over part of its range. Inside that range the measurement cannot be used for feedback, so open-loop and closed-loop control cannot simply be combined.

The rig reproduces this on a bench: an STM32F411 drives a PWM fan that blows into an isolated chamber, and a BMP280 measures the pressure. The blind band is applied in software. Inside it the controller gets no pressure reading, while the true pressure is still logged so every run can be evaluated afterwards.

Pressure rig: fan blowing into an isolated chamber, pressure sensor inside at the back
The rig: the fan blows into an isolated chamber, the pressure sensor sits inside at the back. OLED: temperature, pressure, fan speed and duty.

Control structure

  • Feedforward from a measured curve of the plant: scale and offset.
  • Feedback only where the sensor is valid.
  • Supervisor with a defined safe state.

The model gain k is learned online, but only from trusted measurements. While the sensor is valid, the controller measures pressure and corrects the model prediction. While it is blind, the controller predicts pressure from the model, and both learning and the pressure integrator are frozen.

Setpoint Feedforwardmeasured curvescale + offset Feedbackactive only wherethe sensor is valid + PWM fan Sealed box BMP280blind over part of range Supervisordefined safe state pressure valid? safe state

Logging without disturbing the timing

A RAM ring buffer logs the control task while it runs, without changing its timing. The trace is read out afterwards. All seven faults found in this project came out of a logged trace.

Measured results

Adaptation was 67%, 70% and 82% faster across three runs, a mean of 73%.

9crossings of the blind range
2.21 Pamean drift across the crossings
3.10 Paworst-case drift
7faults found, all from logged traces

Learning on versus learning off

Each run starts with a model that is 24% wrong and runs for 180 seconds, stepping the setpoint between 10 Pa and 35 Pa. The same run is done with learning frozen and with learning enabled.

72% less model error after one 180 s run: the mean static-model error across the evaluated duty range dropped from 3.74 Pa to 1.04 Pa.

Pressure, duty and model gain over a 180 s run with learning frozen
Learning frozen. Top: setpoint, true pressure and controller estimate. Middle: fan duty. Bottom: model gain k stays at its start value. Pink: controller blind.
Pressure, duty and model gain over a 180 s run with learning enabled
Learning enabled. The model gain k climbs from 0.70 toward 0.9 as the controller learns from trusted measurements.
A falling transition through the blind band, learning frozen and enabled
One falling transition, enlarged. Black: measured. Blue: estimated. Orange: target. Pink lines: blind interval. With learning enabled the estimate stays closer to the measured pressure while blind.

What is still open: overshoot is visible in both runs, and rising transitions still show a dynamic mismatch. A safe limit on how long the controller may stay blind needs a validated error envelope and margin.

The firmware and the analysis scripts are published together, so every number on this page can be checked against the data.

github.com/Hani256/pressure-control-rig