This example shows a Discrete Controller For Inverted Pendulum using
QFIRE CTR-101
as controller.The model from Continuous and Discrete Inverted Pendulum can be used for a control system example using
QFIRE CTR-101
as controller.Due to the controller be a digital computer, it is necessary to use the discrete system to design the controller for the continuous system. This process can be described by the following steps:
Following the first step, the poles in the continuous plane were defined aiming to control the inverted pendulum as a second order transfer function. Figure 1 shows the second order function chosen.

Figure 1 - Second order transfer function
The poles of this transfer function are:
The calculation of the controller gain uses the function place. This function requires the number of poles to be equal to the number of system states. Because of this, two new poles were included in the poles vector. These poles are
The next step is to discretize the poles using the equation
This code returns:
The final step of the design is to use the function place using these poles and the matrices
The gains returned are:
These gains can be used for a disturbance controller. The diagram of this system is shown in Figure 2 and 3.

Figure 2 - Close loop control system with disturbance

Figure 3 - Discrete controller

Figure 4 - Gains in the discrete controller from Figure 3
The diagram of the disturbance in Figure 2 is shown in Figure 5.

Figure 5 - Disturbance diagram
Where the transfer function is:
Figure 6 shows the behavior of the system for this disturbance.

Figure 6 - States of the system
About MWF
MWF is a traditional Brazilian company that provides a wide range of electronic and mechatronic products for industry sectors such as automotive, agricultural machinery and aerospace.
Contact Us
Rua Doutor Siqueira, 139 / Sala 804 Campos dos Goytacazes - RJ, Brasil
contact@mwf-technologies.com
© 2018-2026 MWF. All rights reserved.