Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

This article opens a series dedicated to automated methods of tuning PID controllers in the Simulink environment. Today, we will explore how to work with the PID Tuner application.

Introduction

The most popular type of controllers used in industry within closed-loop control systems is the PID controller. While engineers remember the structure and operating principle of the controller from their student days, tuning it, that is, calculating the controller coefficients, remains a challenge. There is a vast amount of literature, both foreign (for example, [1, 2]) and domestic (for example, [3, 4]), that explains controller tuning using quite complex automated control theory language.

This series of articles will describe automated methods of tuning PID controllers using tools in the Simulink environment, such as:

  • PID Tuner,
  • Response Optimizer,
  • Control System Tuner,
  • Frequency Response Based PID Tuner,
  • Closed-Loop PID Autotuner.

The control system will be based on a DC motor with permanent magnet excitation, operating in conjunction with a gearbox under inertial load with the following parameters:

  • motor supply voltage, Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System;
  • active resistance of the motor armature winding, Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System;
  • inductive resistance of the motor armature winding, Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System;
  • motor torque constant, Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System;
  • rotor moment of inertia of the motor, Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System.

Load and gearbox parameters:

  • load moment of inertia, Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System;
  • gearbox transmission ratio, Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System.

The articles contain virtually no mathematical formulas; however, it is desirable for the reader to have basic knowledge of control theory and experience with modeling in Simulink to understand the material presented.

System Model

We will consider a linear control system for the angular velocity of a tracking electric drive, whose simplified structural diagram is presented below.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

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

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

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

  • electric drive model,

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

  • inertia load model.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

The models of the electric drive and loads also include subsystems of sensors for various physical quantities:

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

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

  • voltage across its winding (Subsystem V),

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

  • angular velocity of the controlled object (Subsystem Ω).

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

Before setting the PID controller parameters, we will run the model for simulation, taking the transfer function of the controller Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System. The simulation results for the input signal of 150 rpm are shown below.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

From the analysis of the presented 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 across the motor windings reaches a value of 150 V at the beginning of the simulation, which will lead to its failure due to the application of voltage exceeding the nominal (24 V) to its winding.

Let the system's response to a unit impulse meet the following requirements:

  • overshoot no more than 10%,
  • rise time less than 0.8 s,
  • settling time less than 2 s.

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

Configuring the controller

Controller parameter settings are done using the PID Tuner, which is available directly in the PID Controller block parameter window.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

The application is launched by pressing the button Tune…, located on the Automated tuning. It is worth noting that before performing the controller parameter tuning stage, it is necessary to select its type (P, PI, PD, etc.) and also its kind (analog or discrete).

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

  1. We go to the Output Saturation.
  2. We press the flag button Limit output, which activates fields for setting the upper (Upper limit) and lower (Lower limit) boundaries of the output range.
  3. We set the range boundaries.

The correct operation of the regulator block within the system requires methods aimed at combating integral saturation. Two methods are implemented in the block: back-calculation and clamping. Detailed information about these methods can be found here. The dropdown menu for method selection is located on the panel Anti-windup.

In the current case, we will enter the values 24 and -24 into the fields Upper limit and Lower limit respectively, and we will also use the clamping method to exclude integral saturation.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

It can be seen that the appearance of the regulator block has changed: a saturation sign has appeared next to the output port of the block.

Next, after applying all changes by clicking the button Apply, we return to the tab Main and click the button Tune…, which will open a new window of the PIDTuner application.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

In the graphical area of the window, two transient processes are displayed: for the current regulator parameters, i.e., for the untuned regulator, and for the values automatically adjusted. New parameter values can be viewed by clicking the button Show Parameters, located on the toolbar. Upon clicking the button, two tables will appear: the tuned regulator parameters (Controller Parameters) and the generated assessments of the transient process characteristics with the tuned parameters (Performance and Robustness).

As can be seen from the values in the second table, the automatically calculated regulator coefficients meet all requirements.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

The tuning of the regulator is completed by pressing the button with the 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 PID Controller parameter settings window.

The simulation results of the system with the tuned regulator for several input signals are shown below. At higher input signal levels (blue line), the system will operate in voltage saturation mode.

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

Tuning PID Controllers: Is the Boogeyman Really as Scary as He's Made Out to Be? Part 1. Single-Loop System

It should be noted that the PID Tuner tool selects the regulator coefficients based on the linearized model, so when transitioning to a nonlinear model, its parameters need to be refined. 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 exposition. Karpov V.E.
  4. PID Controllers. Implementation Issues. Parts 1, 2. Denisenko V.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster