- 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!