Description

Base class for a MacPherson strut modeled with bodies and constraints.

Derived from ChSuspension, but still an abstract base class.

The suspension subsystem is modeled with respect to a right-handed frame, with X pointing towards the front, Y to the left, and Z up (ISO standard). The suspension reference frame is assumed to be always aligned with that of the vehicle. When attached to a chassis, only an offset is provided.

All point locations are assumed to be given for the left half of the suspension and will be mirrored (reflecting the y coordinates) to construct the right side.

#include <ChMacPhersonStrut.h>

Inheritance diagram for chrono::vehicle::ChMacPhersonStrut:
Collaboration diagram for chrono::vehicle::ChMacPhersonStrut:

Public Member Functions

 ChMacPhersonStrut (const std::string &name)
 
virtual bool IsSteerable () const finaloverride
 Specify whether or not this suspension can be steered.
 
virtual bool IsIndependent () const finaloverride
 Specify whether or not this is an independent suspension.
 
virtual void Initialize (std::shared_ptr< ChBodyAuxRef > chassis, const ChVector<> &location, std::shared_ptr< ChBody > tierod_body, int steering_index, double left_ang_vel=0, double right_ang_vel=0) override
 Initialize this suspension subsystem. More...
 
virtual void AddVisualizationAssets (VisualizationType vis) override
 Add visualization assets for the suspension subsystem. More...
 
virtual void RemoveVisualizationAssets () override
 Remove visualization assets for the suspension subsystem.
 
virtual double GetMass () const override
 Get the total mass of the suspension subsystem.
 
std::shared_ptr< ChLinkSpringCBGetSpring (VehicleSide side) const
 Get a handle to the specified spring element.
 
double GetSpringForce (VehicleSide side) const
 Get the force in the spring element.
 
double GetSpringLength (VehicleSide side) const
 Get the current length of the spring element.
 
double GetSpringDeformation (VehicleSide side) const
 Get the current deformation of the spring element.
 
std::shared_ptr< ChLinkSpringCBGetShock (VehicleSide side) const
 Get a handle to the specified shock (damper) element.
 
double GetShockForce (VehicleSide side) const
 Get the force in the shock (damper) element.
 
double GetShockLength (VehicleSide side) const
 Get the current length of the shock (damper) element.
 
double GetShockVelocity (VehicleSide side) const
 Get the current deformation velocity of the shock (damper) element.
 
ChVector Get_LCA_sph_pos (VehicleSide side)
 Global coordinates, LCA ball joint position.
 
virtual void LogConstraintViolations (VehicleSide side) override
 Global coordinates, strut ball joint position. More...
 
virtual std::shared_ptr< ChBodyGetLeftBody () const override
 Specify the left body for a possible antirollbar subsystem. More...
 
virtual std::shared_ptr< ChBodyGetRightBody () const override
 Specify the right body for a possible antirollbar subsystem. More...
 
void LogHardpointLocations (const ChVector<> &ref, bool inches=false)
 Log the locations of all hardpoints. More...
 
- Public Member Functions inherited from chrono::vehicle::ChSuspension
 ChSuspension (const std::string &name)
 
const ChVectorGetLocation () const
 Get the location of the suspension subsystem relative to the chassis reference frame. More...
 
std::shared_ptr< ChBodyGetSpindle (VehicleSide side) const
 Get a handle to the spindle body on the specified side.
 
std::shared_ptr< ChShaftGetAxle (VehicleSide side) const
 Get a handle to the axle shaft on the specified side.
 
std::shared_ptr< ChLinkLockRevoluteGetRevolute (VehicleSide side) const
 Get a handle to the revolute joint on the specified side.
 
const ChVectorGetSpindlePos (VehicleSide side) const
 Get the global location of the spindle on the specified side.
 
const ChQuaternionGetSpindleRot (VehicleSide side) const
 Get the orientation of the spindle body on the specified side. More...
 
const ChVectorGetSpindleLinVel (VehicleSide side) const
 Get the linear velocity of the spindle body on the specified side. More...
 
ChVector GetSpindleAngVel (VehicleSide side) const
 Get the angular velocity of the spindle body on the specified side. More...
 
double GetAxleSpeed (VehicleSide side) const
 Get the angular speed of the axle on the specified side.
 
int GetSteeringIndex () const
 Get the index of the associated steering index (-1 if non-steered).
 
void Synchronize (VehicleSide side, const TireForce &tire_force)
 Update the suspension subsystem: apply the provided tire forces. More...
 
void ApplyAxleTorque (VehicleSide side, double torque)
 Apply the provided motor torque. More...
 
virtual double getSpindleRadius () const =0
 Return the radius of the spindle body (visualization only).
 
virtual double getSpindleWidth () const =0
 Return the width of the spindle body (visualization only).
 
- Public Member Functions inherited from chrono::vehicle::ChPart
 ChPart (const std::string &name)
 Construct a vehicle subsystem with the specified name. More...
 
const std::string & GetName () const
 Get the name identifier for this subsystem.
 
void SetName (const std::string &name)
 Set the name identifier for this subsystem.
 
void SetVisualizationType (VisualizationType vis)
 Set the visualization mode for this subsystem.
 
void SetContactFrictionCoefficient (float friction_coefficient)
 Set coefficient of friction. More...
 
void SetContactRestitutionCoefficient (float restitution_coefficient)
 Set coefficient of restitution. More...
 
void SetContactMaterialProperties (float young_modulus, float poisson_ratio)
 Set contact material properties. More...
 
void SetContactMaterialCoefficients (float kn, float gn, float kt, float gt)
 Set contact material coefficients. More...
 
float GetCoefficientFriction () const
 Get coefficient of friction for contact material.
 
float GetCoefficientRestitution () const
 Get coefficient of restitution for contact material.
 
float GetYoungModulus () const
 Get Young's modulus of elasticity for contact material.
 
float GetPoissonRatio () const
 Get Poisson ratio for contact material.
 
float GetKn () const
 Get normal stiffness coefficient for contact material.
 
float GetKt () const
 Get tangential stiffness coefficient for contact material.
 
float GetGn () const
 Get normal viscous damping coefficient for contact material.
 
float GetGt () const
 Get tangential viscous damping coefficient for contact material.
 

Protected Types

enum  PointId {
  SPINDLE, UPRIGHT, LCA_F, LCA_B,
  LCA_U, LCA_CM, SHOCK_C, SHOCK_U,
  SPRING_C, SPRING_U, TIEROD_C, TIEROD_U,
  NUM_POINTS
}
 Identifiers for the various hardpoints. More...
 

Protected Member Functions

virtual const ChVector getLocation (PointId which)=0
 Return the location of the specified hardpoint. More...
 
virtual double getSpindleMass () const =0
 Return the mass of the spindle body.
 
virtual double getStrutMass () const =0
 Return the mass of the strut body.
 
virtual double getLCAMass () const =0
 Return the mass of the lower control body.
 
virtual double getUprightMass () const =0
 Return the mass of the upright body.
 
virtual const ChVectorgetSpindleInertia () const =0
 Return the moments of inertia of the spindle body.
 
virtual const ChVectorgetStrutInertia () const =0
 Return the moments of inertia of the strut body.
 
virtual const ChVectorgetLCAInertia () const =0
 Return the moments of inertia of the lower control arm body.
 
virtual const ChVectorgetUprightInertia () const =0
 Return the moments of inertia of the upright body.
 
virtual double getAxleInertia () const =0
 Return the inertia of the axle shaft.
 
virtual double getStrutRadius () const =0
 Return the radius of the strut body (visualization only).
 
virtual double getLCARadius () const =0
 Return the radius of the lower control arm body (visualization only).
 
virtual double getUprightRadius () const =0
 Return the radius of the upright body (visualization only).
 
virtual double getSpringRestLength () const =0
 Return the free (rest) length of the spring element.
 
virtual ChLinkSpringCB::ForceFunctorgetSpringForceFunctor () const =0
 Return the functor object for spring force.
 
virtual ChLinkSpringCB::ForceFunctorgetShockForceFunctor () const =0
 Return the functor object for shock force.
 

Protected Attributes

std::shared_ptr< ChBodym_upright [2]
 handles to the upright bodies (left/right)
 
std::shared_ptr< ChBodym_strut [2]
 handles to the upper control arm bodies (left/right)
 
std::shared_ptr< ChBodym_LCA [2]
 handles to the lower control arm bodies (left/right)
 
std::shared_ptr< ChLinkLockCylindricalm_cylindricalStrut [2]
 handles to the strut-LCA cylindrical joints (left/right)
 
std::shared_ptr< ChLinkUniversalm_universalStrut [2]
 handles to the chassis-strut universal joints (left/right)
 
std::shared_ptr< ChLinkLockRevolutem_revoluteLCA [2]
 handles to the chassis-LCA revolute joints (left/right)
 
std::shared_ptr< ChLinkLockSphericalm_sphericalLCA [2]
 handles to the upright-LCA spherical joints (left/right)
 
std::shared_ptr< ChLinkDistancem_distTierod [2]
 handles to the tierod distance constraints (left/right)
 
std::shared_ptr< ChLinkSpringCBm_shock [2]
 handles to the spring links (left/right)
 
std::shared_ptr< ChLinkSpringCBm_spring [2]
 handles to the shock links (left/right)
 
- Protected Attributes inherited from chrono::vehicle::ChSuspension
ChVector m_location
 location relative to chassis
 
int m_steering_index
 index of associated steering mechanism
 
std::shared_ptr< ChBodym_spindle [2]
 handles to spindle bodies
 
std::shared_ptr< ChShaftm_axle [2]
 handles to axle shafts
 
std::shared_ptr< ChShaftsBodym_axle_to_spindle [2]
 handles to spindle-shaft connectors
 
std::shared_ptr< ChLinkLockRevolutem_revolute [2]
 handles to spindle revolute joints
 
- Protected Attributes inherited from chrono::vehicle::ChPart
std::string m_name
 
float m_friction
 contact coefficient of friction
 
float m_restitution
 contact coefficient of restitution
 
float m_young_modulus
 contact material Young modulus
 
float m_poisson_ratio
 contact material Poisson ratio
 
float m_kn
 normal contact stiffness
 
float m_gn
 normal contact damping
 
float m_kt
 tangential contact stiffness
 
float m_gt
 tangential contact damping
 

Additional Inherited Members

- Static Public Member Functions inherited from chrono::vehicle::ChPart
static ChMatrix33 TransformInertiaMatrix (const ChVector<> &moments, const ChVector<> &products, const ChMatrix33<> &vehicle_rot, const ChMatrix33<> &body_rot)
 Utility function for transforming inertia tensors between centroidal frames. More...
 

Constructor & Destructor Documentation

chrono::vehicle::ChMacPhersonStrut::ChMacPhersonStrut ( const std::string &  name)
Parameters
[in]namename of the subsystem

Member Function Documentation

void chrono::vehicle::ChMacPhersonStrut::AddVisualizationAssets ( VisualizationType  vis)
overridevirtual

Add visualization assets for the suspension subsystem.

This default implementation uses primitives.

Reimplemented from chrono::vehicle::ChSuspension.

virtual std::shared_ptr<ChBody> chrono::vehicle::ChMacPhersonStrut::GetLeftBody ( ) const
overridevirtual

Specify the left body for a possible antirollbar subsystem.

Return a handle to the left Lower Control Arm.

Reimplemented from chrono::vehicle::ChSuspension.

virtual const ChVector chrono::vehicle::ChMacPhersonStrut::getLocation ( PointId  which)
protectedpure virtual

Return the location of the specified hardpoint.

The returned location must be expressed in the suspension reference frame.

Implemented in chrono::vehicle::generic::Generic_MacPhersonStrut.

virtual std::shared_ptr<ChBody> chrono::vehicle::ChMacPhersonStrut::GetRightBody ( ) const
overridevirtual

Specify the right body for a possible antirollbar subsystem.

Return a handle to the right Lower Control Arm.

Reimplemented from chrono::vehicle::ChSuspension.

void chrono::vehicle::ChMacPhersonStrut::Initialize ( std::shared_ptr< ChBodyAuxRef chassis,
const ChVector<> &  location,
std::shared_ptr< ChBody tierod_body,
int  steering_index,
double  left_ang_vel = 0,
double  right_ang_vel = 0 
)
overridevirtual

Initialize this suspension subsystem.

The suspension subsystem is initialized by attaching it to the specified chassis body at the specified location (with respect to and expressed in the reference frame of the chassis). It is assumed that the suspension reference frame is always aligned with the chassis reference frame. 'tierod_body' is a handle to the body to which the suspension tierods are to be attached. For a steered suspension, this will be the steering (central) link of a suspension subsystem. Otherwise, this is the chassis. If this suspension is steered, 'steering_index' indicates the index of the associated steering mechanism in the vehicle's list (-1 for a non-steered suspension).

Parameters
[in]chassishandle to the chassis body
[in]locationlocation relative to the chassis frame
[in]tierod_bodybody to which tireods are connected
[in]steering_indexindex of the associated steering mechanism
[in]left_ang_velinitial angular velocity of left wheel
[in]right_ang_velinitial angular velocity of right wheel

Implements chrono::vehicle::ChSuspension.

void chrono::vehicle::ChMacPhersonStrut::LogConstraintViolations ( VehicleSide  side)
overridevirtual

Global coordinates, strut ball joint position.

Log current constraint violations.

Reimplemented from chrono::vehicle::ChSuspension.

void chrono::vehicle::ChMacPhersonStrut::LogHardpointLocations ( const ChVector<> &  ref,
bool  inches = false 
)

Log the locations of all hardpoints.

The reported locations are expressed in the suspension reference frame. By default, these values are reported in SI units (meters), but can be optionally reported in inches.