How to simulate fixed plane using SimScape Multibody Contact Forces Library? - matlab

I am trying to simulate the contact forces between a fixed plane and a sphere in MATLAB Simulink using the Multibody Contact Forces Library https://www.mathworks.com/matlabcentral/fileexchange/47417-simscape-multibody-contact-forces-library as shown in this MATLAB webinar https://www.youtube.com/watch?v=VZIG0HlBHC4 at 9:58. However, when I recreate the model and run the simulation myself, I get the following error.
External Force and Torque External_Force_and_Torque_PlaB has its follower port rigidly connected to the world frame; it has no effect. You can configure this diagnostic in the Simscape Multibody Configuration Parameters dialog.
I've tried adding another constraint/joint between the World Frame and the planar solid to resolve the issue, but I keep getting the same error? How can I fix this error?

I ran into the same problem. Have a look here: https://ch.mathworks.com/matlabcentral/answers/378561-rigidly-connected-port-error-with-simscape-multibody-contact-forces-library
This error is due to a default setting with new Simulink models, which is incompatible with the Contact Forces Library.
To resolve this:
Go to Simulation > Model Configuration Parameters
In the Simscape Multibody > Diagnostics pane, change the "Rigidly constrained block" diagnostic to "warning" or "none"

Related

how can i do unit conversions on mathlab simulink?

I am fairly new to mathlab and simulink and am unsure how to change form rad/s to RPM. I am designing an electric vehicle powertrain and have an engine angular velocity gauge that displays results in rad/s, but I need this to be displayed in RPM? I tried to change the signal attributes but it is set to inherit and I am unable to change this.

Adding a DC Motor to a Simscape Model

I want simulate an inverted pendulum via Simcape. For this, i created a Model with SolidWorks and tranformed it to Simscape. So far so good. Everything worked and my Simulation shows the predicted physical Behavior.
But now i want to add a dc motor to my simulation, which is hooked to the sledge via belt.
I tried to connect the dc motor block with the revolute joint of the pulley, but it seems Matlab has some issues with it. It shows the error shown below.
Further you can see my simscape modell of my inverted pendulum and how i connectet the Dc motor block to the revolute jo
Has anybody an idea how to connect the dc motor correctly or is there somthing wrong with my simscape model?
I´m kind of running out of ideas and I´m gratefull for any help I can get.
enter image description here
It says one of your componenet that needs to rotate, is strictly connected to the world. I believe you need yo change that.

Control 4 wheeled raspberry robot with Simulink

I am going to control 4 wh raspberry robot in Simulink. I found this one to control DC motor with simulink: https://www.mathworks.com/matlabcentral/fileexchange/41528-raspberry-pi-dc-motor-h-bridge-driver-block-sfunction?s_tid=srchtitle It is just for a one motor. My question: is it possible to build a simulink model for 4wheeled robot car by this model? I understood that, by changing to - or + value of block constant motor will drive anticlockwise or clockwise. How to be to turn left or right? It doesn't like Python or C programming, so it's stopped project. Especially for Simulink, any idea or suggestions would be greatly approtiated! Thank you so much in adwance!
I added images which i meant in comment. I am a newbie, so please, don't judge me quality)
enter image description here
enter image description here

3D vehicle visualisation in MATLAB/Simulink

I am new to the MATLABS platform and am trying to understand how to display the 3D visualisation with graphs shown at 11:40 and at 18:10 in the video below, I downloaded and ran the example code that he provided but only the two spectrograms are operning.
If anyone can point me in the right direction, it would be very much appreciated.
Thanks.
https://uk.mathworks.com/videos/radar-system-modeling-and-simulation-for-automotive-advanced-driver-assistance-systems-107121.html?elqsid=1551737420797&potential_use=Student
As per the voice over at about 11:32, they have run the first simulation model, which is set up to write data to the MATLAB Workspace, and then to generate the virtual reality simulation they are running a second model.
From the video, at about 11:36, the second model appears to be called VR_Simulation. This second model almost certainly requires the Simulink 3D Animation tools.

Model "Point on curve" constrain in simMechanics second generation Simulink

I would like using simMechanics second generation to have a body following a predefined trajectory (like a circle). Then if i provide an external force the body must start moving constrained in the trajectory.
In simMechanics 1st generation was present the "point-on-curve" constraint, there is a way to model it in the 2nd generation?
Thank you in advance for the answer.
In SimMechanics' Second Generation, you still have a Point on Curve Constraint block, search for it in the Simulink Library Browser. More info here.