Ball and Beam model Simscape Multibody

16 views (last 30 days)
Hello :)
I'm doing a project for my studies, and I need to do a Simscape Multibody model of ball and beam which is supported in the middle. I am using R2016a version of MATLAB. I did make a model, which looked like it had good physicall behaviour, but when I tried to add PID controller nothing changed (ball is still falling). Does anyone know what I'm missing or doing wrong?
I've tried to model a system based on following equations:
,
,
,
where: θ- beam deviation angle, I-moment of inertia of beam, - moment of inertia of ball, U- torque (input), x- distance of the ball center from the middle of the beam (output), m- mass of the ball, h- height of the beam, F- friction force, r- radius of the ball.
I attach screenshots of my work and .slx file of the project.
Any help would be appreciated :)

Accepted Answer

Steve Miller
Steve Miller on 1 Apr 2019
Hi Wojciach,
There are a few problems with see_saw.slx. The most important one is that it appears you are trying to apply the force from the ball to the beam. That is not necessary - Simscape Multibody calculates the force that the ball applies to the beam for you.
The other problem has to do with your controller. There are many strategies which I am sure you can find in a Google search. You will probably need a control strategy that includes the angle of the beam.
I have attached a version that deals with both of the issues cited above. It is not the only way to solve the problem.
--Steve
  1 Comment
Alireza
Alireza on 22 Feb 2024
Edited: Alireza on 22 Feb 2024
Hi Steve,
Why does it only works for initial position of ball less than 0.01 m?
I get this error when I try to change the initial position of the ball; x > 0.01 m. But when I changed the the revolute joint input from motion to torque, the error solved, but I need motion as input, how can I solve it?
Caused by: Derivative of state 'untitled.Revolute_Joint1.Rz.w' in block 'untitled/Revolute Joint1' at time 0.0105 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!