Make a pendulum that moves according to an equation of motion

8 views (last 30 days)
I am trying to make a pendulum in Simulink/ SimMechanics that moves according to the equation of a damped, driven oscillator. I have been able to make the pendulum move but it oscillates for a little and dies down, just to start up again. I put a scope block in and the graph is just simply sinusoidal so I know the motion should not change like it is. I think the issue is that I am applying the force at the bottom of the pendulum (not the joint itself) and the joint is setup for motion under "automatically computed". When I change the joint so its motion is "provided by input" then I get an error that there are to many joints with manual inputs and I should try fixing it by adding joints with auto inputs. When I do that I get the same exact error. I am new to MATLAB so there is a good chance that this is a simple fix but I have no idea. Can someone please help? Thanks!
<<
<<
>>
>>

Accepted Answer

Sebastian Castro
Sebastian Castro on 16 Apr 2015
If your pendulum has one Revolute Joint, then you need to have either the motion input or the force input as "automatically computed". That is, you either supply a motion profile and the torque is automatically computed, or you supply a torque profile and the motion is automatically computed.
Since you're actuating the bottom of the pendulum, I'd leave the torque input of the joint to "None" and the motion to "Automatically computed". This should be fine.
One thing you can check is whether your External Force and Torque block is applied the force to the "Attached Frame" or the "World". With the former, the force might be changing direction as the pendulum moves. With the latter, the force will always point in the same global direction (I'm guessing vertically).
- Sebastian
  5 Comments
Sebastian Castro
Sebastian Castro on 19 Apr 2015
That looks right. I'd check the initial conditions (State Targets) of your Revolute Joint. You can also use the Model Report to verify these initial conditions.
Also, it may be the way the shapes are set up. For example, an angle of 0 degrees actually corresponds to the pendulum starting in a horizontal setup. If so, you can add a rotation with Rigid Transform blocks so that zero matches your desired convention.

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!