m Matlab simulation of inverted pendulum control system based on synovium variable structure

Table of contents

1. Algorithm simulation effect

2. Algorithms involve an overview of theoretical knowledge

3. MATLAB core program

4. Complete algorithm code file


1. Algorithm simulation effect

The matlab2022a simulation results are as follows:

 

 

 

 

2. Algorithms involve an overview of theoretical knowledge

       In the control system, the idea of ​​changing the system structure was first proposed by Wunch in 1953. Subsequently, scholars from various countries put forward the improvement of the variable structure control system on the basis of their research results, and gradually obtained a new control system theory. The synovial membrane variable control theory (SMVSCS) belongs to one of the main research directions of variable structure control theory [24,25]. The method of sliding membrane variable control is to convert the state estimation curve of the control system to the sliding mode hyperplane first, and then gradually reach the equilibrium point. Through the synovium variable structure control system, the original high-dimensional control system can be reduced to a low-dimensional system, thereby reducing the control complexity of the entire system.

    At present, many researches have been done on the design of synovial film variable structure controller at home and abroad. For example, the Lyapunov method is commonly used to obtain the total system control quantity under the premise of ensuring the stability of the control system. In addition, it is found that when the control object is restricted, as long as there are points satisfying the conditions in the state space of the control system, the control system can enter the sliding mode under the action of the variable structure control law. In terms of control effects, research on the control of synovium variable structure generally includes the following aspects:

    First, the study on the selection of the synovial membrane transition surface. Existing research results mainly include selection through linear switching surfaces, and switching methods through nonlinear sliding modes.

    Second, research on solutions to chattering phenomena. In the process of synovial membrane variable structure control, chattering often occurs, which will greatly affect the stability of the controlled object. The main reasons for the chattering phenomenon include inaccurate system model, control feedback time lag, inertia lag and problems coded by the discrete system itself. Among them, the inaccuracy of the system model is mainly due to the approximate linear modeling method used in the modeling process, resulting in the omission of the inherent high-order items of the system, resulting in chattering in the high-frequency part of the system in practice; The problem of feedback time lag will lead to a dead zone phenomenon in the state space of the control object before the control feedback arrives. At this time, there is no control feedback input, which affects the actual control effect; for the problem of inertia lag, through The switching function of the system produces an appropriate control torque to the control object, which makes a series of changes in the control object. For the discrete system itself, the chattering phenomenon is caused because the time when the discrete system moves to the synovial surface during the sampling process is inconsistent with the actual state of the system.

    Therefore, many scholars have conducted research on the problem of eliminating chattering. Slotine et al. proposed a control method based on continuous boundary layers. In this control method, the purpose of buffeting suppression is achieved by adaptively adjusting the thickness of the boundary layer, but this method will cause the control object to lose its original characteristics. Gao Weibing proposed the Lyapunov exponent method to suppress chattering. This method has achieved a certain control effect, and the control method is relatively simple.

    Third, the research on the mutual combination of control strategies. The research results on this aspect mainly include the combination of some existing control strategies and synovium variable structure control methods, such as fuzzy synovium variable structure control method, synovium variable structure control method based on neural network and so on.

3. MATLAB core program

...............................................................................

    c    = 1e-4;
    if k==1
       X_back2=0;
    else
       X_back2=X_back(k)-X_back(k-1);
    end
    s    = c*X_back2;
    y    =-inv(C*B)*(C*A*s+5*s+0.05*sign(s));
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    X(k)    = min(y);
    u_0     = X(k);
    x1_0    = x1(k);
    x2_0    = x2(k);
    x3_0    = x3(k);
    x4_0    = x4(k);
    x5_0    = x5(k);    
    x6_0    = x6(k);    
end
x1a=x1;
x2a=x2;
x3a=x3;
x4a=x4;
x5a=x5;
x6a=x6;
A  = [0,0 ,0 ,1,0,0;
      0,0,0,0,1,0;
      0,0,0,0,0,1;
      0,0,0,0,0,0;
      0,K12,K13,0,0,0;
      0,K22,K23,0,0,0;];
  
B   = [0;
       0;
       0;
       1;
       K17;
       K27];  
 C  = [0.4495,4.1930,-8.8675,0.8035,0.0151,-1.5196]; 
[F,G]   = c2d(A,B,ts);
Q       = diag([1 0 1 1 0 1]);
R       = [1];
[K,p,e] = dlqr(F,G,Q,R);
F       = F-G*K;  

%初始条件
x1_0 = 1;
x2_0 = 0;
x3_0 = 0;
x4_0 = 1;
x5_0 = 0;
x6_0 = 0;
u_0  = 0;

for k=1:1:LEN
    k
................................................................. 
end
x1b=x1;
x2b=x2;
x3b=x3;
x4b=x4;
x5b=x5;
x6b=x6;

figure;
plot(time,x1a,'linewidth',2)
hold on
plot(time,x1b,'r--','linewidth',2)
xlabel('time/s');
ylabel('x');
grid on
legend('控制率函数1','控制率函数2');

figure;
plot(time,x1a,'linewidth',2)
hold on
plot(time,x1b,'r--','linewidth',2)
xlabel('time/s');
ylabel('x');
grid on
legend('控制率函数1','控制率函数2');
axis([30,80,-6e-3,6e-3]);

figure;
plot(time,x2a,'linewidth',2)
hold on
plot(time,x2b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_1');
grid on
legend('控制率函数1','控制率函数2');
figure;
plot(time,x2a,'linewidth',2)
hold on
plot(time,x2b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_1');
grid on
legend('控制率函数1','控制率函数2');
axis([20,90,-4e-3,4e-3]);


figure;
plot(time,x3a,'linewidth',2)
hold on
plot(time,x3b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_2');
grid on
legend('控制率函数1','控制率函数2');
figure;
plot(time,x3a,'linewidth',2)
hold on
plot(time,x3b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_2');
grid on
legend('控制率函数1','控制率函数2');
axis([20,80,-1.5e-3,1.5e-3]);



figure;
plot(time,x4a,'linewidth',2)
hold on
plot(time,x4b,'r--','linewidth',2)
xlabel('time/s');
ylabel('x''');
grid on
legend('控制率函数1','控制率函数2');
figure;
plot(time,x4a,'linewidth',2)
hold on
plot(time,x4b,'r--','linewidth',2)
xlabel('time/s');
ylabel('x''');
grid on
legend('控制率函数1','控制率函数2');
axis([20,80,-1.2e-2,1.2e-2]);

figure;
plot(time,x5a,'linewidth',2)
hold on
plot(time,x5b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_1''');
grid on
legend('控制率函数1','控制率函数2');
figure;
plot(time,x5a,'linewidth',2)
hold on
plot(time,x5b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_1''');
grid on
legend('控制率函数1','控制率函数2');
axis([20,100,-5e-2,5e-2]);

figure;
plot(time,x6a,'linewidth',2)
hold on
plot(time,x6b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_2''');
grid on
legend('控制率函数1','控制率函数2');
  
figure;
plot(time,x6a,'linewidth',2)
hold on
plot(time,x6b,'r--','linewidth',2)
xlabel('time/s');
ylabel('\theta_2''');
grid on
legend('控制率函数1','控制率函数2');
axis([20,80,-15e-3,15e-3]);  
08_082_m

4. Complete algorithm code file

V

Guess you like

Origin blog.csdn.net/hlayumi1234567/article/details/130781441