PID Design Using Frequency Domain Methods
Advanced Motion Concepts, Inc.
41 Walker Road Atkinson, NH USA
With motion control applications, a PID or Proportional plus Integral plus Derivative controller is often implemented using tuning rules or by a trial and error process on the shop floor. If modeling of the motion control system can be performed then it is possible to analytically derive the three terms of the PID controller.
The process of modeling a motion control system begins with a block diagram. As shown in Figure 1 the model is compromised of a number of different elements. The elements comprise a motion control system that is closed loop; meaning the output position, C(s) is constantly monitored using feedback, in this case a linear encoder. At the summing junction the feedback is subtracted from the desired position, R(s) and the result is an error, E(s), which is sent to the PID controller. In motion control applications the PID controller operates in discrete time with a sampling period. Every sampling period the digital controller takes the error signal and produces an output within the range of +/-10 volts. It does this using a Zero Order hold and a DAC or digital to analog converter. The Zero Order Hold refers to the process of sampling the signal and then holding between intervals which introduces a delay into the system. The digital to analog converter takes the output of the PID controller and converts it to an analog voltage. The amplifier takes the voltage signal and produces an output current to the motor. The linear actuator takes the output current and produces a linear force which translates into output position. The linear encoder provides position feedback to the controller typically using a quadrature signal measured in counts. While the model is a mixture of discrete and continuous time elements this analysis will be done in continuous time to simplify the model.
Figure 1: Block Diagram for Closed Loop Motion Control System
The modeling of the motion control system takes place in the s domain using Laplace transforms to derive the transfer functions. The s-domain transfer function for the PID controller in ideal form is:
Where is the proportional gain, is the integral time constant and is the derivative time constant. Letting be the integral gain and be the derivative gain in the terms below:
Using these terms the parallel form of the PID controller can be implemented:
The Zero Order Hold transfer function is a first-order low-pass filter with sampling period tsh/2:
Letting tsh=.001 sec,
The DAC is modeled as a constant gain with n bit resolution:
Letting n= 14 bit,
The amplifier is modeled as a constant gain, Kam, and to account for its limited bandwidth, fb, a first-order low-pass filter is added. The time constant of the filter is tam:
Letting Kam = 2 amps/volt and fb = 2000Hz,
The linear actuator is modeled as a gain, Kf, which is the linear motor force constant plus the Laplace transform of F = ma, where a is the acceleration and m is the mass of the actuator and the payload. The model assumes no friction as the system will be using an air bearing. The actuator transfer function with output in position (meters) and input in current (amps):
Letting Kf = 8.9 Newton/Amp and m=0.5kg,
The linear encoder is modeled as a gain, Ke. If the resolution of the linear encoder is 0.1 micron/count then the gain of the linear encoder is:
The multiplication of all elements from the Zero Order Hold to the Linear Encoder is known as the Open Loop Function, . The Open Loop Function used in this frequency domain analysis is:
The response of the Open Loop Function to a sinusoidal input is called its frequency response. The frequency response can be calculated by substituting s by jw in the Open Loop Function. The steady state response is then given by:
Where the difference between the output and input sine waves can be described by two parameters: Magnitude, M and phase, Φ. Magnitude measures the amplitude ratio and phase measures the phase shift. The magnitude and phase can be determined by calculator for low order systems. For higher order systems the magnitude and phase can be determined using technical computing software such as Matlab or GNU Octave.
First, we need to calculate the phase of . This is the addition of the phase shift for each element of the Open Loop Function at the specified frequency, The specified frequency needs to be chosen and is selected as 487 radians/sec.
Second, the magnitude is calculated as 1.749.
Third, we need to specify the phase margin, or stability of the system. The phase margin is the difference between the actual phase and -180° at the frequency,,where the gain equals 0dB. We choose the phase margin as 62°.
Fourth, the argument or phase shift contribution of the PID controller can then be found:
The magnitude of θ must be less than 90 degrees.
Now we can solve for the PID proportional gain:
Solving for the derivative time constant:
Solving for the PID derivative gain:
Lastly, solving for the PID integral gain:
It’s important to note these calculations are not a guarantee of system stability. It is necessary to check the response of the system to a step input using the closed loop transfer function and also to check the system stability using the Nyquist plot. Finally, to match the PID gains to your controller the form of the PID must be the same. For example the motion controller PID must take the ideal or parallel form otherwise the gains will not calculate to appropriate values.
Charles L. Phillips and John M. Parr. Feedback Control Systems, Fifth Edition, Pearson Education, 2011.
Should you have any questions about this article please contact us