Control of Non Linear Object Using the Vostrikov’s Localization Method. C Code and Octave Script
1. Abbreviation
2. Introduction
This article is a continuation of the article “Control System Using the Localization Method from A. S. Vostrikov. C Code and Octave Script”. Here I want to consider an example of controlling a nonlinear object using the localization method developed by A.S. Vostrikov and his group at Novosibirsk State Technical University (NSTU). For a detailed description of the method, see [1], [2]
The method localizes (suppresses) the characteristics of the object and forms a control effect on the object using the highest derivative of the output value in the feedback.
Let there be a control object which is described by the differential equation:
where
y(t) – output signal / measurement value
u(t) – control signal
Let there be a desired linear differential equation for a closed system that provides the required transients and is described by the equation:
where
x(t) – input signal / required value
y(t) – output signal
The control signal as mentioned above is formed by the highest derivative:
Substitute (9) into (7) and solve the equation with respect to the highest derivative:
Formula (10) for large K (K = > +∞) will take the form:
Thus the closed system will have the desired characteristics and despite the nonlinear control object will be described by a linear differential equation for which the superposition method/principle can be applied.
It is recommended in [1], [2] to choose K:
From what has been said the control system will take the form shown in the Figure 21
Figure 21: Localization Control System
We introduce a notation for the filter polynomial DF (15):
Note
The design of DF is described in the article: “Digital Derivative Filter Using Integrators. C Code and Octave Script”
The DF filter suppresses highfrequency interference in the feedback while in [1], [2] it is recommended to choose:
In [1], [2] it is proved that the choice of parameters according to formula (18) makes it possible to divide the system into two subsystems of fast and slow processes / motions, while fast motions are described by linear differential equations, which simplifies the assessment of the stability of the control system. Figure 22 shows the subsystem of fast motions.
Figure 22: Subsystem of Fast Motions
The characteristic equation of the differential equation for the subsystem of fast motions has the form:
The subsystem is stable if the solutions (20) lie in the left ‘s’ halfplane:
3. Example of an Analog Regulator
Let there be a nonlinear control object described by the differential equation:
Note
This equation for the control object is taken as an example from [2]
Figure 31: Non Linear Object
Now let’s choose the transfer function of the desired transition process:
The choice of Qfactor is described in the article “Digital Derivative Filter Using Integrators. C Code and Octave Script”.
Step response on the required transfer function is showed in the Figure 32
Figure 32: Required Step Response
Now let’s choose a Derivative Filter that suppresses highfrequency interference, using (18) and (19):
Then:
From (16) and (26):
To calculate the remaining coefficients, three poles of the DF are selected using the formula:
Let ‘s choose for example:
Then:
Using (12) and (22) we choose the loop gain:
Let’s evaluate the stability of the subsystem of fast motions using (20):
The (33) equation is easily solved in the Octave Tool using the roots() command:
7.954322281049990e+02 + 0.000000000000000e+00j
9.728388594750024e+01 + 2.745821720707452e+02j
9.728388594750024e+01 – 2.745821720707452e+02j
Thus the (21) is performed and the subsystem of fast movements is stable.
The Figure 33 shows Example of the Localization Control System with analog Regulator:
Figure 33: Example of the Localization Control System with analog Regulator
4. Selecting the Sampling Rate for the Digital Regulator
Before a digital regulator design is started we need to calculate the sampling rate. In previous articles: “Typical Open Loop Bode Diagram for Control Systems. C Code and Octave Script” and “Control System Using the Localization Method from A. S. Vostrikov. C Code and Octave Script” such an assessment has already been carried out. But this estimation only works for linear systems. To make this assessment for our example, the control object (22) shall be linearized.
Let’s define the state vector for (22):
In a static working point, all derivatives are zero and (34) will be rewritten as:
Obviously we have a static working point at zero values:
Now we linearize (34) at working point zero:
Returning in (35) to the singlechannel representation for the linearized control object at the zero operating point:
In Laplace Form:
Note: The linearized control object (37) is unstable.
Now let’s make a transfer function for the open control system shown in Figure 41 using the linearized control object (37):
Figure 41: Analog Open Loop Magnitude and Phase Response of Linearization Control System
From the graphs in the Figure 41 it can be seen that at
corresponds to a magnitude of 0dB.
To implement the digital regulator, we will select the sampling frequency based on 5 degrees = 0.0873 radians at a cross frequency: 230 Rad/s (see (39)). The uncertainty of the phase is calculated by the formula:
Then:
5. Example of a Digital Regulator
The structure of the digital controller is shown in Figure 51
Figure 51: Localization Control System with Digital Regulator
The digital regulator is described using zTransform, 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 [3]. The output analog y(t) signal is read using an ADC (Analog to Digital Converter), which then goes to the digital regulator.
The digital regulator is calculated on the basis of the analog one using a bilinear transformation (6), where:
To simulate the control system the ZOH and Control Object are converted into digital form using a bilinear transformation (6).
Then:
A nonlinear control object in digital form is shown in Figure 52:
Figure 52: Digital Non Linear Object
The step response of the digital control system is shown in Figure 53:
Figure 53: Step Response of the Digital Regulator
Thus the control system with a digital regulator meets the specified requirements of the transition process.
6. Conclusions of the Localization Method
The method localizes (suppresses) the characteristics of the object and forms a control effect on the object, using the highest derivative of the output value in the feedback. The method works for controlling nonlinear and linear objects.

There is a control error that depends on the loop gain (b*K):
Gain 20 corresponds to error 5%
Gain 100 corresponds to error 1% 
The transition process is completely determined by the developer, who himself chooses the desired transfer function corresponding to a linear differential equation. In this case the principle of superposition can be used

In the case of a nonlinear object to ensure the stability of the control system, an analysis method is used based on the separation of the system’s own motions into slow and fast (see [1], [2]) that occur during transients when working out initial conditions. These differenttempo movements arise as a result of the choice (18). Thus two simpler subsystems are considered, and the subsystem of fast motions is described by a linear differential equation
7. Octave GNU file LocalizationForNonLinearObject.m
The m script generates magnitude, phase and step responses, test signals and checks the analog/digital localization 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:
% sys – object of the analog filter
% TimeVector – Time space
% Text – plot titel
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
% Text – plot titel
function plot_StepResponseDigitalFilter(ZB, ZA, SampleNumber, Text)
% Digital Close Loop with 3d order derivative filter (DF3): Localization for Non Linear Object
% Input parameters:
% x_input – input signal
% K — gain
% w_required – required transient process parameter
% Q_required – required transient process parameter
% SA_derivative3 – derivative polynomial
% a_obj_1 – object parameter
% a_obj_0 – object parameter
% b_obj – object parameter
% Ts – sample time
% Output parameter:
% y_output — output
function [y_output] = DigitalCloseLoopLocalizationNonLinearDF3(x_input, K_gain, w_required, Q_required, SA_derivative3, a_obj_1, a_obj_0, b_obj, Ts)
% Float Table to File
% Support CCode
% Input parameters:
% ParameterVector – data array
% FileNameString – output file name
function FloatParamVector2file(ParameterVector, FileNameString)
8. C Language LocalizationForNonLinearObject.c/h
The demo SW is realized the digital regulator of the Localization Control System. See the files LocalizationForNonLinearObject.c/h
Functions:
/*
Control System Initialization
Clear the working arrays
Input: void
Return: void
*/
void ControlSystemInit(void)
/*
Bilinear Integrator
y(n)=y(n1)+(Ts/2)(x(n)+x(n1))
Input
float input – input
integrator_data_s* history_ptr – integrator history
Return
float – output
*/
float bilinear_integrator(float input, integrator_data_s* history_ptr)
/*
Zero Order Hold
y(n)=(1/2)(x(n)+x(n1))
Input
float input – input
float* previous_ptr – previous input
Return
float – output
*/
float zero_order_hold(float input, float* previous_ptr)
/*
Regulator
Input
float x_require – require value
float y_object – object/measurement value
Return
float – u_control value
*/
float Regulator(float x_require, float y_object)
9. Download the LocalizationForNonLinearObject.c/h/m
You can download the files:
LocalizationForNonLinearObject.m
LocalizationForNonLinearObject.c
LocalizationForNonLinearObject.h
with the button:
10. Literature / References
[1] A. S. Vostrikov “Synthesis of control systems by the localization method“, Monograph, Publishing House: Novosibirsk State Technical University, ISBN 9785778207653, Novosibirsk, 2007
[2] A. S. Vostrikov, G. A. Francuzova “Theory of automatic regulation”, Publishing House: Novosibirsk State Technical University, ISBN: 5778203896, Novosibirsk, 2003
[3] R. Dorf, R. Bishop “Modern Control System”, EddisonWesley, ISBN: 0201308649, 1998