Modal Synthesis Method for Control Systems with an Example. C Code and Octave Script
1. Abbreviation
2. Introduction
The modal synthesis method is based on the selection of suitable roots of a characteristic linear differential equation for a closed loop control system, which provide the necessary transition process in the system. The choice of roots determines the control system’s own motions and provides the necessary working out of the initial conditions. The article is based on the [1]: A. S. Vostrikov, G. A. Francuzova “Theory of automatic regulation”. The method is used for linear control systems.
Figure 2-1 shows an Analog Modal Control System:
Figure 2-1: Analog Modal Control System
where
x(t) – input signal / required value
u(t) – object control
y(t) – output signal / measured value
Let’s write down the closed system Laplace transfer function for Figure 2-1:
Then the characteristic equation of the differential equation:
By selecting the values:
we will get the necessary roots:
of the characteristic equation (13). To avoid overshooting, only real roots will be used.
If m < (n-1) (16) then the Laplace transfer function of the dynamic correction (10) has a numerator degree greater than the degree of the denominator, which leads to a rise in the upper frequencies in the feedback. To reduce this effect, it is recommended to use Kalman-Bucy filter in [1]. See the Figure 2-2:
Figure 2-2: Analog Kalman-Bucy Filter
Stable correction: Hsc(s) is selected in such a way that transients in the Kalman-Bucy filter was an order of magnitude faster than in the control system:
In this case the control system will take the form shown in Figure 2-3:
Figure 2-3: Analog Modal Control System with the Kalman-Bucy Filter
Note
If the control object is unstable, then with the using of Kalman-Bucy Filter, the stability of the system can be achieved
3. Analog Example
Let there be a second-order control object described by a Laplace transfer function:
Note
The description of the quality factor was done in the article: “Digital Derivative Filter Using Integrators. C Code and Octave Script”
The step response of the object is shown in Figure 3-1:
Figure 3-1: Step Response on the Control Object without Regulator
Choosing the real roots (15) of the characteristic equation, we can write:
Let’s rewrite (13) for our example:
Comparing (22) and (24), we get:
Then:
We will choose the values:
based on the requirements for the transient process, for example: tp = 0.5s.
In the article “Non-Causal Digital Chebyshev Filter with Linear Phase Response. C Implementation and Octave Script.” for a Laplace transfer function:
the formula for calculating the generalized tau was proved:
Applying the (27) to the (11) and using the (22):
If root values are selected:
Then from (28) and (29):
Now let’s use the rule of the three tau for the transient process:
Thus in order to provide the necessary transient process, it is necessary to choose the roots of the characteristic equation according to the formula:
Let’s set the time of the transient process in the control system:
Then by the formula (30):
From (32) roots will be choosed:
Now the values of Ki, Kd, d1 are calculated for our example using (25):
Thus:
The Step Response of the control system is shown in Figure 3-2:
Figure 3-2: Step Response of the Analog Modal Control System (37)
Since the degree of the numerator is greater than the degree of the denominator in (36), it is necessary to apply the Kalman-Bucy Filter (see also the (16)). To design this filter, we also use the modal method using (17), (30), (31):
Laplace transfer function of the Kalman-Bucy filter from Figure 2-2:
Note for (40):
The stable correction Hsc(s) will be searched in the form:
Then:
The characteristic equation for Kalman-Bucy filter will take the form:
For our example (18), the characteristic equation for Kalman-Bucy filter will be written:
Then:
Now from (39) the roots of the characteristic equation are selected:
Then:
Comparing (44a) and (46), we get:
Solving (47) with respect to T1, T2, Ksc, we obtain:
For our example:
As a result:
4. Selecting the Sampling Rate for the Digital Regulator
Let’s choose the sampling frequency for our example as well as it was done in the article: “Control System Using the Localization Method from A. S. Vostrikov. C Code and Octave Script.”
Figure 2-1 has two feedback loops. Let’s open the external feedback loop and write down the Laplace transfer function:
(52) for our example:
Figure 4-1: Analog Modal Control: Bode Diagram of the External Open Loop
The sampling frequency choice based on 5 degrees = 0.0873 radians of uncertainty caused by sampling, at a cross frequency of 6.28 Rad/s (see the Figure 4-1). In this case, the stability reserves will worsen for the digital control system by about 5 degrees. The uncertainty of the phase is calculated by the formula:
Then for external loop:
Now let’s open the internal feedback loop (see the Figure 2-1) and write down the Laplace transfer function:
Figure 4-2: Analog Modal Control: Bode Diagram of the Internal Open Loop
The cross frequency in this case is 57.5 Rad/s (see the Figure 4-2) then for internal loop:
Choosing the maximum between (55), (57), we finally choose:
fs = max (36 Hz, 330 Hz) = 330Hz (58)
5. Digital Regulator
The structure of the digital regulator is shown in Figure 5-1
Figure 5-1: Digital Modal Control System with the Kalman-Bucy Filter
The digital regulator (Static Correction, Dynamic Correction, Stable Correction, Object Prediction) is described using z-Transform, and the object is controlled via DAC (Digital to Analog Converter), which is described using ZOH (Zero Order Hold). See a description of the ZOH in [2]. The y(t) output analog signal is read using an ADC (Analog to Digital Converter), which then goes to the digital regulator.
The digital regulator is designed on the basis of the analog one using a bilinear transformation (6).
To analyze and to simulate the control system from our example, the ZOH and Control Object was converted using a bilinear transformation (6) into digital form too.
Static Correction:
Dynamic Correction:
Stable Correction:
Object Prediction:
Zero Order Hold:
Object:
The Step Response of the digital control system is shown in Figure 5-2.
Figure 5-2: Step Response of the Digital Regulator
Thus the control system with a digital regulator meets the specified requirements of the transient process.
6. The Development Steps of the Regulator by the Modal Method
Steps of the design a modal method for object control (8):
-
Static Correction (7)
-
Dynamic Correction (10)
-
Next the characteristic equation for the control system (13) is compiled
-
Based on the requirements for the transition process, the real roots (15) (to avoid overshooting) of the characteristic equation are selected
-
The selected roots of the characteristic equation are provided by the choice of parameters (14)
-
If condition (16) is met then the Kalman-Bucy filter is inserted into the system, the parameters of which are determined from (17)
-
The sampling frequency for the design of the digital regulator is determined from the cross frequency for the transfer function of the system with open feedback. See the (55), (57)
7. Octave GNU file ModalControl.m
The m script generates magnitude, phase and step responses, test signals and checks the analog/digital modal control systems. To do this, the following functions are defined in this file:
% Plotting the Step Response of the Analog Filter: (…+b1*s^2+b2*s+b3)/(…+a1*s^2+a2*s+a3)
% Input parameters:
% SB — numerator
% SA — denominator
% TimeVector – Time space
function plot_StepResponseAnalogFilter(sys, TimeVector, Text)
% Plotting the Step Response for the Digital Filter: (b1+b2*z^-1+b3*z^-2+…)/(a1+a2*z^-1+a3*z^-2+…)
% Input parameters:
% ZB — numerator
% ZA — denominator
% SampleNumber – Sample number of the step function
function plot_StepResponseDigitalFilter(ZB, ZA, SampleNumber, Text)
% Digital Close Loop: Localization Regulator
% Input parameters:
% ZB_object — numerator
% ZA_object — denominator
% ZB_staticCorrection — nummerator
% ZA_staticCorrection — denominator
% ZD_dynamicCorrection — nummerator
% ZB_dynamicCorrection — denominator
% ZB_stableCorrection — nummerator
% ZA_stableCorrection — denominator
% x_input – input signal
function [y_output] = DigitalModalCloseLoopRegulator(ZB_object, ZA_object, ZB_staticCorrection, ZA_staticCorrection, ZD_dynamicCorrection, ZB_dynamicCorrection, ZB_stableCorrection, ZA_stableCorrection, x_input)
% Float Table to File
% Support C-Code
% Input parameters:
% ParameterVector – data array
% FileNameString – output file name
function FloatParamVector2file(ParameterVector, FileNameString)
8. C Language ModalControl.c/h
The demo SW is realized the digital regulator of the Modal Control System for our example. See the files ModalControl.c/h
Functions:
/*
Control System Initialization
Clear the working arrays
Input: void
Return: void
*/
void ControlSystemInit(void)
/*
IIR Filter with Transposed Form II
Input
float input – filter input
Return
float – filter output
*/
float iir_filter(float input, float const* all_coef_ptr, float* all_history_ptr, uint8 sos_nmb)
/*
Regulator
Input
float require – require value
float object – object value
Return
float – control value
*/
float Regulator(float require, float object)
/*
Object Simulation
Input
float control – control value
Return
float – object output value
*/
float ObjectSimulation(float control)