Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Respiratory Sensor System (RSS)
for In Situ Breath Measurement:
O2, CO2 and Flow,
based on a MSP430F149
Dipl.-Ing. Timo Kirschke
Dipl.-Ing Jörg Heisig
supported by the European Space Agency ESA
Slide 1
Contents
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
• RSS 1.5 – explanation and principles
• Hardware
• Software
• Control Algorithms
• Sensor Modelling and Errors
• Trivia
• Results
• System Evolution
• Discussion, Questions
Slide 2
RSS 1.5 – What's that?
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Abstract
The TU Dresden, Institute for Aerospace Engineering, is developing a
Respiratory Sensor System in a project, sponsored by the European Space
Agency. Essential parts of the system are: solid electrolyte gas sensors, an
electronics box and the visualisation software, written in LabView and
running on a PC. The initial target of the system is to observe the fitness of
astronauts during their activities at the International Space Station ISS. Main
terrestrial applications for this system are the fitness market and/or other
medical applications, but also many gas sensing applications (e.g. vacuum
coating techniques, combustion control...).
The electronics of this RSS were built around the TI MSP430F149. The
electronic box contains analogue signal conditioning circuitry, voltage and
current excitation for the sensors, a flow turbine pulse shaping circuit, two
classD (PWM) power output stages for sensor heaters, bidirectional RS232
communication, some power supply parts and a reset circuit.
The main challenge was the realisation of some DSP-like functionalities on
a low power µController. The heater control algorithm uses a cycle time of
1ms. Two PID-controls for the sensor heaters, all signal precalculations and
the bidirectional communication with the PC had to be realised inside this
time frame.
This presentation will introduce some interesting parts of the electronics,
especially the power output section, and the challenges of the firmware
development to meet the timing requirements, following the slogan:
„Squeezing the last bit“.
The Respiratory Sensor System will be demonstrated in function.
Slide 3
RSS 1.5 Advantages
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
• Low response time allowing a breath-to-breath, or even a
”one-breath” analysis
• Capability of measuring O2, CO2, and flow rate
simultaneously
• Measurement in mainstream (the inspired/expired flow path
of a human subject)
• Miniaturised design, „low-weight“
• Low power loss of the electronics
• Possibility of mobile/portable use of systems incorporating
the new sensor
Slide 4
Principle of the O2 Sensors
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Planar Design
cathode
O2
diffusion
barrier
Anode
Electrolyte
A
solid
electrolyte
anode
O
2-
O2
current
constant
voltage
Cathode
Substrate
Heater
Size:
20 x 3,5 x 0,5 mm
●
Oxygen ions can be conducted through a hot (>600°C) solid state electrolyte
●
Ions can be “pumped” from the cathode to the anode by an applied DC-voltage
●
The oxygen flux to the cathode is limited by a diffusion barrier and the sensor
temperature is kept constant
Slide 5
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Flow Measurement
●
●
●
Sensor dissipates heat to
surroundings through:
- Radiation
- Free convection
- Forced convection
- Heat conduction to sensor plug
and Utilization
Need to stabilise the temperature
with a controller:
- Heating by electrical power
By measuring this power the
original fluid flow rate can be
computed (similar to “hot wire/
hot film anemometer”)
Radiation
Free convection
Forced convection
Heating
VFluid
Heat conduction
Slide 6
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Hardware Structure
• Sensor signal
conditioning (INA,
TIA, PGA: 5 gain
ranges, 8ch.
ADC)
• DAC 6/8ch. 16Bit
• 2ch. PWM heater
power amplifier
• Temperature
measurement,
(programmable
RTD current
excitation)
• Flow turbine (SW
quadrature dec.)
• JTAG + RS232
and Utilization
TI MSP430F149
DAC
O2-sensor
SPI
ADCFilter
PGA
Power
Amp
DAC
Temperature
measurement
ADC
digital heating
control
V24 protocol
serial data
port
DAC
PC
serial on board
programming port
CO2-sensor
PGA
Power
Amp
display
port
DAC
Reference
digital input
port
LC – display
Status-LEDs
keypad
additional
port
Slide 7
Linear Power Stage
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
previous design:
Linear Power
Amplifier
main advantages:
simple,
fast,
stable
disadvantage:
high power
loss
Slide 8
Triangle PWM Power Stage
2nd approach:
natural sampling PWM,
clocked by MSP430
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
advantage:
low power loss
disadvantage:
complex design, inherent
output impedance makes
output voltage
measurement
necessary
(no internal
control loop)
Slide 9
Hysteretic Modulator OPS
rd
3 approach: Hysteretic Modulator
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
1st quadrant modification of an Audio classD amplifier principle
self oscillating, needs no clock, internal voltage control loop
Slide 10
Hyst. Modulator Simulation
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
●
0 ≤ M ≤ 1 possible, load independent over a wide range
●
constant voltage ripple over varying modulation index
●
good linearity (in Audio applications: fidelity)
●
not sensitive against power supply variations
Slide 11
Power Stage Schematic
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Small, simple, stable, efficient (>91% >5W), fast, accurate
minor disadvantage: noisy at extreme modulation indexes Slide 12
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Power Stage Efficiency
and Utilization
Modulator Efficiency vs. output Power
100
90
Efficiency Eta [%]
80
Version 1.5
70
60
50
40
30
20
Version 1.0
Main Working Range
Eta [%] @ 100Ω V 1_0
Eta [%] @ 20Ω V 1_0
Eta [%] @ 100Ω V 1_5
Eta [%] @ 20Ω V 1_5
10
0
0,1
1,0
10,0
100,0
Output Power [W]
Total power consumption of the complete electronics box is approx. 2.5W (working condition)
Additional power loss of the output stage remains below 1W, even at full power (25W)
Slide 13
Software Summary
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
●
●
●
●
●
●
Development of a dedicated sensor model for control
design
Analytical and PC-based numerical parametrisation
possible
Development and verification of different control algorithms
Working principle of the sensors and their applicability was
demonstrated
Decision for a control algorithm depends on the sensor
structure and its parameters
LabView-Software + DDE-interface available
Slide 14
Data Flux in the System
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Sensor
(measurement of gas
mixture and flow)
Analogue sensor
signals
Microcontroller
(heat control and
digitalisation)
Digital sensor signals via
serial port
Current sampling
rates:
1000 Hz in MC
250 Hz in PC
PC
Serial port
DDE interface
MC-Driver
Raw data in
RS 232 buffer
(for data
acquisition and
calibration)
Time, Flow,
O2 and CO2 data
in DDE buffer
User
Program
(for data
processing, storage
and visualisation)
Slide 15
Function Calls (Modules)
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
wake up
DACs
read ADC
control switch
PRBS
PID_Heater
PID_Sensor
3point_heater
3point_sensor
Mod 3point_heater
Mod 3point_sensor
PARC
PVR
OR2/2 (OR4/4)
cascaded_heater
cascaded_sensor
one shot
control cycle
main
receive
interrupt
transmit
interrupt
upload values
fill send buffer
convert
Hex->ASCII
Initialisation
Oscillator
ADC
Timer A
Timer B
UART0
UART1
SPI0
WakeUpDAC
Temp. Sensor
convert
ASCII->Hex
load parameters
set control switch
init sensor
application
Slide 16
Control Algorithms
●
●
●
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Control algorithm requirements:
- fast (quick response on disturbances, short cycle time),
- robust (non-sensitive against parameter errors)
- adjusted to the control path - high control quality;
- continuous (smooth) controlling variable
- low (better: no) remaining offset
- low consumption of resources
calculation time
memory space
Suitable algorithms:
3-point-control
PID control
Literature example:
spra083.pdf on TI's website
“PID and Deadbeat Controllers With the TMS320 Family”
Finally implemented formulas No. 45 + 46
Slide 17
PID Control Formulas
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
PID- Parameter Loading
K1 = Kp + 2•Kd/T + Ki•T/2
K2 = Ki•T – 4•Kd/T
K3 = Ki•T/2 + 2•Kd/T – Kp
Calculation of the output voltage (discrete algorithm)
u(n) = u(n-2) + K1*e(n) + K2*e(n-1) + K3*e(n-2)
Slide 18
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
PID Control Programming
and Utilization
PID- Parameter Loading (P is shown only, I and D are similar)
If (Parameter[0]=='P' && Parameter[1]=='F' && Parameter[2]=='O')
// O2 sensor PID control proportional factor
{
P_Factor_O2 = 10*Value;
K1_O2 = P_Factor_O2 + 2 * D_Factor_O2 + (I_Factor_O2 >> 1);
K2_O2 = I_Factor_O2 - 4 * D_Factor_O2;
K3_O2 = 2 * D_Factor_O2 - P_Factor_O2 + (I_Factor_O2 >> 1);
return;
}
Calculation of the output voltage
(small modifications are dependent on the control path)
y[k0] = y[k1]
+ ((K1_O2 * (RTsoll
+ ((K2_O2 * (RTsoll
+ ((K3_O2 * (RTsoll
ControlOut = ((y[k0] + DAC_Offset)
*
RTist[k0]))
RTist[k1]))
RTist[k2]))
DAC_Factor)
>>
>>
>>
>>
10)
10)
10);
10;
Slide 19
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
3-Point Control Principle
and Utilization
yes
UT>UTsoll+Hysteresis?
no
UT<UTsoll-Hysteresis?
yes
no
UHlow
UHmid
UHhigh
yes
send to DAC,
output acquired data
Slide 20
3-Point Control Programming
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
// calculate output voltage
if (RTist[k0] > (RTsoll + Hysteresis))
{
y[k0] = y_Low;
// set out voltage = lower limit
P5OUT &= ~BIT7;
// switch LED 4 off
}
else if (RTist[k0] < (RTsoll - Hysteresis))
{
y[k0] = y_High;
// set out voltage = upper limit
P5OUT |= BIT7;
// switch LED 4 on
}
else
y[k0] = y_Mid;
// set out voltage = mid point
if (RTist[k0] > RT_UpLimit)
{
y[k0] = 1000;
P5OUT |= BIT5;
}
// overheat?
// reset control output value
// switch LED 2 on
ControlOut = ((y[k0] + DAC_Offset) * DAC_Factor) >> 10;
Slide 21
Sensor Modelling (1)
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Heater
Temperature sensor
and Utilization
Slide 22
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Sensor Modelling (2)
and Utilization
●
RH
GRϑ
ϑH
●
QdrH+QdistH
●
●
QdrS+QdistS
H
●
GϑH
RH
uH
uH
RH
GPH
GiH
QLeit
ϑS
GϑS
u
i
P
R
Q
voltage
current
power
resistance
heat
flow
ϑ
G
PH
iH
uH
GRH
RH
temperature
transfer
function
H heater side
S sensor side
dr drain off
dist disturbance
Slide 23
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Quantisation Effects
Discretisation
• Time intervals
• Amplitude
Measuring range is:
• Heater voltage
• Heater current
and Utilization
(1ms)
(12 Bit = 4095 values)
24 V
2.5 A
∆u = 6mV
∆i = 610µA
• Measurement error is higher than the aimed temperature accuracy
possible solution:
significant enhancement of the measurement resolution
• Fast and accurate control algorithms get a two-point-behavior due to
- the limited resolution and
- the time delay between heater and temperature sensor
possible solution:
concentration of control path parameters
e.g. heater = temperature measurement resistor
Slide 24
Measurement Quantisation and
Resulting Reading Error
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Peak to peak
reading errors
Heater voltage
±0.05% of range
Heater current
±0.05% of range
Heater
resistance
±0.3% of
reading(!)
Slide 25
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Heater Control Results
and Utilization
●
●
●
If optimised for
speed, a PID
control shows
similar
behaviour as a
3-point control:
0.1s
< 0.1%
●
Control variable
deviation
(green)
Control variable
noise (blue)
Response time
PID control | 3-point control
Slide 26
Division Routines
●
●
●
●
●
●
●
●
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
32Bit/32Bit via Libraries takes 68µs @ 8MHz and Utilization
2 divisions per control cycle necessary
approx. 16% of computational time
Lookup Table division possible?
Resolution of the measured values, acting as the divisor, is
12 Bits
Rearrange the division into a multiplication with the divisor
reciprocals, put them into a L.U.T. (vector)
Expand the reciprocals by 12Bit to keep the resolution,
even for the smallest values
Split the L.U.T. into 3 blocks to stay inside the 16Bit-range
(scaling by 16/20/24 Bits)
12Bit/12Bit via L.U.T. takes 12µs @ 8MHz
Slide 27
Serial Data Transmission
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
●
Control cycle time:
1ms
●
Max. Baudrate:
115.2kBd, limited by the PC
●
Data to be transmitted: 8 values at 4 ASCII-symbols each
●
Overhead:
6 ASCII-symbols sum: 38 Bytes
●
Parameters 8N1:
9 Bits per data Byte
●
Theoretical data rate: 336 value sets per second
●
Data transmission:
●
●
every 4ms
Function calls inside data conversion and buffer filling
routines avoided
Keep overhead small
Slide 28
Transmit Results via RS232
void FillSendBuf(unsigned int UARTx)
{
static unsigned int i = 0;
static int result;
{
SendCRC = 0;
SendBuf1[37] = 0x02;
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
// STX
result = 0x0F & ((int)(SumRHist >> 12)); // convert numbers hex->ASCII
if (result <= 9) SendBuf1[36] = result + '0';
else
SendBuf1[36] = result + ('A' - 10);
result = 0x0F & ((int)(SumRHist >> 8));
if (result <= 9) SendBuf1[35] = result + '0';
else
SendBuf1[35] = result + ('A' – 10);
...
for (i = 36; i >= 3; i--)
// build
{
SendCRC = SendCRC ^ (SendBuf1[i]);
}
SendBuf1[2] = Digit1(SendCRC); // ASCII
SendBuf1[1] = Digit0(SendCRC); // ASCII
}
}
CRC exclusive STX/ETX
// bytewise EXOR
CRC
CRC
SendBuf1[0] = 0x03;
// ETX
SendBufCnt1 = 37;
// counter for bytes to be sent
TXBUF1 = SendBuf1[SendBufCnt1]; // load 1st value into buffer
// initiates UART send routine
Slide 29
Used Peripherals
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Slide 30
rd
3 Hardware Generation
●
●
●
●
●
●
●
All elements integrated
onto 1 PCB (3 PCBs)
Full SMT except big
caps and connectors
External power supply
O2 and CO2 sensor
channels (O2 only)
Multiple measurement
ranges per sensor
channel (1 range only)
PWM output stages
(linear OPS)
¼ size, ⅓ weight
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
3rd (1st) hardware generation
Slide 31
The Complete RSS PRO 1.5
●
●
●
●
●
Mask, containing
O2 and CO2
sensors
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Sensor cables,
interface
connection
Electronics box
External power
supply
PC with LabViewsoftware
Slide 32
Used Tools
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
and Utilization
Schematic: Orcad - not the optimum, many chrashes,
sometimes corrupting the design
PCB-Layout: Orcad (sub-contractor)
Software:
first IAR, later Crossworks – no way back ☺
Slide 33
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
The Final
and Utilization
Thanks to:
●
The ESA/ESTEC for the financial support of our project
●
Texas Instruments for their nice controllers and support
●
The web community (e.g. MSP430 Yahoo-forum)
●
Paul Curtis (Rowley) for his generous help
●
You, for your attention and patience
Enjoy your projects!
Slide 34
Insert
Company
Institute for Aerospace Engineering
Logo
Here
Professorship
for Space
Systems
Slides - Discussion
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
Title
Contents
RSS 1.5 – What's that?
RSS 1.5 Advantages
Principle of the O2 Sensors
Flow Measurement
Hardware Structure
Linear Power Stage
Triangle PWM Power Stage
Hysteretic Modulator OPS
Hyst. Modulator Simulation
Power Stage Schematic
Power Stage Efficiency
Software Summary
Data Flux in the System
Function Calls (Modules)
Control Algorithms
PID Control Formulas
PID Control Programming
and Utilization
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
3-Point Control Principle
3-Point Control Programming
Sensor Modelling (1)
Sensor Modelling (2)
Quantisation Effects
Measurement Quantisation and
Resulting Reading Error
Heater Control Results
Division Routines
Serial Data Transmission
Transmit Results via RS232
Used Peripherals
3rd Hardware Generation
The Complete RSS PRO 1.5
Used Tools
The Final
Slides - Discussion
Slide 35
© Copyright 2026 Paperzz