Electronic – Misconceptions about PID Controllers

control systempid controllerunits

I'm currently designing an equivalent of the mass-spring-dashpot system, and during the design phase I realized I don't fully understand how PID controllers physically work.

Below is an image, the top half of which is the physical setup. There's a mass hooked up to a spring and dashpot. There is some magical position sensor that outputs the position of the mass (ignore how it does this), and there is a motor attached to the mass so we can apply a force to it. The position sensor feeds into a computer, and the computer controls what force the motor produces.

The bottom half is what I imagine the control loop looks like. We have some set point for the mass, and the offset (error) is fed into the PID controller, which outputs a current which is fed to the motor, which outputs a force which acts on the mass, which thus changes the position.

My question is that the input to the PID controller is a position (namely x_set – x_actual), but its output is mysteriously a current. How is this possible? The PID controller computes integrals and derivatives of position, which in no way is relevant to amperage.

Am I missing a component in my control loop – is there something in between the controller and the motor? Or perhaps between the sum block and the controller?

Any help is greatly appreciated. ^^

Best Answer

The input to the PID controller is not a position. The input to the position sensor is a position.

The input to the PID controller is a signal that represents a position.

It could be a voltage, or a current, or a digital number. The exact form of the signal doesn't matter, because all it has to do is represent to the controller what the position is.

If it's an analogue signal, the set point will typically be set by a potentiometer or DAC, to put a reference analogue signal representing the desired position into an analogue subtractor.

If it's a digital signal, the set point will be a number representing the desired position into a digital subtractor.

The controller will have means to integrate and differentiate the signal, weight the direct (P for proportional), integrated (I) and differentiated (D) signals (hence PID), add them together, and output them.

If it's an analogue signal, it might drive the motor directly, or via an amplifier. A digital signal could be converted via a DAC to drive a conventional motor, or may stay digital all the way into an ESC to drive a stepper or brushless motor.