Ball on the platform (physical component)
The Ball and Plate system is a classic test bench for testing control algorithms in robotics and mechatronics.
The system simulates the dynamics of an unstable object, where it is required to hold the ball at a given point on the platform by controlling its tilt.
Creating such a system in the form of a physical component simplifies modeling, since it allows you to directly implement the model through physical equations, the Engee modeling language for physical components takes over the routing of information and allows you to compactly develop models in a text editor.
Mathematical description
The motion of the ball along an inclined plane is described by a system of differential equations that take into account non-slip rolling, damping, and constraints.
The equations of motion of the ball:
Where:
- — coordinates of the ball on the platform,
- — platform tilt angles,
- — the mass of the ball,
- — acceleration of free fall,
- — damping coefficient,
- — external forces.
Modeling of boundary conditions (walls):
When reaching the edge of the platform () an elastic reaction occurs:
where — half the size of the platform, — the radius of the ball, — wall stiffness, — wall damping, and — Heaviside function, which activates the damper only when moving towards the wall.
Launching the model
Let's study the behavior of the model when increasing vibrations are applied, that is, without trajectory control and without feedback.
engee.open("ball_and_plate.engee")
data = engee.run()
ball_x = data["ball_x"]
ball_y = data["ball_y"]
plate_angle_x = data["plate_angle_x"]
plate_angle_y = data["plate_angle_y"]
gr()
plot(
plot(
plot( plate_angle_x.time, (180/pi) .* [plate_angle_x.value plate_angle_y.value],
xlabel="Time, from", ylabel="Angle, degree",
label = ["X-angle" "The Y-angle"],
title = "Platform deflection angle",
left_margin = 10Plots.Measures.mm),
plot( ball_x.time, [ball_x.value ball_y.value],
xlabel="Time, from", ylabel="Displacement, m",
label = ["X" "Y"],
title="Moving the ball on the platform",
left_margin = 10Plots.Measures.mm),
layout=(2,1),
),
plot(ball_x.value, ball_y.value,
title="The trajectory of the ball", label="", aspect_ratio=:equal,
xlabel="X-offset, m", ylabel="Y offset, m"),
size=(900,400)
)
At the moment a force of 0.01 N with a duration of 0.2 s is applied to the ball - we will see the effect of the nudge experienced by our control object.
Conclusion
The presented Ball and Plate model clearly demonstrates the key principles of dynamics and management of technical systems. This model is an effective platform for studying and testing real-time stabilization algorithms, it can also be controlled via an external controller and control algorithms can be debugged in this way.
