## 4 Simulation and Analysis  
### System Modeling  
To test the energy saving of the actuator and find some rules for robot design, a simulation was carried out in the advanced modeling environment for performing simulation of engineering systems (AMESim) [32]. The mechatronics-hydraulics-integrated model of the SCalf II is shown in Figure 7. Since the keystone of this paper is the energy efficiency of the actuator, the attitude adjustment of the robot is not considered, and the Planar Mechanical Library (the components marked with blue) can be used to build the mechanical system. The related structural and physical parameters were obtained by CAD software. Since the actuators are almost non-rotating over the entire stroke length, the influence of the actuators on the leg dynamics can be ignored, and the mass is dispersed to the connected components on both sides. To get a concise model, the hydraulic systems and controller of each leg are created by the supercomponents marked by black and red, respectively. The actuators and other hydraulic related components (components marked by pink and light green) can be built by the corresponding module in Hydraulic Library. The relevant components of the controllers can be obtained from the Signal Control Library. To simplify the problem and facilitate theoretical analysis, this study only discusses the situation when the initial point is at position \(O\) shown in Figure 3.  
In the simulation, the compliant control method based on the virtual model (VMC) [33] was used. The desired joint torque can be established as:  
\[\left[\begin{array}{c}\tau_{hip}\\ \tau_{Rnee}\end{array}\right]=J^{T}V_{f}+PD(\theta_{hip},\theta_{knee}) \tag{16}\]  
with  
\[V_{f}=\left[\begin{array}{c}k_{x}\Delta x_{f}+b_{x}\Delta\dot{x}_{f}\\ k_{z}\Delta z_{f}+b_{z}\Delta\dot{z}_{f}\end{array}\right]+\left[\begin{array}[ ]{c}0\\ Mg\end{array}\right] \tag{17}\]  
and  
\[PD(\theta)=\left[\begin{array}{c}K_{p}\Delta\theta_{hip}+K_{d}\Delta\dot{ \theta}_{hip}\\ K_{p}\Delta\theta_{knee}+K_{d}\Delta\theta_{knee},\end{array}\right] \tag{18}\]  
where \(\tau\) and \(\theta\) are the torque and joint angle, respectively, and the subscripts \(hip\) and \(knee\) indicate the corresponding positions; \(k\) and \(b\), respectively, represent the virtual stiffness and virtual damping,  
Figure 6: Working principle of accumulator. (**A**) situation number one; (**B**) situation number two.  
and the subscripts \(x\) and \(z\) denote the corresponding directions; \(x_{f}\) and \(\dot{x}_{f}\), respectively, represent the displacement and velocity of the reference point on the robot's foot along the x-axis, and the difference between the actual and target positions is \(\Delta\). The annotations follow the same rules in other directions; \(Mg\) is the gravity compensation, which only works during contact between the foot and the ground; \(K_{p}\) and \(K_{d}\) are the gain coefficients of the PIDcontroller.  
The overall control architecture is shown in Figure 8. The actual foot positions (\(x_{f}\) and \(z_{f}\)) and joint angles are calculated through the leg and joint kinematics based on the piston positions \(x_{p}\). The desired joint angles are obtained through the joint kinematics based on the foot trajectory.  
Figure 8: Control architecture of leg prototype.  
Figure 7: Model built in AMESim.