PID Control Design - MapleSim Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

Using the MapleSim Control Design Toolbox to Design a PID Controller

 

1. Introduction

2. Pole Placement Method

3. Exact Pole Placement Method

4. Gain-Phase Margin Method

5. Automatic Tuning

 

 

 

 

 

1. Introduction

2. Pole Placement Method

3. Exact Pole Placement Method

4. Gain-Phase Margin Method

5. Automatic Tuning

1. Introduction

This worksheet illustrates how the MapleSim Control Design Toolbox can be used to design PID controllers using several methods. This worksheet is divided into 3 sections. In the first section, we will use the Pole Placement method to design a PI controller for a second-order system so that we can confine the closed-loop poles to a desired region. In the second section, we will use the Exact Pole Placement method to design a PID controller so that we can specify the exact location of the dominant poles. Finally, in the last section, we will use the Gain-Phase Margin method to design a PID controller for a fifth-order system.

2. Pole Placement Method

 

The Pole Placement method is a unique feature of the MapleSim ControlDesign toolbox. It allows you to specify a desired region for the closed-loop poles based on damping ratio, , and the natural frequency, .  In this section, we will show how the Pole Placement method can be used to design a PI controller for an arbitrary second-order system.

We can create a second-order system using the DynamicSystems[NewSystem] command

(1)

As mentioned above, the desired region for the closed-loop poles is defined by the damping ratio, , and the natural frequency, . For this example, the values of 0.7 and 5/2 have been chosen for the damping ratio and natural frequency, respectively.

 

(2)

(3)

Based on the values of  and , the command ControlDesign[FeasibleGain] provides you with the option to output a list of 3 possible gain values for the PI controller as sample designs for which all the closed-loop poles will lie in the desired region. Alternatively, the command gives you the option to plot a region of feasible gain values.

 

(4)

 

For this example, we will use the gain values for  and  as provided in (4)

(5)

Using these gain values, the transfer function for the PI controller can be determined as:

(6)

 

At this point, we can automatically obtain the transfer function for the closed-loop system using the command ControlDesign[PIDClosedLoop].

(7)

 

As expected, the poles of the closed-loop reside in the region defined by  and .

 

 

The pole locations can be determined using the following command:

Pole Locations

 =

 =

 

 =

 

 

The step response of the open and closed-loop system can be determined using the DynamicSystems[ResponsePlot] command. From the plots, we can see how the including of a PI controller was able to stabilize the system.

 

3. Exact Pole Placement Method

 

In this section, we will show how the Exact Pole Placement method is used to design a PID controller for a 2nd order system.

 

As in the previous section, the transfer function of the open loop system can be defined as follows:

(8)

 

Let us assume that the desired closed-loop pole locations are:

 

(9)

 

Using the ControlDesign[DominantPole] command we can obtain the PID controller transfer function

(10)

 

At this point, we can automatically obtain the transfer function for the closed-loop system using the command ControlDesign[PIDClosedLoop].

(11)

 

The step response of the open and closed-loop system is shown in the following plots. The closed-loop response in addition to tracking the input signal is much faster than then open-loop response.

 

4. Gain-Phase Margin Method

In this section, we will show how the Gain-Phase Margin method is used to design a PID controller for the following fifth-order system.

 

(12)

 

The system gain margin (in decibels) and associated crossover frequency (in rad/sec) is:

(13)

 

Similarly, the system phase margin (in degrees) and crossover frequency (in rad/sec) is:

(14)

 

Using the ControlDesign[GainPhaseMargin] command we can obtain the PID gain values so that the desired gain and phase margin for the closed-loop system is at least,  and , respectively.

(15)

 

At this point, we can automatically obtain the transfer function for the closed-loop system using the command ControlDesign[PIDClosedLoop].

(16)

 

The gain and phase margin and crossover frequencies for the loop transfer function are shown below. These values exceed the minimum requirements specified above.

 

 

(17)

(18)

 

The step response of the open and closed-loop system is shown in the following plots. Unlike the open-loop response which was more than 100% off in the steady state, the closed-loop response now tracks the input signal.

 

 

The bode plots of the open-loop system and the loop transfer function are shown below.

 

 

 

5. Automatic Tuning

In this section, we will show how to tune the parameters of a PID controller using a single tuning parameter t, which is equivalent to the desired time constant of the closed-loop system.

 

(19)

The desired closed-loop time constant t is 1.0 second (for a settling time of approximately  seconds).

 

(20)

(21)

(22)

 

Verify the resulting closed-loop settling time

(23)

 


Download Help Document