Simscape spatial contact force block - how to get the contact force vector?

2 views (last 30 days)
Hi, I'm working on a robot interaction project. I've modeled the robotic manipulator in SimScape, including the contact force between the end effector and the environment. However, the "Spatial Contact Force" block only allows me to sense the normal force module, whereas I need the contact force vector. I have found a workaround, but it's not very reliable. Is there any alternative option available to directly obtain the measurement from the computed interaction?
Thanks!

Answers (1)

Anurag
Anurag on 4 Sep 2023
Hi Fellarrusto,
As per my understanding of the question, you’re having problems calculating the contact force modulus between the end effector and the environment, you’re only able to see the normal force modulus.
You may refer to the following pointers to be able to calculate the contact force modulus :
  • Use External Simulink Blocks: You can use Simulink blocks to compute the contact force vector based on the normal force and distance information provided by the "Spatial Contact Force" block. Create a Simulink subsystem that takes the normal force and distance as inputs and calculates the contact force vector. This subsystem can include mathematical operations like vector multiplication and addition.
  • Custom MATLAB Function Block: Create a custom MATLAB Function block within your Simulink model. This block can be used to calculate the contact force vector based on the normal force and distance provided by the "Spatial Contact Force" block. You can write custom MATLAB code within this block to perform the necessary vector calculations.
  • Simulink Signal Routing: Use Simulink's signal routing blocks (such as "Signal Selector" and "Mux") to combine the normal force and distance into a signal that represents the contact force vector. This approach may involve some custom configuration to ensure the signals are properly combined.
Hope this helped.

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!