# A Control-Oriented Linear Parameter-Varying Model of a Commercial Vehicle Air Brake System
## 2 Nonlinear Mathematical Modeling
### Solenoid Valve Model  
According to Figure 2, the solenoid valve has two states: on and off. Based on the PID controller output \(y_{p}\), \(V_{1}\) and \(V_{2}\) are generated based upon Equation (1), where \(V_{1}\) is active when PID output is greater than 0.1; \(V_{2}\) is active when PID output is smaller than \(-0.1\); and \(V_{1}=V_{2}=0\) when the PID output is between \(-0.1\) and 0.1. The output of the algorithm is the PWM signal duty cycles \(x_{DC1}\) and \(x_{DC2}\). The period of both PWM signals is 0.016s, which is used in simulations and experiments. Then, \(V_{1}\) and \(V_{2}\) are generated based on the PWM signal.  
\[x_{DC1}=\left\{\begin{array}{ll}y_{p},&if\ y_{p}>0.1\\ 0,&if\ y_{p}\leq 0.1\end{array}\right.,\quad x_{DC2}=\left\{\begin{array}{ll}0,&if \ y_{p}\geq-0.1\\ y_{p},&if\ y_{p}<-0.1\end{array}\right. \tag{1}\]  
The subsystem model from solenoid voltage input to the needle displacement is simplified as a first-order system defined in Equation (2).  
\[X(s)=\frac{c}{\tau s+1}U(s) \tag{2}\]  
where \(X(s)\) is the Laplace transform of valve needle displacement \(x\); \(U(s)\) is the Laplace transform of solenoid control input \(u\) ('0'--off, '1'--on); \(\tau\) is the time constant of the solenoid valve; and \(c\) is the valve displacement scaling factor.  
When the needle moves with displacement \(x\), flow through the equivalent solenoid valve is formed. For compressible fluids, the mass flow rate through an equivalent orifice of supply solenoid valve can be expressed by the quasi-steady-state isentropic orifice flow process defined in Equation (3).  
\[q_{m_{supply}}=\left\{\begin{array}{ll}C_{d}A(x_{1})P_{\text{sup}}\sqrt{ \frac{2\gamma}{RT_{0}(\gamma-1)}}\ *\\ \left(\sqrt{(\frac{P_{pil}}{\text{P}_{\text{sup}}})^{\frac{2}{\gamma}}-(\frac {P_{pil}}{\text{P}_{\text{sup}}})^{\frac{\gamma+1}{\gamma}}}\right)\\ C_{d}A(x_{1})P_{\text{sup}}\sqrt{\frac{\gamma}{RT_{0}}}\ *\\ \left(\sqrt{(\frac{2}{\gamma+1})^{\frac{\gamma+1}{\gamma-1}}}\right)\end{array} \right.\qquad\begin{array}{ll}\frac{P_{pil}}{\text{P}_{\text{sup}}}>0.528\\ \frac{P_{pil}}{\text{P}_{\text{sup}}}\leq 0.528\end{array} \tag{3}\]Similarly, the mass flow rate through an equivalent orifice of exhaust solenoid valve can also be expressed by the quasi-steady-state isentropic orifice flow process in Equation (4).  
\[q_{m_{exhaust}}=\left\{\begin{array}{ll}C_{d}A(x_{2})P_{pil}\sqrt{\frac{2\gamma}{ \overline{RT_{0}(\gamma-1)}}}\,\bullet\\ \left(\sqrt{(\frac{P_{pilm}}{P_{pil}})^{\frac{2}{\gamma}}-(\frac{P_{pilm}}{P_{ pil}})^{\frac{2+1}{\gamma}}}\right)\\ C_{d}A(x_{2})P_{pil}\sqrt{\frac{\gamma}{\overline{RT_{0}}}}\,\bullet\\ \left(\sqrt{(\frac{2}{\gamma+1})^{\frac{\gamma+1}{\gamma-1}}}\right)\end{array} \right.\frac{P_{pilm}}{P_{pil}}>0.528 \tag{4}\]  
In Equations (3) and (4), \(x_{1}\) is the air supply solenoid valve displacement; \(x_{2}\) is the exhaust solenoid valve displacement; \(C_{d}\) is the discharge coefficient; \(A(x_{1})\) and \(A(x_{2})\) are the equivalent areas of supply solenoid valve spool and exhaust solenoid valve spool as functions of associated valve displacements, respectively; \(P_{\text{sup}}\) is supply pressure; \(R\) is the ideal gas constant; \(T_{0}\) is supply air temperature; \(\gamma\) is the ratio of specific heats; \(P_{pil}\) is pressure of pilot chamber; and \(P_{atm}\) is atmosphere pressure. Therefore, the mass flow into the pilot chamber is defined as \(\delta q_{m1}\) in Equation (5).  
\[\delta q_{m1}=q_{m1}-q_{m2} \tag{5}\]