Main Content

simscape.multibody.SphericalJoint class

Package: simscape.multibody
Superclasses: simscape.multibody.Joint

Construct spherical joint

Description

Use an object of the simscape.multibody.SphericalJoint class to construct a spherical joint. The S property of the object has a single simscape.multibody.SphericalPrimitive object that models an arbitrary 3-D rotation of the follower frame with respect to the base frame. During a simulation, the origins of the base and follower frames remain coincident, as shown in the image.

Joint Transformation Sequence of Spherical joint

Unlike a gimbal joint, the follower frame of a spherical joint can rotate arbitrarily with respect to the base frame and has no kinematic singularity.

Class Attributes

Sealed
true
ConstructOnLoad
true
RestrictsSubclassing
true

For information on class attributes, see Class Attributes.

Creation

Description

sj = simscape.multibody.SphericalJoint constructs a spherical joint with default values.

Properties

expand all

Spherical joint primitive of a simscape.multibody.SphericalJoint object, returned as a simscape.multibody.SphercialPrimitive object.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Examples

collapse all

  1. Use a simscape.multibody.SphericalJoint object to create a spherical joint.

    joint = simscape.multibody.SphericalJoint;
  2. Use a simscape.multibody.SphericalSpringDamper object to add a force law for the SphericalJoint object.

    ssd = simscape.multibody.SphericalSpringDamper;
  3. Specify the equilibrium position, spring stiffness, and damping coefficient of the force law by using simscape.Value objects.

    ssd.EquilibriumPosition = simscape.multibody.ArbitraryAxisRotation(...
                simscape.Value(45,"deg"),[1 1 1]);
    ssd.SpringStiffness = simscape.Value(0.1,"N*cm/deg");
    ssd.DampingCoefficient = simscape.Value(5e-3,"N*cm/(deg/s)");
  4. Assign the force law to the SphericalJoint object.

    joint.S.ForceLaws = ssd;
  5. Before specifying the state targets of the SphericalJoint object, you need to add the object into a simscape.multibody.Multibody object using the addComponent method. Create a Multibody object.

    mb = simscape.multibody.Multibody;
    addComponent(mb,"MyJoint",joint);
    
  6. To specify the targets of the object, create an empty operating point.

    op = simscape.op.OperatingPoint;
  7. Add a high-priority position target for the spherical primitive to the operating point. The rotation is based on the x-y-z rotation sequence.

    rot = simscape.multibody.RotationSequenceRotation(simscape.multibody.FrameSide.Follower,...
                  simscape.multibody.AxisSequence.XYZ,simscape.Value([5 10 60],"deg"));
    op("MyJoint/S/angle_axis/ax") = simscape.op.Target(simscape.Value(naturalAxis(rot)),"High");
    op("MyJoint/S/angle_axis/q") = simscape.op.Target(naturalAngle(rot),"High");
    

    Alternatively, you can use the rotation axis and angle to specify the position target for the spherical primitive.

    op("MyJoint/S/angle_axis/ax") = simscape.op.Target(simscape.Value([1 -2 3]),"High");
    op("MyJoint/S/angle_axis/q")  = simscape.op.Target(simscape.Value(45,"deg"),"High");
    
  8. Add a high-priority velocity target for the spherical primitive to the operating point. The angular velocity vector is resolved in the follower frame of the simscape.multibody.SphericalPrimitive object.

    target = simscape.op.Target(simscape.Value([20 -30 50],"deg/s"),"High");
    target.Attributes("ResolutionFrame") = "Follower";
    op("MyJoint/S/w") = target;

Version History

Introduced in R2022a