## Control System Using the Localization Method from A. S. Vostrikov. C Code and Octave Script.

### 2. Introduction

##### Figure 2-1 shows the structure of the localization method for controlling a linear object. The method localizes (suppresses) the characteristics of the object and forms a control effect/signal on the control object, using the derivatives of the output values in the feedback (12a).

Figure 2-1: Analog Localization Control System

### 3. Analog Example

##### The reaction of the control object to the step signal has the form:

Figure 3-1: Step Response on the Control Object without Regulator

##### Step response on the required transform function is showed on the Figure 3-2

Figure 3-2: Required Step Response

##### Then magnitude and phase response of the open loop is showed on the Figure 3-3:

Figure 3-3: Open Loop Magnitude and Phase Response

##### Close Loop Step Response is showed on the Figure 3-4. The system has the desired transient response:

Figure 3-4: Close Loop Step Response

### 4. Digital Regulator

##### The structure of the digital regulator is shown in Figure 4-1

Figure 4-1: Localization Control System with Digital Regulator

##### The step response of the digital control system is shown in Figure 4-2.

Figure 4-2: Step Response of the Localization Control System with Digital Regulator

### 6. Octave GNU file LocalizationControlSystem.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:
% 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:
% K — gain
% ZB_object — numerator
% ZA_object — denominator
% ZB_feedback — numerator
% ZA_feedback — denominator
% x_input – input signal
function [y_output] = DigitalCloseLoopLocalizationRegulator(K, ZB_object, ZA_object, ZB_feedback, ZA_feedback, x_input)

% Float Table to File
% Support C-Code
% Input parameters:
% ParameterVector – data array
% FileNameString – output file name
function FloatParamVector2file(ParameterVector, FileNameString)

### 7. C Language LocalizationControlSystem.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)