# Model

Let’s consider a pneumatic system, which consists of a flat tire and an air compressor to inflate it. The system can be modeled as follows:

where:

$R_c$: is the compressor’s pneumatic resistance.

$C_c$: models the tire’s capacitance

$R_p$: models the losses due to the puncture.

To develop a hybrid model I chose the following variables:

$p$: stands for the manometric pressure in the tire.

$q$: stands for the state of the compressor (‘on’ or ‘off’).

The compressor turns on if the pressure falls below $p_{min}$ and it turns off when the pressure inside the tire reaches $p_{max}$. Between this two limits the pressure flows according to the following equation:

$\dot{p}=\left(-\frac{R_{c}+R_{p}}{R_{c}R_{p}C_{c}}p+\frac{P_{comp}}{R_{c}C_{c}}\right)q+\left(-\frac{C_{c}}{R_{p}}p\right)\left(1-q\right)$

This equation was obtained under the following assumptions:

• The variation of the tire’s volume is negligible, then tire’s capacitance is constant.

• The compressor is a constant pressure source of value $P_{comp}$

• The pressure never exceeds the limits $p_{min}$ or $p_{max}$

The hybrid model is then defined by:

$\mathcal{H}=(C,f,D,g)$

$x=\left[\begin{array}{c} p\\ q \end{array}\right]$

$C=\{x\epsilon\mathbb{R}^{2}/p_{min}+\varepsilon\leq p\leq p_{max}-\varepsilon\}$

$D=\{x\epsilon\mathbb{R}^{2}/\left|p-p_{min}\right|<\varepsilon\,\vee\,\left|p-p_{max}\right|<\varepsilon\}$

$f(x)=\left[\begin{array}{c} \left(-\frac{R_{c}+R_{p}}{R_{c}R_{p}C_{c}}p+\frac{P_{source}}{R_{c}C_{c}}\right)q+\left(-\frac{C_{c}}{R_{p}}p\right)\left(1-q\right)\\ 0 \end{array}\right]$

$g(x)=\left\{ \begin{array}{c} \left[\begin{array}{c} 11-\varepsilon\\ 0 \end{array}\right]\,,\, if\,\left|p-p_{max}\right|<\varepsilon\\ \left[\begin{array}{c} 8+\varepsilon\\ 1 \end{array}\right]\,,\, if\,\left|p-p_{min}\right|<\varepsilon \end{array}\right.$

# Simulation

The Matlab code written to simulate the system using HyEQ Toolbox is presented below. The values of the parameters were chosen in order to obtain results that could be quickly visualized,  but they must be changed for more appropiate values.

### C.m

function inC = C(x)
%check if in C

p = x(1);
eps = 0.12;
pmin = 8;
pmax = 11;

if (p>=pmin+eps && p<=pmax-eps) || p>=pmax+eps
inC = 1;
else
inC = 0;
end

end


### D.m

function inD = D(x)
%check if in D

p = x(1);
eps = 0.12;
eps = 0.12;
pmin = 8;
pmax = 11;
if (p<=pmin+eps && p>=pmin-eps ) || (p<=pmax+eps && p>=pmax-eps )
inD = 1;
else
inD = 0;
end
end


### f.m

function xdot = f(x)
%flow map

p = x(1);
q = x(2);
if q == 1
%pdot=-(Rc+Rp)/(Rc*Rp*Cc)*p+psource/(Cc*Rc)
pdot = -0.2*p+0.3*7.5;
else
%pdot=-Cc/Rp*p
pdot = -0.1*p;
end
qdot = 0;

xdot = [pdot qdot]';
end


### g.m

function xplus = g(x)
% jump map

p = x(1);
q = x(2);

pmin = 8;
pmax = 11;
eps = 0.12;

if p<=pmax+eps && p>=pmax-eps
qplus = 0;
pplus = pmax-eps;
elseif p<=pmin+eps && p>=pmin-eps
qplus = 1;
pplus = pmin+eps;
end

xplus = [pplus qplus]';

end


## 4 thoughts on “Tire Pressure Control”

1. What file did you use to run and plot the system?

• You can easily adapt the file run.m that comes with the simulator distribution files (or grab it from any example).

2. I think the flow set, jump set, and jump map could be simplified by taking into account the state variable q.
How about, defining the flow and jump set as:
C := \{ x\in R^2 | q=1, p=p_{min}\}
D := \{ x\in R^2 | q=1, p>=p_{max}\} \cup \{ x\in R^2 | q=0, p<=p_{min}\}
and
g(x) = [p,1-q]
?
Also, the variable \epsilon could be eliminated by doing this.

3. Sorry to randomly ask this on an entry but I didn’t know where else to post it and I don’t know how to contact the authors of the blog, so:

If we have a process that repeats cyclically with a switching period T and the switching pattern is dependent upon that period and also the cycle index n, how do we “insert” these parameters into our model using HyEQ Toolbox? How do you model a “cycle counter” or even a timer? What section of the system (C,D,f,g) would be appropriate for that?

Thank you in advance and again, I apologise for posting this question on a random blog entry