All projects

// ANALYSIS · 2026

Thermal System Identification

Second-order dynamic modeling and least squares estimation for an Arduino PWM heater

MATLAB plot of temperature versus time comparing measured Data Set 2 with a four-parameter least squares approximation that closely overlaps it
MODEL VALIDATION
6.9% Error
HARDWARE
Arduino PWM
PLANT DYNAMICS
2nd-Order Thermal

Problem

Characterize the thermal dynamics of a 20 Ω power resistor clamped to binder clips and an LM35DT temperature sensor—driven via MOSFET PWM from an Arduino to establish an accurate plant model for closed-loop controller design.

Approach

  1. 01Built the breadboard circuit with an 8 V supply, gate protection resistors, and Arduino code that accepts a user entered duty cycle and logs temperature every 30 seconds.
  2. 02Derived a second-order differential equation from a linear graph and normal tree with lumped heater and clip thermal masses, forming the transfer function and proving overdamped behavior.
  3. 03Recorded a 100% duty cycle step response to find steady-state gain (20.02 °F/W) and the time constant (200.64 s), comparing it against a first-order approximation.
  4. 04Collected a multi-step doublet response by ramping duty cycle up and down, discretized the model with a zero-order hold, and solved a four-parameter least squares estimate in MATLAB.

Gallery

  • MATLAB plot of the 100% duty cycle step response rising from 0 to about 64 degrees Fahrenheit above ambient over 720 seconds
    Data Set 1: step response at 100% duty cycle
  • Normal tree diagram linking heater and clip temperatures through conductive and convective resistances, thermal capacitances, and heat input to ambient
    Normal tree for the two-mass thermal model

Results

  • Least squares model tracked measured data closely across heating and cooling peaks, capturing the conduction delay that the first-order model missed.
  • Discrete steady-state gain of 18.64 °F/W matched the continuous estimate within 6.9%.
  • Identified slow pole of 0.005 s⁻¹ matched the step-response value within 0.32%, providing a validated plant model for feedback controller design.

Documentation

NEXT PROJECTOscillating Air Engine