^{1}

^{2}

Taking the linear inverted pendulum as the controlled object, the inverted pendulum simulation experimental platform is designed and implemented by Matlab/GUI. The platform includes six simulation experiments. Through the application of this platform in the experimental teaching and theoretical teaching of “modern control theory”, the practice shows that the platform can meet the requirements of verification, openness, design and other different levels of experiments, and through this platform, students can understand from the theoretical concept of control system to the specific control realization, which changes the previous dogma mode and realizes the combination of theory and practice.

“Modern Control Theory” is a specialized basic course for university automation majors and plays an important role in the undergraduate teaching of automation majors. It is also a basic course for postgraduate students such as “Linear system Theory” and “Optimal control theory” [

Hardware requirements: PC processors I3, I5, AMD Athlon or higher; At least 1GB of memory, recommended above 2 GB.

Software requirements: Microsoft Windows XP or Microsoft Windows 7; Matlab7.0 or Matlab R2013a.

Matlab is a software product developed by Math Works of the United States. It provides a good teaching tool for experimental teaching of modern control theory courses. The reason why the simulation experiment platform is designed and developed in Matlab environment is that the software has the following important characteristics [

1) The software centralizes all the GUI supported User controls in GUIDE (Graphical User Interface Development Environment) and provides the User with a series of Graphical User Interface tools.

2) This software integrates rich and powerful toolbox functions, which are used to expand its symbolic calculation function, graphical modeling and simulation function, word processing function and real-time interaction with hardware function. It is very convenient for users to directly conduct high-level research without writing basic programs within the scope of their own disciplines.

3) The software has superior data processing ability, which can realize the inverted pendulum simulation platform to process the data and draw the curve, which is easier for students to understand the application of control theory.

4) Simulink is an integrated software package based on Matlab environment for dynamic system modeling, simulation and comprehensive analysis. On the GUI provided by Simulink, complex simulation models can be constructed by simply dragging and dropping the mouse. Moreover, by combining the external mode of Simulink with RTWT (real-time Windows Target), users can use Simulink model as GUI for signal visualization and module parameter adjustment [

The main body of the linear inverted pendulum system includes pendulum rod, cart, portable bracket, guide rail, DC servo motor and so on. After ignoring the air resistance and various frictions, the linear one-stage inverted pendulum system can be abstracted into a system composed of trolley and homogenizing rod, as shown in

Symbol | Meaning | Numerical | Unit |
---|---|---|---|

M | Cart mass | 1.096 | kg |

m | Pendulum mass | 0.0426 | kg |

b | friction coefficient | 0.1 | N/m/sec |

l | Pendulumlength | 0.152 | m |

I | Moment of inertia of pendulum rod | 0.0034 | kg * m * m |

x | Cart position coordinates | m | |

θ | The Angle between the pendulum rod and the vertical downward direction | rad | |

ϕ | The Angle between the pendulum rod and the vertical upward direction | rad |

Assumed system state X = [ x x ˙ ϕ ϕ ˙ ] T , the force on the trolley and pendulum rod was analyzed respectively, and the system state equation with the external force (u representing the input force F of the controlled object) as the input was obtained:

[ x ˙ x ¨ ϕ ˙ ϕ ¨ ] = [ 0 1 0 0 0 − ( I + m l 2 ) b I ( M + m ) + M m l 2 m 2 g l 2 I ( M + m ) + M m l 2 0 0 0 0 1 0 − m l b I ( M + m ) + M m l 2 m g l ( M + m ) I ( M + m ) + M m l 2 0 ] [ x x ˙ ϕ ϕ ˙ ] + [ 0 I + m l 2 I ( M + m ) + M m l 2 0 m l I ( M + m ) + M m l 2 ] u (1)

y = [ x ϕ ] = [ 1 0 0 0 0 0 1 0 ] [ x x ˙ ϕ ϕ ˙ ] + [ 0 0 ] u (2)

If you take the acceleration of the car as the input u ∗ = x ¨ , the motion equation was established for the force analysis of the pendulum rod:

( I + m l 2 ) ϕ ¨ − m g l ϕ = m l x ¨ (3)

I = 1 3 m l 2 (4)

Simplifying it:

ϕ ¨ = 3 g 4 l ϕ + 3 4 l x ¨ (5)

Then the system state equation with the acceleration of the trolley as the input is:

[ x ˙ x ¨ ϕ ˙ ϕ ¨ ] = [ 0 1 0 0 0 0 0 0 0 0 0 1 0 0 3 g 4 l 0 ] [ x x ˙ ϕ ϕ ˙ ] + [ 0 1 0 3 4 l ] u * (6)

y = [ x ϕ ] = [ 1 0 0 0 0 0 1 0 ] [ x x ˙ ϕ ϕ ˙ ] + [ 0 0 ] u * (7)

The software design part of the simulation experiment platform is mainly the offline simulation GUI design. In order to build an integrated operation interface for system modeling, parameter setting and simulation control, the GUI of the inverted pendulum experiment system was compiled under the GUIDE environment of Matlab. GUI design adopts object-oriented, event-driven programming technology, that is, through the master interface to call different experimental pages. For each experiment, the actions the GUI can implement include:

1) Each experiment is carried out in different steps. Set the step button to enter different experimental interfaces.

2) In the simulation experiment, the output response and state response are displayed in real time when the control parameters change. During the experiment, students can change the parameters of the controller by dragging the mouse or manually entering the controller. After the parameter modification, it takes effect immediately and is displayed on the GUI in the form of response curve.

3) The GUI can modify system parameters based on the recommended values for the inverted pendulum system parameters. Because with the use of the system, the equipment will have different degrees of wear, for parameters such as the coefficient of friction will be changed. Thus provide the interface in the GUI, students can easily adjust system parameters.

4) The platform sets aside interfaces. Students can input algorithm code according to Matlab grammar rules by editing window, or they can encapsulate their own S-function module and create their own algorithm module by applying s-function Builder to carry out open and design experiments.

Type GUIDE in the command window of Matlab, select New in the pop-up dialog box, open the GUIDE interface or open the existing FIG screen. GUI design USES object-oriented, event-driven programming technology, users can control the program flow. In the design, a hierarchical structure is adopted, that is, different experimental pages are called through the main control interface. The main control interface of the simulation experiment platform is shown in

Take the “State space Pole assignment Control Experiment” as an example to illustrate, enter the experiment interface as shown in

The main steps are as follows:

STEP1: Establish a system

Taking the inverted pendulum system as the controlled object, the mathematical model of the controlled object is established, such as formula (6) and (7), and the parameters are substituted into

State space model of inverted pendulum:

[ x ˙ x ¨ ϕ ˙ ϕ ¨ ] = [ 0 1 0 0 0 0 0 0 0 0 0 1 0 0 48.3 0 ] [ x x ˙ ϕ ϕ ˙ ] + [ 0 1 0 4.9 ] u * (8)

y = [ x ϕ ] = [ 1 0 0 0 0 0 1 0 ] [ x x ˙ ϕ ϕ ˙ ] + [ 0 0 ] u * (9)

Program code is as follows:

Clear;

A=[0 1 0 0;0 0 0 0;0 0 0 1;0 0 48.3 0];

B=[0;1;0;4.9];

C=[1 0 0 0;0 0 1 0];

D=[0;0];

sys=ss(A,B,C,D)

STEP2: Test system controllability

The system control matrix was established by applying “M=ctrb(A,B)”, and the system controllability was analyzed by rank(M). The rank N1 of the state controllability matrix of the system was equal to the state dimension of the system (4), and the rank N2 of the output controllability matrix of the system was equal to the dimension of the output vector of the system (2), indicating that the system was controllable.

Program code is as follows:

Clear;

A=[0 1 0 0;0 0 0 0;0 0 0 1;0 0 48.3 0];

B=[0;1;0;4.9];

C=[1 0 0 0;0 0 1 0];

D=[0;0];

M1=[B A*B A^2*B A^3*B];

M2=[C*B C*A*B C*A^2*B C*A^3*B D];

N1=rank(M1)

N2=rank(M2)

STEP3: Calculate the eigenvalue

According to the requirements and with a certain margin (set the adjustment time as 2 seconds), the expected closed loop poles are calculated, and then the expected characteristic equation of the system and the original system characteristic equation are obtained.

The performance index of the system is made as follows by designing the controller:

1) Adjustment time: t s = 0.5 s ;

2) Maximum overshoot: M p ≤ 20 % .

The expected closed-loop poles are calculated as follows:

1) Determine the position of the expected pole s of the closed loop, based on the maximum overshoot:

M p = e − ( ξ / 1 − ξ 2 ) ≤ 20

Get ξ = 0.5 .

ξ = cos θ , get θ = 60 ∘ .

2) And by the t s = 4 ξ ω n , that is 4 0.5 ω n = 2 .

Get ω n = 4 .

So the expected closed loop pole: s 3 , 4 = ω n ( − cos θ ± j sin θ ) = − 2 ± j 2 3

s 3 , 4 is the dominant pole, the other two poles are more than 5 times away from the imaginary axis.

Get s 1 = − 10 , s 2 = − 10 .

So, select the desired closed-loop poles:

s 1 = − 10 , s 2 = − 10 , s 3 = − 2 + j 2 3 , s 4 = − 2 − j 2 3 .

Therefore, the expected characteristic equation is as follows:

s − s 1 ( s − s 2 ) ( s − s 3 ) ( s − s 4 ) = ( s + 10 ) ( s + 10 ) ( s + 2 + j 2 3 ) ( s + 2 − j 2 3 ) = s 4 + 24 s 3 + 196 s 2 + 720 s + 1600

Result is: a 1 = 24 , a 2 = 196 , a 3 = 720 , a 4 = 1600 .

The characteristic equation of the original system is as follows:

| s I − A | = | s − 1 0 0 0 s 0 0 0 0 s − 1 0 0 − 48.3 s | = s 4 − 48.3 s 2

a ′ 1 = 0 , a ′ 2 = − 48.3 , a ′ 3 = 0 , a ′ 4 = 0 .

STEP4: Calculate the gain matrix of state feedback

K = [ a 4 − a ′ 4 a 3 − a ′ 3 a 2 − a ′ 2 a 1 − a ′ 1 ] T − 1 = [ 1600 720 196 24 ] [ − 0.0207 0 0.0042 0 0 − 0.0207 0 0.0042 0.00000 0.00000 0.2041 0 0 0 0 0.2041 ] = [ − 33.1263 − 14.9068 56.6176 7.9402 ]

controlled variable:

u = K X = − 33.1263 x − 14.9068 x ˙ + 56.6176 ϕ + 7.9402 ϕ ˙

STEP5: simulation running

K = acker ( A , B , P ) is applied to calculate the state feedback matrix. Under the initial state x 0 = [ 0 0 0 0 ] T , run the prepared M file, and obtain the state response of the inverted pendulum state feedback closed-loop system. The simulation running results are shown in

STEP6: Program code display

The program code interface to show this experiment is shown in

The revised syllabus of modern Control Theory of Guilin University of Technology contains 38 theoretical periods and 10 experimental periods. The modern control theory simulation experiment platform developed based on MATLAB can not only solve the difficulty of insufficient hardware experimental equipment, but also facilitate the understanding of abstract and abstruse control theory and concepts for students to conduct independent and exploratory learning after class [

In the experimental teaching, a linear one-stage inverted pendulum is taken as the controlled object, which is combined with the simulation experimental platform. Teachers rely on this simulation experimental platform for on-site demonstration and programming guidance. Students start from the mathematical modeling of the controlled object and master the whole process of how to design the control system according to the control task. For example, in the “Inverted pendulum pole assignment experiment”, the control problem with the control objective of “the pendulum rod is vertically upward and the car is at the origin” was studied. The students used the ctrb( ) function and rank( ) function of Matlab to obtain the controllability matrix of the system and judge the controllability of the system. The place( ) function was used to obtain the feedback matrix of the system pole assignment state. lsim( ) function is applied to compile the system

state feedback M file, test the state response of the closed-loop system, observe the system state curve by running the program, compare the system output before and after the state feedback, and test the control performance of the designed state feedback controller. And the state feedback matrix is obtained by continuously allocating the hope poles, and the state response of the closed-loop system is tested until the output curve of the system reaches the optimal state. Through such a simulation test process, students can understand and master the theoretical relationship between the control performance index and pole position, as well as the implementation of pole assignment algorithm. By using the simulation experiment platform to realize the intuitive display of the state output of the control system, it is helpful for students to understand the principle, process and method of the state feedback controller design based on pole assignment, and facilitate students to verify relevant theories and methods in the experiment, so as to deepen their understanding of concepts, theories and methods. Combining the basic principles and basic knowledge learned in classroom teaching with the control of practical system not only deepens the understanding of book knowledge, but more importantly, cultivates students’ practical working ability.

Because this course involves a lot of mathematical operations and abstract theoretical knowledge, students in our school have poor theoretical foundation, which leads to students’ difficulty in learning and lack of interest in traditional teaching. In order to solve the practical problems in teaching for many years, the teaching application of modern control theory is based on the experimental simulation platform of inverted pendulum. In classroom teaching, the inverted pendulum is taken as the application background. Through the understanding of the structure and principle of the inverted pendulum system, students can have a detailed understanding of the realization of a control system. From the concept of control system in theory to the concrete realization of control system, it changes the previous dogmatic mode and realizes the combination of theory and practice. It can intuitively show many abstract control concepts, such as system stability, controllability, system convergence speed and anti-interference ability, etc. [

“Modern Control Theory” simulation experiment comprehensive platform takes the inverted pendulum control system as the research object, relies on Matlab powerful numerical calculation and digital simulation function, can complete the establishment of the control system model, analysis, comprehensive design, simulation research of the whole process. It meets the requirements of verification, openness, design and other different levels of experiments. Moreover, this platform can help students understand the relevant concepts, theories and methods in modern control theory, and learn scientific research methods in the specific research process to improve the ability to solve practical problems. From the concept of control system in theory to the concrete realization of control system, it changes the previous dogmatic mode and realizes the combination of theory and practice.

1) Guangxi higher education undergraduate teaching reform project (NO. 2020JGB201).

2) Undergraduate teaching construction project of Guilin University of Technology: Inverted pendulum, virtual simulation experiment teaching project.

The authors declare no conflicts of interest regarding the publication of this paper.

Yang, G.H. and Li, H.H. (2020) Design and Application of Modern Control Theory Simulation Experiment Platform Based on MATLAB. Open Access Library Journal, 7: e7030. https://doi.org/10.4236/oalib.1107030