- Create a subsystem which takes three mechanical signals and outputs a single mechanical signal (this will be similar to what the “switch” block does in Simulink).
- If the mechanical signal is position or velocity, you can use the “Ideal Translational Motion Sensor” block to convert it to a Physical Signal and pass the output to a “PS Switch” block.
- Configure the “PS Switch” block as you would configure a “switch” block in Simulink.
- Now pass the output of the “PS Switch” block to an “Ideal Translational Velocity Source” block to again convert the signal to a Mechanical Signal.
- Connect the output of the above to the outport of the subsystem.
Is there a easy possibility to create a mechanical switch in simscape? (parameter-based)
6 ビュー (過去 30 日間)
古いコメントを表示
Hello together,
I would like to include a mechanical switch in my simscape model to change the connected blocks easily.
More detailed: 1) one output
2) 2 possible inputs
3) select one ->100%; the other 0%
4) selection of the output through parameter or simulink block
5) would be enough, if it can be set before the simulation begins
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/819634/image.png)
Thanks for your answers.
Greetings Felix
0 件のコメント
回答 (1 件)
Pramil
2024 年 2 月 27 日
Hey Felix, well there is no such one block available in Simscape Mechanical that can achieve that but instead you can create a subsystem for the same using a “PS switch” block and sensors.
You can do the following:
Tip: You can create a mask for the configuration of the “PS Switch” block so that you do not have to open the subsystem for the configuration. You can know more about how to create mask from the following link:
I have attached an example Simscape model which works in both MATLAB R2021a and R2023b, where the velocity is selected depending upon the position of a mass attached to a damping spring.
You can check out more about “PS Switch” block from the following page:
hope it helps
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Foundation and Custom Domains についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!