# Controlling the speed and position of a linear actuator

I'm trying to control a linear actuator's position and velocity. I can create independent PID loops to control either position or velocity, but I'm not sure how I could control both.

Should I be looking at a cascade PID? Which of the two would be the inner loop, and how would I use the output of the outer loop as the set point of the inner loop?

Or, should I be looking at trajectory generation?

The figure below shows an example of the type of motion I'd like to generate, but with meters in place of degrees.

• The position loop can be built around the velocity loop. – Eugene Sh. Nov 7 '16 at 19:55
• The faster loop should be the inner for stability reasons. – DPF Nov 7 '16 at 20:22

It's 6 months old, but bumped by the system and the given answer is unrelated to the question. I'll try.

To answer the original question, yes, you will need a cascade controller. I think you can do this with two PID control loops.

The first PID loop is for position, it computes error based on where it is and where to go. The output of this PID is the speed setpoint for the next PID.
The output of the first PID must be limited to the maximum speed of the system. Otherwise Ki will saturate.

The second PID loop for the speed takes the current speed, and the requested speed (+/- direction) from the first PID and sets motor current accordingly.
This PID has a faster system if you have a gearbox.

You also might also want to limit the acceleration.
I'm not sure of the best place in the loop to do this. Maybe a third PID parallel the position pid only able the reduce the speed setpoint if it acceleration was too quickly. Feel free to comment/edit.

I've made a similar setup with 3 PID loops, one extra loop subtracts from the second setpoint if system limits are exceeded on the actuator. For example in this situation it might perform motor current limiting when blocked or with heavy load.

Fuzzy control loops can be a suitable alternative depending on your application requirements.

In order to design a real HDD, and optimize the stability, speed and overshoot of the servo loop, one must consider all variables not included in this simple question. For example bandwidth of feedback , bandwidth of trajectory and stability of loop to physical disturbances of shock vibration and jerks.

For example climatic and polarized differences in magnetic force of coil in any permanent magnet will vary at extreme position, direction and temperature which affects your gain constants.

## The fundamental starting point is trajectory design.

At first unknowns must be defined for maximum {a,v and x} where x includes max radial distance to seek and max position error on track. (PES = position error signal). These are unique to the hardware.

This is just a gross simplification.

The inputs are Voltage and current to the voice Coil (VCM).

• the result is force with current and acceleration depends also on the coercivity of the rare earth magnet, coupling factor, temperature sensitivity , directional sensitivity and supply tolerance at 12V. Thus acceleration feedback is derived from VCM current while velocity feedback comes from the tach-like conversion servo track crossings which are derived for each cycle of the PES signal.

Both velocity tach and VCM current are used in the trajectory control until arrival of the last track and the loop PID characteristics switches to PES feedback only.

If one knows the max velocity , then they can predict when to start braking with the inertia of the head-arm assembly (HAA) in order to arrive at the last track with the greatest speed before going to PES tracking mode and have

If all of these design goals and block function variables are specified up front, then servo PID loop design may begin.

There are many other constrains for reducing slew rate for quieter operation, you may neglect for now. But vibration reduction from spindle run out is a priority as well as external mechanical environment specs with PES error and bit error rate BER.

Also assume your assembly is perfectly dynamically balanced and you have some idea on the the baseplate resonant frequencies which occur in any design, which affects the PID phase margin and tradef between stability and speed as well as ruggedness under disturbances and data integrity loss with position error.

• +1 for the great info, but i think he is taking about linear actuators ( DC motor + acme screw in one package ) rather than Linear Motor ( aka voice coil ) – ElectronS May 24 '17 at 8:14