# Practical Control of a Cold Milling Machine using an Adaptive PID Controller
## 3 The Proposed Adaptive PID Controller  
The structure of the single neuron adaptive power control system of a cold milling machine is similar to the fuzzy adaptive control system. In the single neuron adaptive power control system, the fuzzy adaptive control unit is replaced by the single neuron adaptive control unit. The weights of the PID controller are cumulated by the single neuron control algorithmic online continuously, which is different to the fuzzy control [28; 29]. To implement the digital control, the system must be discretized. The driver of a cold milling machine often places the throttle of the engine at its maximum position to meet the variation of the heavy load when the machine is working. The load of the machine can be adjusted by its work speed as the analysis in Section 2, if the throttle is fixed. The machine work speed can be adjusted by the displacement of the variable pump. The adjustment of the displacement is done through the single neuron adaptive power control system. Therefore, the output power of the engine is controlled by the control system. Based on the control mechanism of a traditional PID, the structure of the single neuron adaptive power PID controller designed for the cold milling machine is shown in Figure 4. The controller is used to improve the control responding speed and robustness performance to increase the productivity of the cold milling machine. In Figure 4, \(\omega_{e}(k)\) is the engine speed, \(\omega_{r}(k)\) denotes the engine reference speed, A is the converter, \(u\) refers to the output of the control system, the output is to control the displacement of a pump, \(x_{1}\), \(x_{2}\), \(x_{3}\) are the inputs of the PID controller, \(K_{u}\) is the control gain which can be tuned with the control error, and \(\omega_{i}(k)\) (\(i=1,2,3\)) are the weights which are tuned by the single neuron adaptive adjustment. According to the above structure, \(\omega_{e}(k)\) and \(\omega_{r}(k)\) are the reference input (desired speed) and actual output (measured engine speed) of the system, respectively, and the error satisfies \(e(k)=\omega_{r}(k)-\omega_{e}(k)\). It is assumed that \(\omega_{e}(k)\) is measurable. In the view of the single neuron adaptive-PID controller, the input is \(e(k)\) and the output is the incremental duty cycle of PWM \(\Delta u(k)\) driving the pump  
Figure 4: Structure of the adaptive power control of a cold milling machine. motor. Similar to a normal PID controller [30], the variables, \(x_{1}\), \(x_{2}\), \(x_{3}\) satisfy the following relations respectively:  
\[\left. \begin{array}{c}x_{1}(k)=\omega_{r}(k)-\omega_{e}(k)=e(k)\\ x_{2}(k)=e(k)-e(k-1)\\ x_{3}(k)=e(k)-2e(k-1)+e(k-2)\end{array} \right\} \tag{25}\]  
where \(e(k)\) is the deviated value. In the algorithm of the single neuron PID control, the critical issue is to choose the learning rate. If \(K_{u}\) in Equation (26) is a constant, we must set the learning rate \(\eta_{i}\) for PID respectively and carefully, which is very tedious in the engineering application. To simplify the control parameter setting in the engineering application, the online correction of nonlinear transformation about parameter \(K_{u}\) is used in this control system and can be given by,  
\[K_{u}(k)=K_{u0}+\frac{\lambda\left[\omega_{r}(k)-\omega(k)\right]^{3}}{\omega ^{2}r(k)} \tag{26}\]  
where \(K_{u0}\) is a constant, \(\lambda\)\(=0.1\)K\({}_{u0}\) in this control system. \(K_{u}\) has a great impact on the system stability and rapidity. When the value of \(K_{u}\) is small, the control system is comparatively of slow response and the overshoot of system could decrease. When the value of \(K_{u}\) is large, the control system is of fast response, but the overshoot of the system increases with the long adjustment time. At the beginning of dynamic response, deviation \(e(k)\) is large, the value of \(K_{u}\) should be large in order to accelerate response.