This example shows how to model a custom force law that integrated with the Spatial Contact Force block. The custom force law modifies the coefficients of friction based on the disk's position.
Two spinning disks are released above a floor with an initial translational speed. The friction between the disks and the floor slows the rate at which they spin and slide. When the disk with the custom force law reaches a patch of ice (shown visually in the animation), the coefficients of friction are reduced. The rotational speeds of the disks and trajectories of the disks differ, showing the effect of the custom force law.
The plot below compares the rotational speed of the disks and their position along the global x-axis. When the disks hit the patch of ice, only the disk with the custom force law has its friction force affected.
This example shows how to model a custom force law that integrated with the Spatial Contact Force block. The custom force law modifies the coefficients of friction based on the disk's position.
Two spinning disks are released above a floor with an initial translational speed. The friction between the disks and the floor slows the rate at which they spin and slide. When the disk with the custom force law reaches a patch of ice (shown visually in the animation), the coefficients of friction are reduced. The rotational speeds of the disks and trajectories of the disks differ, showing the effect of the custom force law.
This shows the basic calculations required for developing a custom force law.
Calculate quantities upon which normal/friction will depend
Obtain relevant tangential veloctiy.
Calculate normal force
Calculate friction force
Decompose friction force along relevant axes (tangential plane)
Simulation Results from Simscape Logging
The plot below compares the rotational speed of the disks and their position along the global x-axis. When the disks hit the patch of ice, only the disk with the custom force law has its friction force affected.
This example models collisions between parameterized solids, solids represented by CAD geometry, and point clouds which act as an approximation of the geometry for the purpose of contact.
Two spheres follow different trajectories as they collide with the steering wheel. The sphere whose contact is directly with the CAD geometry follows a path around the convex hull that encloses the CAD geometry. The sphere colliding with the point cloud passes through the hole in the steering wheel.
This script plots the paths of the balls and the final position of the steering wheel. The ball that models contact with the STL file directly encounters the convex hull and does not pass through the hole. The ball that models contact with the point cloud passes through the hole in the steering wheel.
This example models collisions between parameterized solids, solids represented by CAD geometry, and point clouds which act as an approximation of the geometry for the purpose of contact.
Two spheres follow different trajectories as they collide with the steering wheel. The sphere whose contact is directly with the CAD geometry follows a path around the convex hull that encloses the CAD geometry. The sphere colliding with the point cloud passes through the hole in the steering wheel.
The Spatial Contact Force block uses a convex hull to detect contact between the steering wheel geometry and other objects (ball, floor). This plot shows what that convex hull would look like.
Simulation Results from Simscape Logging
This script plots the paths of the balls and the final position of the steering wheel. The ball that models contact with the STL file directly encounters the convex hull and does not pass through the hole. The ball that models contact with the point cloud passes through the hole in the steering wheel.
This example models a top spinning on a flat surface. The top consists of a narrow shaft and a truncated sphere. When spun at high speeds, the stem will tilt downwards until it lifts the body of the top off of the ground. Mask parameters select whether contact with the floor is modeled using a sphere or a point cloud. A point cloud will result in higher amounts of friction forces with the floor for the same friction coefficients.
Two types of geometry can used to model contact the floor. For both the truncated sphere and the stem, either a single sphere (single point of contact) or a point cloud can be used. The biggest difference in behavior is that for objects spinning about an axis that goes through the point of contact, no friction is generated. As a result, the point cloud will have higher levels of friction for the spinning top for the same friction coefficients.
Points For Truncated Sphere
A set of points is used to define the profile of the truncated sphere. The internal profile of the sphere adjusts the location of the center of mass which influences how quickly the top will flip over.
Convex Hull
If the top were defined as a single solid, the Spatial Contact Force block would use its convex hull to detect contact with the floor. This plot shows what that convex hull would look like.
Simulation Results from Simscape Logging
This is a plot of the rotational speed of the top. The rotational speed of the top about its axis switches direction as the top flips over and stands on its stem. Eventually the top slows down enough that both the stem and the body are touching the ground, and the top is rolling in a circle.
Simulation Results from Simscape Logging: Comparing Contact Proxies
This plot compares the effect of selected contact proxies at the head and base of the top. The Point Cloud will result in higher levels of friction than the sphere for the same friction coefficients. This is because multi-point contact will have a higher relative velocity, especially for objects that spin about an axis that passes through the contact point.