# Adaptive Feedforward Control of a Pressure Compensated Differential Cylinder
## 4 Modelling  
A dynamic model of the crane has been made in SimscapeTM by MathWorks(r), Natick, MA, USA. 3D computer-aided design (CAD) models have been imported into the model using the Multibody library. The hydraulic circuit has been made using the hydraulic library of SimscapeTM. A picture of the CAD model is shown in Figure 10.  
In the configuration shown in Figure 10, the knuckle cylinder experiences both resistive and assistive loads in both directions of motion when retracting fully, and extending back out again. The knuckle cylinder is controlled by a pressure compensated directional control valve, shown in Figure 11.  
The pressure compensator ensures that there is a constant pressure drop over the directional control valve, which gives a load independent flow. The governing equations of the pressure compensator are given in Equations (13)-(15).  
\[u_{pc} =\frac{p_{set}+p_{load}-p_{p}}{\Delta p} \tag{13}\] \[p_{load} =\begin{cases}p_{a}&\text{if }u_{spool}\geq 0\\ p_{b}&\text{otherwise}\end{cases}\] (14) \[Q_{pc} =k_{pc}\cdot u_{pc}\cdot\sqrt{p_{i}-p_{p}} \tag{15}\]  
Figure 8: Hydraulic system for the knuckle cylinder.  
Figure 9: Connection between the crane and CompactRIO controller.  
where  
\(u_{pc}\) = opening of compensator, \(0\leq u_{pc}\leq 1\)  
\(p_{p}\) = compensated pressure at port \(p\);  
\(\Delta p\) = pressure difference between fully closed and fully open;  
\(p_{a}\) = pressure at port \(a\);  
\(p_{b}\) = pressure at port \(b\);  
\(p_{t}\) = tank pressure;  
\(p_{set}\) = spring pressure setting;  
\(p_{load}\) = load pressure;  
\(u_{spool}\) = position of the main spool, \(-1\leq u_{spool}\leq 1\);  
\(Q_{pc}\) = flow in pressure compensator;  
\(k_{pc}\) = flow gain of compensator;  
\(p_{i}\) = compensator inlet pressure.  
Figure 11: Hydraulic pressure compensated directional control valve for the knuckle cylinder.  
Figure 10: 3D view of the simulation model of the HMF 2020K4 in Simscape.  
The steady state of \(p_{p}\) is then given by Equation (16).  
\[p_{p}=p_{load}+p_{set} \tag{16}\]  
The sensing of the load pressures \(p_{a}\) and \(p_{b}\) ensures that the pressure drop over the directional control valve always equals \(p_{set}\), and that the flow is load independent. This is shown in the orifice equation in Equation (17).  
\[\begin{split} Q&=C_{d}\cdot A_{d}\cdot u_{spool} \cdot\sqrt{\frac{2}{\rho}\cdot(p_{p}-p_{load})}\\ &=C_{d}\cdot A_{d}\cdot u_{spool}\cdot\sqrt{\frac{2}{\rho}\cdot p _{set}}\\ &=Q_{max}\cdot u_{spool}\end{split} \tag{17}\]  
where  
\(Q\) = flow in the valve;  
\(C_{d}\) = discharge coefficient;  
\(A_{d}\) = maximum discharge area;  
\(\rho\) = mass density;  
\(Q_{max}\) = maximum valve flow;  
Double counterbalance valves are used on the knuckle cylinder. An illustration of the counterbalance valves is shown in Figure 12.  
The unitless openings of the counterbalance valves are calculated in Equations (18) and (19).  
\[u_{a} =\frac{p_{a2}+\psi\cdot p_{b1}-p_{crack,a}}{\Delta p} \tag{18}\] \[u_{b} =\frac{p_{b2}+\psi\cdot p_{a1}-p_{crack,b}}{\Delta p} \tag{19}\]  
where  
\(u_{a}\) = opening of valve \(a\), \(0\leq u_{a}\leq 1\);  
\(u_{b}\) = opening of valve \(b\), \(0\leq u_{b}\leq 1\);  
\(p_{a1}\) = pressure at valve \(a\) input side;  
\(p_{a2}\) = pressure at valve \(a\) actuator side;  
\(p_{b1}\) = pressure at valve \(b\) input side;  
\(p_{b2}\) = pressure at valve \(b\) actuator side;  
Figure 12: Double counterbalance valve.  
\(p_{crack,a}=\) crack pressure of valve \(a\);  
\(p_{crack,b}=\) crack pressure of valve \(b\);  
\(\psi=\) pilot area ratio;  
\(\Delta p=\) pressure difference between fully closed and fully open.  
When \(u_{a}\) and \(u_{b}\) are 0, the valves are closed. When they are 1, the valves are fully open. During assistive loads the valves tend to be somewhere between 0 and 1, meaning that they are throttling the flow. The dynamics of the valves are included as a time constant, since the valves have a finite bandwidth.