Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

This article opens a series of articles on automated ways to tune PID controllers in the Simulink environment. Today we will figure out how to work with the PID Tuner application.

Introduction

PID controllers can be considered as the most popular type of regulators used in industry in control systems of closed systems. And if engineers remember the structure and principle of operation of the controller from their student days, then its setting, i.e. the calculation of the regulator coefficients is still a problem. There is a huge amount of literature, both foreign (for example, [1, 2]) and domestic (for example, [3, 4]), where the adjustment of controllers is explained in a rather complicated language of automatic control theory.

This article series will describe automated ways to tune PID controllers using Simulink tools such as:

  • PID tuner,
  • response optimizer,
  • Control System Tuner,
  • Frequency Response Based PID Tuner,
  • Closed Loop PID Autotuner.

The object of the control system will be an electric drive based on a DC motor with excitation from permanent magnets, working together with a gearbox for an inertial load, with the following parameters:

  • motor supply voltage, Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system;
  • active resistance of the motor armature winding, Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system;
  • inductive resistance of the motor armature winding, Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system;
  • engine torque factor, Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system;
  • moment of inertia of the motor rotor, Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system.

Load and gearbox parameters:

  • load inertia moment, Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system;
  • gear ratio, Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system.

Articles practically do not contain mathematical formulas, however, it is desirable that the reader has basic knowledge in the theory of automatic control, and also has experience in modeling in the Simulink environment to understand the proposed material.

System model

Let us consider a linear control system for the angular velocity of a servo drive, a simplified block diagram of which is presented below.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

In accordance with the above structure, a model of such a system was built in the Simulink environment.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Models of the electric drive (Electric actuator subsystem) and inertial load (Load subsystem) are created using blocks of the physical modeling library Simscape:

  • drive model,

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

  • inertial load model.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Electric drive and load models also include subsystems of sensors of various physical quantities:

  • current flowing in the motor armature winding (subsystem A),

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

  • voltage on its winding (subsystem V),

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

  • angular velocity of the control object (subsystem Ω).

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Before tuning the parameters of the PID controller, we will run the model for calculation, assuming the transfer function of the controller Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system. Simulation results for 150 rpm input are shown below.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

From the analysis of the above graphs, it can be seen that:

  • The output coordinate of the control system does not reach the specified value, i.e. there is a static error in the system.
  • The voltage on the motor windings reaches a value of 150 V at the beginning of the simulation, which will lead to its failure due to the supply of a voltage greater than the nominal voltage (24 V) to its winding.

Let the response of the system to a single impulse must meet the following requirements:

  • overshoot (Overshoot) no more than 10%,
  • rise time (Rise time) less than 0.8 s,
  • Settling time less than 2 s.

In addition, the regulator must limit the voltage applied to the motor winding to the value of the supply voltage.

Setting up the controller

Setting the controller parameters is carried out using the tool PID tuner, which is available directly in the PID Controller block parameters window.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

The application is launched by pressing a button Tune...located on the panel Automated tuning. It should be noted that before performing the stage of setting the controller parameters, it is necessary to select its type (P, PI, PD, etc.), as well as its type (analog or discrete).

Since one of the requirements is to limit its output coordinate (voltage on the motor winding), then the allowable voltage range should be set. For this:

  1. Go to the tab output saturation.
  2. Click on the flag button limit output, as a result of which the fields for setting the upper (Upper limit) and lower (Lower limit) limits of the range of the output value are activated.
  3. Set the range limits.

The correct operation of the regulator unit as part of the system involves the use of methods aimed at combating integral saturation. The block implements two methods: back-calculation and clamping. Detailed information about these methods is located here. The method selection drop-down menu is located on the panel Anti-windup.

In the case under consideration, we write the values ​​24 and -24 in the fields upper limit и lower limit accordingly, and also use the clamping method to eliminate integral saturation.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

You can notice that the appearance of the regulator block has changed: there is a saturation sign next to the output port of the block.

Further, accepting all changes by pressing the button Apply, back to the tab Hair and press the button Tune..., which will open a new PIDTuner application window.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

The graphics area of ​​the window displays two transient processes: at the current controller parameters, i.e. for an unadjusted controller, and for automatically selected values. The new parameter values ​​can be viewed by clicking on the button. Show Parameterslocated on the toolbar. When you click on the button, two tables will appear: the selected controller parameters (Controller Parameters) and the estimates of the characteristics of the transient process with the selected parameters (Performance and Robustness).

As can be seen from the values ​​of the second table, the automatically calculated regulator coefficients satisfy all requirements.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

The controller setting is completed by pressing the button with a green triangle located to the right of the button. Show Parameters, after which the new parameter values ​​will automatically change in the corresponding fields in the parameter settings window of the PID Controller block.

The simulation results of a system with a tuned controller for multiple inputs are shown below. At high levels of input signals (blue line), the system will operate in voltage saturation mode.

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Tuning PID controllers: is the devil as scary as he is painted? Part 1. Single-circuit system

Note that the PID Tuner tool selects the controller coefficients according to a linearized model, so when switching to a nonlinear model, it is necessary to refine its parameters. In this case, you can use the application Response Optimizer.

Literature

  1. Handbook of PI and PID Controller Tuning Rules. Aidan O'Dwyer
  2. PID Control System Design and Automatic Tuning using MATLAB, Simulink. Wang L.
  3. PID control in a non-strict presentation. Karpov V.E.
  4. PID controllers. Implementation issues. Parts 1, 2. Denisenko V.

Source: habr.com

Add a comment