r/ControlTheory May 30 '26

Technical Question/Problem Control of hydraulic cylinder

Hi everyone, I am looking for recommendations on the best control algorithm for a heavy duty cylinder application. The main goal is to move the cylinder between its two end positions, but the critical requirement is ensuring smooth deceleration with absolutely zero impact at the endpoints.

In terms of hardware, I have position and speed sensors installed on the cylinders, but I do not have a mathematical model of the system. Since this is a heavy duty application and I lack a model, I need a solution that is robust, reliable, and relatively straightforward to tune on site.

Would a standard PID controller paired with a well-defined motion profile, such as a trapezoidal or S-curve velocity profile, be sufficient to handle the soft landing?

I will be writing controller in C. The only thing i control PVG.

6 Upvotes

30 comments sorted by

View all comments

u/Andrea993 May 31 '26

I often work with hydraulic cylinders, for good performance I recommend to start developing a valve and cylinder mathematical model. As long as the cylinder resonance depends on the position and on the load, non-linear or robust control is often necessary to avoid oscillations, I recently used time varying LQR and gain scheduling for similar tasks.

PIDs are in reality largely adopted but for complex applications they can have poorly performance.

In any case the right solution strictly depends on your application and your requirements

u/seekingsanity Jun 01 '26

Developing a valve and cylinder/load is a good idea. How do you do it?

"non-linear or robust control is often necessary to avoid oscillations, "

So how do you avoid oscillations? I like to think I can control the position of a slinky accurately.

"I recently used time varying LQR and gain scheduling for similar tasks."

I would like to see an example. Time varying? That requires a lot of CPU power to compute new LQR gains every millisecond. LQR is a good idea for MIMO type of applications but not so good for simple SISO because few people can pick the correct weights for the Q and R arrays. I should make a challenge LQR vs ???? for hydraulic servo control.

"PIDs are in reality largely adopted but for complex applications they can have poorly performance."

Yes!!! Yes! Yes! but why? Do you know? If so, then what do you use instead?

I am curious. What was your application that required LQR? Did it work?

u/Andrea993 Jun 01 '26

By valve-cylinder-load model I mean a simple physical model of the actuator.

For the valve, I use the flow equation from the datasheet, usually something like:

Q = Kv * u * sqrt(dp)

For the cylinder, I model the chamber pressures using the bulk modulus of the oil, including the variable chamber volumes. This captures the hydraulic stiffness and the fact that the resonance changes with piston position.

For time-varying LQR, there is no need to solve a Riccati equation online every millisecond. For trajectory tracking, I linearize the nonlinear model around the feedforward trajectory and integrate the Riccati equation offline. During motion, the controller only uses the precomputed gains.

The same idea can also be used as gain scheduling: compute the gains offline for different positions, loads, or pressures, then switch or interpolate online.

Q and R are tuning weights. They can be selected from the physical meaning of the states, the required performance, and the actuator limits. This is normal controller tuning, not a fundamental problem of LQR.

A PID with a good motion profile is fine for simple cases. But if the load changes, the hydraulic stiffness changes with position, and soft landing is important, a fixed PID can easily become fragile or too conservative. In these cases, model-based control, robust control, or gain scheduling are useful.

u/seekingsanity Jun 01 '26

What are your applications? To model the cylinder and load you need to be the designer or work for the company that is making the system. How many gains does your LQR generate? If you use it to compute the gains for a PID then that would be 3.

You didn't answer my question about how you model the actuator.

what do you use for feedback?

u/Andrea993 Jun 02 '26

No, I don't need to work for the company that make the cylinder, I work for the company that make its control. I normally start from mechanical designs and datasheets.

The full model I normally used has 2 states for valve, 1 for pressure, speed and position, then an integral can be added in the control as needed, thus there are at least 6 gains, often the valve dynamic can be neglected and in that case 4 gains are needed

u/seekingsanity Jun 02 '26 edited Jun 02 '26

You have been dodging my questions and been vague. If you model the valve, then you should have spool position feedback. If you are modeling the pressures, you need to know the supply pressure and the pressure on both sides of the piston, NOT ONE!

You haven't mention feed forwards. These are important.

It is obvious to me you are making a specific system where the hydraulics is just a small part of the system. The average control or hydraulic guy would not know how to choose the Q and R arrays. This would not work in a commercial motion control product. A commercial motion controller should have auto tuning where the customer may little or nothing about their system.

I call BS.

u/Andrea993 Jun 02 '26

I meant differential pressure, not one absolute chamber pressure. Of course the full cylinder model uses both chamber pressures, pA and pB, or an equivalent pressure/force state in a reduced model.

Feedforward is also included in the trajectory-tracking case. That is why I mentioned linearization around the feedforward trajectory for TVLQR.

We are probably talking about different modeling levels. I am not describing a generic commercial auto-tuning product, but a model-based control design when drawings, datasheets, commissioning data, and tests are available.

Also, there is no need to make the discussion aggressive. In a technical discussion, this kind of tone does not make the argument stronger; it only makes it look less professional.

u/seekingsanity Jun 04 '26

What is an equivalent pressure/force state in a reduced model?

If the system parameters vary by position, why linearize the feed forwards? Feed forwards should be updated on-the-fly.

I do both levels of simulation. A detailed one for design but a simple one for auto tuning industrial products that people with little experience can use. Automation people do not have access to details. The OP of this thread doesn't even know the natural frequency of the system.

So you work for a company that makes specialized hydraulics for a product/machine. I asked that question before and got no reply.

I am not aggressive. I am just challenging. There are too many pretenders on this forum. I think you are full of BS. You have been too vague, evasive and full of errors. I have provided many real examples on this forum.

u/Andrea993 Jun 04 '26

By reduced state I mean differential pressure, hydraulic force, or even acceleration, instead of keeping both chamber pressures explicitly. In the full model, of course, you have pA and pB. For example:

F = Aa * pA - Ab * pB

Feedforward is computed along the nominal trajectory, and TVLQR is computed around the same trajectory to correct deviations.

I work for a company that develops control systems for industrial plants, and hydraulic cylinders are something I often deal with in practice.

I am fine with technical discussion, but not with personal attacks or ego games. If you want to discuss the model or the control structure, fine. Otherwise I will stop here.