This example shows a bouncing ball simulation using Hierarchical State Machines in a
QFIRE CTR-101
.A falling ball can be described by the equations:
Furthermore, it is necessary to define an initial position above the floor (i. e. zero). Thereby, the ball is able to fall.
When the ball touches the floor, its speed changes due to the elasticity of the ball. This effect can be described by the equation:
Hierarchical State Machines are used in this example.

Figure 1 - Bouncing Ball Hierarchical State Machines
The first state is the Initial Condition State. It defines the initial position and the initial speed of the ball.

The next state is the Falling State. It is responsible for calculating the fall of the ball. When the position is equal to zero, the transition is triggered and Rising State is executed.

In Figure 3, it is possible to see the Shared Variable 2 and 3. They are reset signals for the integrators sent using shared variable blocks.
The bounce is responsible for changing the speed of the ball. This event is executed only once time and the gain block is responsible for it.

The final result is possible to see in Figure 5. Due to the way that Finite State Machine works, the signal was plotted in another task.

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.