jump to navigation

New Frequency Analysis Software Allows Servo Tuning in Frequency Domain August 2, 2011

Posted by Servo2Go.com in Technical Support Information.
Tags: , , , ,

In most cases tuning servo systems in the time domain works well; as is evidenced by GalilTools software which performs automatic servo tuning quickly and easily for Galil controllers. However, there are some cases where designers prefer to work in the frequency domain. Tuning in the frequency domain is often preferred for systems with resonances or when the design engineer is comfortable with classroom control theory.

To address this need, Galil is introducing Frequency Analysis Software, a tool for tuning servo control systems in the frequency domain. The software in conjunction with a Galil motion controller measures the frequency response of the plant to be controlled. It simulates the possible control solutions and synthesizes the two to allow for Bode analysis of the closed loop system.

This article reviews frequency domain terminology, presents the steps for tuning using Galil’s new Frequency Analysis Software and shows an example of using the software for tuning a brushless motor with a Galil DMC-4010 motion controller.

Introduction to Frequency Domain Terminology

The elements of a typical servo system are shown in the block diagram of Figure 1. The motion controller includes the digital PID filter and DAC. The other elements of the system are defined as the plant and include the amplifier, motor, load and encoder. The amplifier converts the current command to the appropriate voltage and current to drive the motor which in turn moves the load. The position of the motor or load is measured by a digital encoder which is fed back into the controller. The closed-loop system of the controller and plant is shown in Figure 2. Note that the encoder position is compared with the command position to form the closed-loop position error which is input into the digital filter and plant.

Figure 1: Block Diagram of Servo System

Figure 2: Closed-Loop System of Controller and Plant

Figure 3: Bode Plot as generated by Frequency Analysis Software

Figure 4: Bode Plot with KP of 20 and KD of 200


A linear system in the frequency domain is described by a transfer function in which each element of the system’s frequency response is given as a function of the Laplace variable “s”. The variable “s” can also be represented as “jω” where j is the imaginary unit and ω is the frequency. Since the resulting function is a complex number with real and imaginary parts, it is most convenient to present it by its magnitude and its phase shift in a graphical form which is known as a Bode plot. The Bode Plot is a set of logarithmic graphs of the transfer function of a system versus the frequency. The Bode Plot consists of two graphs: the magnitude and phase. Galil’s Frequency Analysis Software plots the magnitude versus frequency and phase versus frequency for both the controller and the plant. The plant’s frequency response is measured from the actual plant. The controller’s response is simulated based on the selected control parameters. The product of the two functions is the system open loop frequency response. An example Bode plot generated by the Frequency Analysis Software is shown in Figure 3. The critical parameters of the frequency response which allows the designer to analyze the system performance are the crossover frequency, ωc, and the phase margin. The crossover frequency also known as the unity-gain frequency is that frequency where the open loop gain equals one. The higher the crossover frequency, the faster the system response and the higher the closed loop bandwidth will be. Of course, it is not enough for the closed loop bandwidth to be high; the system must also be stable. This is where phase margin enters the picture. The extent to which the phase of the loop frequency response at the unity gain frequency exceeds -180 degrees is called the phase margin. If the phase at the unity gain frequency is less than or equal to -180 degrees (phase margin is 0 or negative) the system will be unstable. A system with a small phase margin will be very under-damped. A good rule of thumb is to have a system with a phase margin of 45.

Tuning in the Frequency Domain

The Frequency Analysis Software (FAS) allows the designer to try various simulations of the controller parameters such as the PID filter and notch parameters and combine them with the plant to give the open loop frequency response. Based on the simulations, the designer can determine the best controller parameters to meet the desired performance criteria of phase margin and cross-over frequency for his system.

The steps for tuning in the frequency domain are as follows:

  1. Set the desired target magnitude (in counts) and the desired range of frequencies to sweep.
  2. Use FAS to measure the frequency response of the plant by pressing SWEEP. This process typically takes about a minute and only needs to be done once. The system will vibrate in response to the specified stimulus.
  3. Select the desired cross over frequency and phase margin of the open loop system.
  4. Experimentally choose the KP and KD parameters which will give an acceptable phase margin (typically 45 degrees) at the desired cross over frequency.
  5. Use FAS to SIMULATE the open loop response. Look at the phase margin and cross over frequency on the Bode Plots and repeat steps 4 and 5 until the desired response is observed.
  6. If a resonance is observed in Step 2, put in a Notch or Low Pass filter in the controller at the frequency at which the resonance occurs.
  7. Add KI if desired to eliminate position error at rest making sure to readjust parameters if the cross-over frequency and phase margin are effected.

Galil’s BLM-N23 brushless motor and DMC-4010 motion controller with -D3020 brushless drive is used in this example. The desired cross-over frequency is approximately 25Hz with a phase margin above 45 degrees. The DMC-4010 motion controller is connected to the FAS software using the Connect to Controller button and communication between the software and controller is verified.

  1. Set a Sweep frequency range of 5 to 200Hz and a target magnitude of 100cts
  2. Press SWEEP. The resulting frequency response plots of the plant are shown in Figure 4 (page 2)
  3. Desired Cross-over frequency is at least 25Hz and phase margin at least 45 degrees
  4. Try KP 20 and KD 200. Press Simulate. Figure 4 (page 2) shows that cross over frequency and phase margin are not as desired. Increase PID parameters to KP 100, KD 600. Press Simulate. The resulting frequency response is shown in Figure 5 and meets desired criteria.

Figure 5: Bode Plot with KP of 100 and KD of 600

Additional information can be found at-

For more information, please contact:      

Warren Osak       
Toll Free Phone:   877-378-0240  
Toll Free Fax:       877-378-0249


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: