MATLAB: Translational body spring damper system with friction

body spring damperdamperfrictionjoint stiction actuatorlinearsimmechanicsSimscapeSimscape Multibodytranslation

To test the Joint Stiction Actuator block in SimMechanics, I made a small model containing 2 bodies, a prismatic joint and a spring/damper. The actuation is a body actuator which yields a force step input after 2 seconds.
To get this small test model running it took me quite some time. At this moment it sometimes runs without problems, sometimes it runs very slow, other times it freezes (simulation is running but no progress can be seen, also the simulation time stops), and sometimes it gives an error after some seconds of running. To check, just change the constants at top right corner, the spring constant, the step value (force actuation) or the damping coefficients.
Is there anyone who has experience with this Joint Stiction Actuator, or with modeling friction? Also if there are some faults in the model, please let me know.

Best Answer

Hi,
Looking at your model, I would make the following comments:
  • This is a numerically stiff system, so use a stiff solver (ode15s or ode23t)
  • Leave the max step size to auto, and maybe change the AbsTol to 1e-4
  • I think you need to subtract the external actuation signal from the computed force to work out the static friction force
  • When computing the normal force, you need to include the z axis ( sqrt(u(1)*u(1) + u(2)*u(2) + u(3)*u(3)) )
The model runs OK with the above changes. Have a look at mech_sticky_boxes as an example. It uses blocks from the library mech_friction, which might be easier to use (the joint stiction actuator is used underneath the mask). You might also want to change the visualization sample time to something like 0.1s to speed up the execution of the model, or disable the visualization altogether.
You can maybe also try using the interface blocks to Simscape so that you can use the Translational Friction block to model the friction in the joint.
HTH,
Arnaud