Case Study - Temperature Control of a Heated-Air Tube
In questa pagina 5
Worked example of the non-idealities of Non-Idealities in a Control Loopmodels and control consequences of the main non-idealities of a feedback loop, namely sensor bias, noise, quantization and limited bandwidth, actuator saturation and limited bandwidth, time delays with Pade approximations, disturbances and parameter or model uncertainties.Non-Idealities in a Control Loop →: the plant has a time delay, the actuator saturates, the sensor quantizes and adds measurement error, and the controller is digital. Modeling follows the energy-balance approach (compare System ModelingA mathematical model (parameters, variables, relations) describes a system quantitatively; models are classified as static or dynamic, causal, linear, time-invariant, SISO or MIMO, and the course focuses on SISO continuous-time causal dynamic LTI systems described by a constant-coefficient input-output ODE.System Modeling → and Continuous-Time Modeling of Dynamic SystemsWhy control engineers need a model, white-box versus black-box modeling, the assumptions behind linear time-invariant lumped models, linear ODEs with constant coefficients, and the classification of lumped elements as passive or active.Continuous-Time Modeling of Dynamic Systems →).
1. The system
An airflow is forced inside a cylindrical tube by a fan; the inflow air is heated by an electrical resistor (heater); the outflow air temperature is measured with a thermocouple at the outlet. Goal: regulate the air temperature at the outlet port.
fan --> [ inlet ---R(heater)------------- L ------------ thermocouple ] --> outlet
inflow ambient T_a "control" volume (temperature T) outflowHardware blocks:
| block | component |
|---|---|
| heated-air tube | transparent cylinder with inlet and outlet |
| fan | forces the airflow |
| electrical heater | resistor at the inlet |
| voltage driver | BTS7960 half-bridge |
| temperature sensor | K-type thermocouple |
| voltage amplifier + ADC | MAX6675 |
| microcontroller | Arduino Mega 2560 |
Roles in the control loop:
- Process: the physical system to control, i.e. the heated airflow inside the cylinder, including heat transfer from the resistor to the air, airflow transport along the tube and heat losses to the environment.
- Actuator: the subsystem that converts the control command into thermal power: the heating resistor plus the BTS7960 half-bridge driver.
- Sensor: the subsystem that converts the outlet temperature into a digital measurement: the K-type thermocouple plus the MAX6675 voltage amplifier and ADC.
- Controller: the digital control algorithm that reads the measured temperature, compares it with the reference and generates the PWM command that drives the heater. It is implemented on the Arduino Mega 2560.
2. Process model
Write the heat balance for a heated region near the resistor (the "control" volume), where the temperature can be assumed approximately uniform. The tube has length (distance from the resistor to the thermocouple), air speed , ambient temperature .
Energy balance:
with
| term | expression | meaning |
|---|---|---|
| stored thermal energy | ||
| heater thermal energy | ||
| incoming thermal energy | ||
| outgoing thermal energy | ||
| thermal losses |
Notation: average temperature of the control volume, ambient temperature, effective mass of air in the control volume, , incoming and outgoing mass of air, specific heat of air, thermal resistance of the tube surface, voltage applied to the heater resistor .
Simplifying assumption: the air is incompressible, so with , where is the air density, the cylinder base area and the air speed (assumed constant).
Heat (thermal power) balance, dividing by :
with heater power , incoming heat flow , outgoing heat flow , heat losses , and . Hence
(The slides write on the left; here the mass of air in the control volume is denoted to distinguish it from the mass flow .)
Define (ambient temperature taken as constant):
This is a first-order LTI model:
Here is the heater power. Laplace transform: , so
Transport delay. The time the control volume needs to reach the outlet (where the thermocouple is) is
The outlet temperature is therefore delayed: , i.e. .
Process transfer function:
heater power u_p --> [ K/(tau s + 1) e^{-s T_d} ] --> y_p --(+)--> outlet temperature T
^
T_aThe delay is non-rational; see the Pade approximation in Non-Idealities in a Control Loopmodels and control consequences of the main non-idealities of a feedback loop, namely sensor bias, noise, quantization and limited bandwidth, actuator saturation and limited bandwidth, time delays with Pade approximations, disturbances and parameter or model uncertainties.Non-Idealities in a Control Loop →. The first-order part is the model of BIBO Stability and First-Order ModelsA linear system response splits into a natural response from the initial conditions and a forced response from the input; BIBO stability concerns the forced response and stability of the zero equilibrium concerns the natural one, and an n-th order ODE can be rewritten as n first-order equations (a state model) whose transfer function is obtained from the matrices A, B, C and D.BIBO Stability and First-Order Models →.
3. Actuator model
The heating resistor is driven by an Infineon BTS7960 half-bridge circuit: two switches ( high side to the supply , low side to ground) are driven with complementary PWM signals, so the voltage on the resistor is a square wave between and 0, with on-time in a PWM period .
Average power delivered by the heating resistor:
so the average power is proportional to the PWM duty cycle .
Actuator model: the command is saturated into a duty cycle, then multiplied by the gain :
This is the saturation non-ideality of the previous note, with and .
4. Sensor model
The outlet temperature is measured with a type-K thermocouple, whose output voltage is approximately proportional to the temperature difference between the hot junction and the ambient:
The voltage is amplified and converted to a digital signal by the Maxim MAX6675 "K-Thermocouple-to-Digital Converter". Block diagram (as in the datasheet figure of the slides): input low-noise differential amplifier (stages A1 and A2 with input switches S1 to S3), cold-junction compensation diode, reference voltage, ADC with digital controller and serial interface (SCK, SO, CS).
- Cold-junction compensation: the hot-junction temperature is obtained by "adding" the ambient temperature (sensed by a diode) to the thermocouple voltage.
- The compensated thermocouple voltage is converted with a 12-bit ADC: a sequence of all zeros means 0 C, a sequence of all ones means C.
Quantization step:
Sensor model: sampling with period of the outlet temperature , then the quantizer with step , then a measurement error added to give the measured output (see quantization and noise in Non-Idealities in a Control Loopmodels and control consequences of the main non-idealities of a feedback loop, namely sensor bias, noise, quantization and limited bandwidth, actuator saturation and limited bandwidth, time delays with Pade approximations, disturbances and parameter or model uncertainties.Non-Idealities in a Control Loop →).
The datasheet table shown in the slide gives the temperature error in LSB (least significant bit), for C:
| thermocouple temperature | V | V |
|---|---|---|
| C | ||
| to C | ||
| to C |
With C per LSB, an error of LSB corresponds to C (arithmetic from the figures above). The slide image cuts the table off below these rows.
5. The complete digital control loop
Block diagram of the temperature control system:
r[k] -->(+)--e[k]--> [C(z)] --u[k]--> [ZOH] --u(t)--> | [sat] --delta(t)--> [K_a] --u_p(t)--> [K/(tau s+1) e^{-sT_d}] --y_p(t)--(+)--> y(t)
^ - | <------------------------ Plant -------------------------> ^
| T_a
+--(+)<-- n[k] <-- [quantizer] <-- [sampler T_s] <-------------------------------------------------------------+- The digital controller works on samples and produces .
- A zero-order hold (ZOH) converts into the continuous-time command .
- The plant is the cascade of the saturation, the gain and the first-order-plus-delay process; the ambient temperature adds to its output.
- The output is sampled with period , quantized, and affected by the measurement error .
Digital implementation, sampling and ZOH are covered in Digital Control SystemsA digital control system replaces the analog controller with a processing unit interfaced to the plant through an A/D converter (sampling plus quantization) and a D/A converter (zero-order hold), and neglecting quantization it becomes a sampled-data system that can be designed by emulation or directly in discrete time.Digital Control Systems →; the saturation and the quantizer are the nonlinearities that call for the precautions listed in Non-Idealities in a Control Loopmodels and control consequences of the main non-idealities of a feedback loop, namely sensor bias, noise, quantization and limited bandwidth, actuator saturation and limited bandwidth, time delays with Pade approximations, disturbances and parameter or model uncertainties.Non-Idealities in a Control Loop → (windup, limit cycles).
Versione ripasso
Rig: fan pushes air through a tube; resistor heater at the inlet; K-type thermocouple at the outlet read by a MAX6675; BTS7960 half-bridge drives the heater by PWM; Arduino Mega 2560 runs the controller. Goal: regulate outlet air temperature.
Process model (energy balance in a uniform-temperature control volume, incompressible air, ): With : Transport delay , so
Actuator: half-bridge PWM gives average power , ; model: in , then .
Sensor: type-K thermocouple ; MAX6675 does cold-junction compensation and 12-bit conversion (0 to C), so C; datasheet error a few LSB (for example LSB for 0 to 700 C at 3.3 V). Model: sampler , quantizer, plus measurement error .
Loop: ZOH sat , fed back through sampler , quantizer and noise .
Passi del modello del processo:
- Bilancio , con (aria incomprimibile) per i termini ed .
- Con (ambiente costante) la perdita diventa ; il coefficiente di è .
- Divisione per quel coefficiente: e come sopra, quindi .
- Ritardo: con , cioè .
Attuatore e sensore:
- Il duty cycle è saturato in , poi con .
- Risoluzione: C per LSB; errore di LSB C.
- Codice tutti zeri = 0 C, tutti uno = C.
Errori tipici:
- Scrivere invece di nell'equazione con e , dimenticando il costante.
- Confondere la massa nel volume di controllo con la portata .
- Usare al posto di in .
- Dimenticare il ritardo nella TF del processo.