How to give initial velocity to a body in Simscape?

9 Ansichten (letzte 30 Tage)
Divyansh Gupta
Divyansh Gupta am 6 Jul. 2022
Beantwortet: Karan Singh am 29 Sep. 2023
I am trying to simulate a double inverted pendulum (similar model) and I would like to give an initial velocity to mass 2. I have set other initial conditions for the model including initial angles but I am unable to give initial velocity to the model. I want the motion for the revolute joint (theta 2) to be automatically computed so can't add signal input to the joint.
Let me know if it is possible to do this in Simscape Models?

Antworten (1)

Karan Singh
Karan Singh am 29 Sep. 2023
Hi Divyansh,
From what I understand, the goal is to provide an initial velocity for mass 2, which is part of the double inverted pendulum model. However, the challenge is to assign an initial velocity to mass 2 without directly adding a signal input to the revolute joint representing mass 2.
You can achieve this by modifying the Simulink model as follows:
  1. Add a Zero-Order Hold block to the model.
  2. Connect the output of the Zero-Order Hold block to the input of the revolute joint representing mass 2 (theta 2).
  3. Configure the Zero-Order Hold block to hold the initial velocity value you desire.
Here is it step by step:
  1. From the Simulink Library Browser, locate the Signal Attributes category and expand it.
  2. Drag and drop the Zero-Order Hold block into your model.
  3. Connect the output of the Zero-Order Hold block to the input of the revolute joint representing mass 2 (theta 2).
  4. Double-click on the Zero-Order Hold block to open its block parameters.
  5. In the block parameters, set the Initial condition to the desired initial velocity value for mass 2.
The Zero-Order Hold block will hold the initial velocity value until the simulation starts.
Attached below are some documentation links that you may find helpful:
Hope this helps!
Karan Singh Khati

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by