#### What is in this article?:

- Advances in Electronic Control of Hydraulic Servo Systems
- Part Two
- The Results

Controlling electrohydraulic servo systems has always been just a little more challenging than controlling electromechanical servomotor systems. The main reason is that electrohydraulic systems use compressible oil to move the actuator. A hydraulic system can be thought of as a mass between two springs where the piston and the load is the mass, and the oil on both sides of the piston represents the two springs. Servomotor systems are simpler because, for the most part, only the inertia of the motor and the connected load must be considered.

Enough differences exist between the two types of systems that what is good for controlling one is not going to be optimal for the other. Servomotor systems can be controlled very well with PID control loop gains plus velocity and acceleration feed-forward gains. This control method has often been used to control servohydraulic systems, too, but a simple PID plus feed forwards cannot always control a hydraulic system optimally.

### Achieving design goals

For optimal design of a hydraulic system, the fastest response to disturbances and errors should be applied. However, to achieve this goal, you must either increase the damping factor or increase the natural frequency of the system. Adding friction will increase the damping factor. Another way to provide damping is to add a small orifice between the A and B ports of the valve. Unfortunately, both of these methods waste energy.

Increasing the diameter of the cylinder can increase its natural frequency, but that increases cost because a larger cylinder, valve, accumulator, and pump will be required. It is less expensive and more effective to use electronics to get around the limitations. To do this, the PID may be extended to include a second derivative gain, but hurdles must be overcome before a second derivative gain can be used.

Another enhancement is to use an electronic motion controller that can add a jerk feed-forward term to the control loop. Jerk is the derivative (rate of change) of acceleration. Feed forwards are estimates of what the control output should be to the valve to achieve a target velocity, acceleration, and jerk.

If the model for the actuator is known exactly, and no disturbances occur, then, theoretically, you could control a servohydraulic actuator perfectly without using closed-loop control. It should be obvious that the valve should be opened up proportionately to the target velocity, and a velocity feed forward can do that. Why wait for the PID to respond to an error?

The acceleration and jerk feed forwards work on the same principle, but take into account how the oil compresses as it applies force to the load. In practice, the model for the actuator is not known exactly and it isn’t perfectly linear, so closed loop control is still required. When set correctly, the feed forwards can estimate the control output usually to within 5% of the required control signal. Then, the PID needs only to provide a small correction to the control signal due to non-linearities and changes in load.

### Challenges of second order control

Adding a second derivative gain and jerk feed forward requires solving three major problems:

First, a high order motion profile generator must be designed that can generate smooth changes in position, velocity, acceleration, and jerk. The velocity, acceleration and jerk should be smooth to ensure that the control output generated using the feed forward gains is smooth.

Second, using the derivative gain requires estimating an accurate and smooth velocity. Using the second derivative gain is more challenging because it requires estimating an accurate and smooth acceleration.

Third, how do you tune the jerk feed forward and the second derivative gain? Trial and error is time consuming, so auto tuning must be used.

Two main advantages result from using high order motion target generators. The first is that a physical system cannot possibly follow a linear ramp. This is because following a ramp would require instantaneous changes in acceleration, which, likewise, would require instantaneous changes in force, pressure and flow. The second advantage of using higher-order target generators is that velocity, acceleration, and jerk will vary smoothly from point to point, enabling a smooth control output to be generated.

### Estimating velocity and acceleration

The purpose of estimating velocity and acceleration is so that the first and second derivative gains can be used to provide damping for the mass between two springs. The damping allows the actuator to follow the motion profile without overshooting the target velocity and position. The first and second derivatives add electronic damping, which is more efficient than adding friction to increase damping.

Accurately estimating the velocity and acceleration is critical to using the derivative gains. Many people who have tuned PIDs have avoided using the derivative gains because they amplify “noise” and make the control output look noisy.

The simple way of calculating velocity requires knowing the position at two different times and dividing distance by time. This works well if the positions and times are precisely known. Calculating the acceleration usually is done by measuring the speed at two different times, calculating the difference between the two speeds, and dividing the difference by the time.

This seems easy enough, but in practice, it is difficult — in part, due to sensors and loop times. For instance, if the feedback device provides only 0.001 in. resolution and the sample times are at one msec intervals, the resolution of the speed calculation is only 1 in./sec. This is a shortcoming because ramping up or down the target velocity will smoothly ramp through speeds that are not even multiples of 1 in./sec. The measured speed will not match the actual speed most of the time, so the measured speed will be too fast or too slow. And when this error is multiplied by the derivative gain, the error will make the control output look noisy. In reality, the error is not noise but quantizing error — the rounding error caused by variation in the number and values of samples taken in the sampling period.

Calculating the acceleration is even more error prone because if the velocity’s resolution is only 1 in./sec, then over a 1 msec time period the acceleration will have a resolution of 1000 in./sec2, which is not usable at all. In practice, most hydraulic systems usually ramp up and down a rates closer to 100 in./sec2. Clearly, a better way must be found to estimate the velocity and acceleration to make them usable for calculating feed forwards.

### A sensible solution

The answer to this problem is to use a model to estimate the velocity and acceleration as a function of the control output. The model is simply a set of equations that use floating point numbers having practically infinite resolution compared to a real feedback device. This eliminates the quantizing error, but the model had better be fairly accurate. To keep the model from going astray, the measured feedback is used to correct the model. Now, the derivative gain can be multiplied by the error between the target and estimated velocity. Similarly, the second derivative gain can be multiplied by the error between the target and the estimated acceleration. Doing so will make the output smoother.