## 4 Construction of a Control System Model and Test Results
### Simulation Tests of a Control System without Disturbances and Inertial Block  
The control system without disturbances and inertial block was connected according to the diagram shown in Figure 2 in order to perform tests. Constant parameters in the system were set in accordance with Table 1.  
Two control systems were tested: one with a PID controller and the other with a TR controller. It should be noted that in each test, the range of the actuator system was limited in accordance with Table 1. The lack of this limitation greatly facilitated stabilisation, especially when using a PID controller. Five tests were performed for the TR controller. In each test, the \(k_{c}\) parameter was set to a value of 500. The first three tests showed the influence of the \(\varphi_{min}\) parameter on the quality of control. The initial value of the control system (deviation of the inverted pendulum at the start of the stabilisation process, \(\varphi_{0}\)) was set to \(\varphi_{0}=1\) (1 \(radian\) corresponds to 57.3\({}^{\circ}\)), and the \(\varphi_{min}\) parameter was changed. Tests were performed for \(\varphi_{min}=0\), \(\varphi_{min}=0.05\) (2.86\({}^{\circ}\)) and \(\varphi_{min}=0.1\) (5.73\({}^{\circ}\)). In the second part of the TR controller tests, the influence of the initial value on the quality of control was checked. Two additional tests were performed with settings of \(\varphi_{0}=0.5\) (28.65\({}^{\circ}\)) and \(\varphi_{0}=0.2\) (11.46\({}^{\circ}\)). The value of \(\varphi_{min}\) was set to be constant, and \(\varphi_{min}\) was assumed to be 0.05. The Author's experience shows that a value of approximately (3\({}^{\circ}\)) is an error that may appear in an average inertial measurement system. Figure 2: Diagram of the control system without disturbances and inertial block. In the first stage of testing the PID controller, it was necessary to select the settings. Determining the PID settings was a time-consuming task and did not guarantee the best possible result. In order to select the PID controller settings, the author used tuning tools offered by PID MatLab Simulink and his own experience in this area. To determine these settings, a large number of simulation experiments were carried out. From the obtained results, two sets of PID controller parameters (Tables 2 and 3) were selected, and tests with these settings are presented in this study. Tests were conducted for both sets of PID settings, showing the impact of the initial value on the quality of regulation. Tests were performed with settings of \(\varphi_{0}=1\) (57.3\({}^{\circ}\)), \(  
As can be seen from the graphs (Figures 3-5), the TR and PID controllers successfully stabilised the inverted pendulum at the equilibrium point. The advantage of the TR controller is the lack of overshoot and the speed of adjustment, although the difference in the TR controller is not the same. Figure 4: The results of the simulation test of the TR controller in close-up. Figure 5: The results of simulation test No. 1 of the PID controller. Figure 6: The results of simulation test No. 2 of the PID controller. the rate of adjustment is not large. It should also be noted that the TR controller was very easy to tune, and linear modification of one parameter allowed a satisfactory result to be achieved in a short time. In the case of the PID controller, tuning was very time-consuming. Although the PID controller is a linear controller, the dependence of the control result on the controller settings is highly nonlinear. Correcting the four parameters required a lot of experimentation, and once tuning is complete, there is no certainty that the result achieved is the best possible one. The graph in Figure 4 shows the influence of the \(\varphi_{min}\) parameter in the system with the TR controller. As can be seen in the graph, the \(\varphi_{min}\) parameter causes the system to stabilise at a level far from the set value. The larger the value of \(\varphi_{min}\), the greater the distance from the set value.