# Control Design and Validation for Floating Piston Electro-Pneumatic Gearbox Actuator
## 3 Model-Based Controller Development
### PID Method  
First, a gain-scheduled PID controller has been implemented, using the requested gear change as a scheduling parameter, resulting in four different parameter sets. After investigating the performance and the dynamic properties of the system, the integral term has been omitted. The function of the integral term is to eliminate the residual error of the control. However, the zero residual error is already guaranteed by the detent mechanism, as the force generated by the detent spring always points towards the nearest gear due to its highly nonlinear geometry. In the case of Neutral position, the detent mechanism is supported by the floating piston, as its movement is limited to one side of the cylinder. Therefore, the bigger cross section area always tries to move the main piston towards Neutral. On the other hand, the additional dynamic assured by the integral term can be disadvantageous, as it can cause overshoot and high-speed collision. Therefore, the control function is written as follows,  
\[u(t)=K_{p}e(t)+K_{d}\frac{de(t)}{dt} \tag{11}\]  
where \(e(t)\) is the state error, and \(K_{p}\) and \(K_{d}\) are the proportional and derivative gains, respectively, which are chosen based on the reference signal. The layout of the PID controller is shown in Figure 4. To prevent the jittering of the control, a still state zone has been implemented around zero error, in which the controller is inactivated. The width of the zone has been determined by the characteristic of the detent mechanism in such a way that within this interval the mechanism should be able to compensate the error:  
\[e(t)= \begin{cases}e(t),&\text{if }\|e(t)\|>e_{th}\\ 0,&\text{otherwise}\end{cases}  \tag{12}\]  
where \(e_{th}\) is the threshold value. To prevent the back and forth activation between the solenoid valves, a dead-zone is added to the control signal, where both valves are released. Outside of this interval, the activated solenoid valve is chosen based on the sign of the control signal as follows. \[\underline{u}_{SV}= \begin{bmatrix}u_{SV1},u_{SV2}\end{bmatrix} ^{T} \tag{13}\]  
\[\underline{u}_{SV}= \begin{cases}\begin{bmatrix}1,0\end{bmatrix}^{T},&\text{if }u(t)>u_{th1}\\ \begin{bmatrix}0,0\end{bmatrix}^{T},&\text{if }u(t)\in[u_{th2},u_{th1}]\\ \begin{bmatrix}0,1\end{bmatrix}^{T},&\text{otherwise}\end{cases}  \tag{14}\]  
Because of the delayed effect of the control signal caused by the system's inertia, short and frequent solenoid valve commands are not effective. Once there is a change in any of the solenoid valve commands, it is forced to stay in its new state for 5 ms. Besides greatly reducing the number of solenoid valve activations, this restriction makes it possible to activate both valves at the same time, which can help to stabilize the system, especially in case of (L/H) to Neutral gear changes, as it can prevent overshoot. Figure 4: Layout of the Proportional-Integral-Derivative (PID) controller. The P and D parameters has to be tuned by a generic nonlinear programming solver, as common parameter tuning techniques, such as the Ziegler-Nichols method, could not provide acceptable results. The optimization aims to find those \(K_{p}\) and \(K_{d}\) parameters, which minimize the following function,  
\[f(K_{p},K_{d})=w_{1}T_{shift}(K_{p},K_{d})+w_{2}v_{coll}(K_{p},K_{d})+w_{3}n_{ SV}(K_{p},K_{d})+w_{4}x_{overshoot}(K_{p},K_{d}) \tag{15}\]  
where \(T_{shift}\) is the shift time; \(v_{coll}\) is the collision speed; \(n_{SV}\) is the number of solenoid valve activations; \(x_{overshoot}\) is the maximum overshoot; and \(w_{1}\), \(w_{2}\), \(w_{3}\), and \(w_{4}\) are the performance weights. As different requirements are depending on the type of the gear change (Neutral to Gear or Gear to Neutral), the applied weights are different for the various requests. As it has a direct effect on the vehicle's motion, the shift time has the highest performance weight, followed by the weights of overshoot and collision speed, which have the same order of magnitude.