AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxDriveTrain::Brake Class Reference

#include <Brake.h>

+ Inheritance diagram for agxDriveTrain::Brake:

Public Member Functions

 Brake ()
 This model represents a brake system with dry friction between a brake pad and a rotational plate.
 
agxDriveTrain::VelocityConstraint * getConstraint ()
 
const agxDriveTrain::VelocityConstraint * getConstraint () const
 
agx::Real getDisengageTimeConstant () const
 
agx::Real getEngageTimeConstant () const
 
agx::Real getFraction () const
 
agx::Real getInputVelocity () const
 
agx::Real getMinRelativeSlip () const
 
agx::Real getTorque () const
 
agx::Real getTorqueCapacity () const
 
bool isAutoLock () const
 
bool isEngaged () const
 
bool isLocked () const
 Returns the lock status.
 
bool isManualMode () const
 
void setAutoLock (bool autoLock)
 In auto lock mode, the friction plates will lock when the slip is small enough.
 
void setDisengageTimeConstant (agx::Real tau)
 Set the time constant for brake disengagement.
 
void setEngage (bool engage)
 Puts the brake pedal in assisted mode so it will fully engage or disengage in a time period determined by setTimeConstant below.
 
void setEngageTimeConstant (agx::Real tau)
 Set the time constant for the brake engagement.
 
void setFraction (agx::Real fraction)
 
void setLock (bool setLock)
 Lock or unlock the brake.
 
void setManualMode (bool manual)
 When manual mode is true, user must control all aspects of the brake engagement and disengagement.
 
void setMinRelativeSlip (agx::Real minRelativeSlip)
 In autolock mode, the friction plates will lock with the ratio of slip is less than this threshold.
 
void setTorqueCapacity (agx::Real capacity)
 This is the maximum torque that the brake plates can transfer: it will slip if this MinRelativeSlip is exceeded.
 
- Public Member Functions inherited from agxDriveTrain::Shaft
 Shaft ()
 Create a shaft.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxDriveTrain::Shaft)
 
agx::Real getAccumulatedAngle () const
 
virtual bool postUpdate (agx::Real timeStep) override
 Post update will update the accumulated angle.
 
virtual bool preUpdate (agx::Real timeStep) override
 Functions called by a static function.
 
virtual bool restore (agxStream::StorageStream &str) override
 Restores internal data from stream.
 
void setAccumulatedAngle (agx::Real angle)
 Set the accumulated shaft angle in radians.
 
virtual bool store (agxStream::StorageStream &str) const override
 Stores internal data into stream.
 
- Public Member Functions inherited from agxPowerLine::RotationalUnit
 RotationalUnit ()
 Create a rotational unit.
 
 RotationalUnit (agx::RigidBody *body, agx::UInt8 slot)
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxPowerLine::RotationalUnit)
 
agx::Real getAngle () const
 
agx::Real getAngularVelocity () const
 returns the number of radians per second
 
virtual agx::Real getDeliveredTorque () const
 returns the amount of torque delivered from the rotational dimension
 
virtual agx::Vec3 getDirection () const
 returns a vector in world coordinates that defines the rotational axis of the rotational unit.
 
virtual agx::Real getInertia () const
 
agxPowerLine::RotationalDimension * getRotationalDimension () const
 returns a pointer to the rotational dimension
 
agx::Real getRPM () const
 returns the number of revolutions per minute
 
virtual bool postUpdate (agx::Real timeStep) override
 
virtual bool preUpdate (agx::Real timeStep) override
 
virtual bool restore (agxStream::StorageStream &str) override
 Restores internal data from stream.
 
void setAngularVelocityDamping (agx::Real damping)
 set the angular velocity damping around the local axis (direction)
 
virtual void setInertia (agx::Real inertia)
 set the inertia for the rotational dimension of the rotational unit.
 
virtual bool store (agxStream::StorageStream &str) const override
 Stores internal data into stream.
 
- Public Member Functions inherited from agxPowerLine::Unit
 Unit ()
 Constructor.
 
void addNotification (agxPowerLine::PowerLine *powerLine)
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxPowerLine::Unit)
 
void attach (agx::RigidBody *body)
 Define which body in the simulation this Unit is attached to.
 
agx::String buildDimensionsName () const
 
virtual bool connect (agxPowerLine::Connector *connector)
 Connect the unit to a connector.
 
virtual bool connect (agxPowerLine::Side mySide, agxPowerLine::Side connectorSide, agxPowerLine::Connector *connector)
 Connect the unit to a connector, specifying the side of each.
 
virtual bool connect (agxPowerLine::Side mySide, agxPowerLine::Side otherSide, agxPowerLine::Unit *other)
 
virtual bool connect (agxPowerLine::Unit *otherUnit)
 Connect the unit to another unit.
 
virtual bool disconnect (agxPowerLine::Unit *unit)
 
void disconnectAll ()
 
agxPowerLine::PhysicalDimension * getActiveDimension (size_t index)
 
const agxPowerLine::PhysicalDimension * getActiveDimension (size_t index) const
 
virtual agxPowerLine::DimensionAndSide getConnectableDimension (agxPowerLine::PhysicalDimension::Type type, agxPowerLine::Side side)
 
virtual void getConnectableDimensionTypes (agxPowerLine::PhysicalDimension::TypeVector &types, agxPowerLine::Side side) const
 
agxPowerLine::PhysicalDimension * getConnectableInputDimension (agxPowerLine::PhysicalDimension::Type type)
 
agxPowerLine::PhysicalDimension * getConnectableOutputDimension (agxPowerLine::PhysicalDimension::Type type)
 
void getConnectedUnits (UnitPtrSetVector &result, agxPowerLine::Side side)
 
size_t getConnectors (agxPowerLine::ConnectorPtrVector &result) const
 
size_t getConnectors (const agxPowerLine::Unit *unit, agxPowerLine::ConnectorPtrVector &result)
 Append all connectors connecting this Unit to the given Unit to the 'result' Vector.
 
agxPowerLine::PhysicalDimension * getDimension (agxPowerLine::PhysicalDimension::Type type)
 
const agxPowerLine::PhysicalDimension * getDimension (agxPowerLine::PhysicalDimension::Type type) const
 
agxPowerLine::PhysicalDimensionRefVector & getDimensions ()
 
const agxPowerLine::PhysicalDimensionRefVector & getDimensions () const
 
Connector * getFirstInputConnector (const agxPowerLine::Unit *unit) const
 
Connector * getFirstOutputConnector (const agxPowerLine::Unit *unit) const
 
bool getIgnoreForStoreRestoreStream () const
 
size_t getInputConnectors (agxPowerLine::ConnectorPtrVector &result) const
 
size_t getInputConnectors (const agxPowerLine::Unit *unit, agxPowerLine::ConnectorPtrVector &result)
 
size_t getNumActiveDimensions () const
 The number of non-null PhysicalDimension in this Unit, not including internal Units.
 
virtual size_t getNumConnectableDimensions (Side side) const
 
size_t getNumConnections () const
 
size_t getOutputConnectors (agxPowerLine::ConnectorPtrVector &result) const
 
size_t getOutputConnectors (const agxPowerLine::Unit *unit, agxPowerLine::ConnectorPtrVector &result)
 
void getOwnConnectedUnits (UnitPtrSetVector &unitSet, agxPowerLine::Side side, bool startFromCleanUnitSet=true) const
 
void getOwnConnectedUnits (UnitPtrSetVector &unitSet, bool startFromCleanUnitSet=true) const
 Constructs the set of Units connected to this Unit's own dimensions.
 
agxPowerLine::PowerLine * getPowerLine () const
 
agxPowerLine::Unit * getRoot () const
 
agxPowerLine::Side getSide (const Connector *connector) const
 
bool hasConnector (const Connector *connector) const
 
virtual bool isConnected (agxPowerLine::Unit *otherUnit) const
 
virtual bool isValid () const
 
virtual bool postRestore (agxStream::StorageStream &str)
 
virtual bool postStore (agxStream::StorageStream &str) const
 
void removeNotification (agxPowerLine::PowerLine *powerLine)
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &str) override
 Restores internal data from stream.
 
void setRoot (agxPowerLine::Unit *root)
 
void spreadRootToGraph ()
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &str) const override
 Stores internal data into stream.
 
virtual bool vetoConnect (agxPowerLine::Connector *connector) const
 
- Public Member Functions inherited from agxPowerLine::SubGraph
 SubGraph ()
 
virtual bool addNotification (agxSDK::Simulation *simulation)=0
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxPowerLine::SubGraph)
 
virtual void getConnectorsRecursive (ConnectorPtrVector &connectors)
 Fill the given vector with the Connectors that are held by this SubGraph.
 
Connector * getEnclosingConnector ()
 
const Connector * getEnclosingConnector () const
 
SubGraph * getEnclosingGraph ()
 
const SubGraph * getEnclosingGraph () const
 
Unit * getEnclosingUnit ()
 
const Unit * getEnclosingUnit () const
 
const agxPowerLine::ConnectorRefVector & getInternalConnectors () const
 
const agxPowerLine::UnitRefVector & getInternalUnits () const
 
const agx::Name & getName () const
 
SubGraph * getRootEnclosingGraph ()
 
const SubGraph * getRootEnclosingGraph () const
 
virtual void getUnitsRecursive (UnitPtrVector &units)
 Fill the given vector with the Units that are held by this SubGraph.
 
bool isEnclosedWithin (const SubGraph *component) const
 
virtual bool postUpdate (agx::Real timeStep)
 
virtual void prepareForRestore ()
 
virtual void prepareForStore ()
 
virtual bool preUpdate (agx::Real timeStep)
 
virtual bool removeNotification (agxUtil::ConstraintHolder *holder, agxSDK::Simulation *simulation)=0
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &str)
 Restores internal data from stream.
 
void setName (const agx::Name &name)
 Set the name of this power line component.
 
void spreadPowerLineToGraph ()
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &str) const
 Stores internal data into stream.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Protected Member Functions

virtual ~Brake ()
 
- Protected Member Functions inherited from agxDriveTrain::Shaft
virtual ~Shaft ()
 
- Protected Member Functions inherited from agxPowerLine::RotationalUnit
virtual ~RotationalUnit ()
 
- Protected Member Functions inherited from agxPowerLine::Unit
virtual ~Unit ()
 
bool activateDimension (PhysicalDimension *dimension)
 
virtual bool hasValidInputConnection () const
 returns if it is possible to connect to this unit
 
void restorePre46 (agxStream::InputArchive &in)
 
void setPowerLine (PowerLine *powerLine)
 Point to the power line the unit is a part of.
 
- Protected Member Functions inherited from agxPowerLine::SubGraph
virtual ~SubGraph ()
 
void addInternalConnector (agxPowerLine::Connector *connector)
 
void addInternalUnit (agxPowerLine::Unit *unit)
 
void removeInternalConnector (agxPowerLine::Connector *connector)
 
void removeInternalUnit (agxPowerLine::Unit *unit)
 
agx::Bool replaceInternalUnit (agxPowerLine::Unit *oldUnit, agxPowerLine::Unit *newUnit)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

agx::Real m_disengageTimeConstant
 
agx::Real m_engageTimeConstant
 
agx::Real m_fraction
 
bool m_isAutoLock
 
bool m_isEngaged
 
bool m_isLocked
 
bool m_isManual
 
agx::Real m_minRelativeSlip
 
agx::Real m_torqueCapacity
 
agxDriveTrain::VelocityConstraintRef m_velocityConstraint
 
- Protected Attributes inherited from agxDriveTrain::Shaft
agx::Real m_accumulatedAngle
 
- Protected Attributes inherited from agxPowerLine::RotationalUnit
RotationalDimensionRef m_rotationalDimension
 
- Protected Attributes inherited from agxPowerLine::Unit
agx::observer_ptr< agx::RigidBody > m_attachBody
 
PhysicalDimensionRefVector m_dimensions
 
bool m_ignoreMeForStoreRestoreStream
 
agxPowerLine::Unit * m_rootUnit
 
- Protected Attributes inherited from agxPowerLine::SubGraph
SubGraphObserver m_enclosingGraph
 
ConnectorRefVector m_internalConnectors
 
UnitRefVector m_internalUnits
 
agx::Name m_name
 
PowerLine * m_powerLine
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agxDriveTrain::Shaft
static agxStream::Serializable * create (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agxPowerLine::RotationalUnit
static agx::Real convertAngularVelocityToRPM (const agx::Real angVel)
 Convert between m/s and rpm.
 
static agx::Real convertRPMtoAngularVelocity (const agx::Real rpm)
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Definition at line 27 of file Brake.h.

Constructor & Destructor Documentation

◆ Brake()

agxDriveTrain::Brake::Brake ( )

This model represents a brake system with dry friction between a brake pad and a rotational plate.

The input shaft is connected to the rotating plate, while the brake pad is fixed but can be moved closer to or further from the plate using a spring-loaded mechanism. This mechanism applies a normal force that increases as the pad moves closer to the plate, creating the concept of braking torque capacity.

When the brake pad is fully disengaged, no force is applied to the plate, resulting in no braking. When the pad is fully engaged, maximum normal force is applied to the plate, generating maximum braking torque.

The "engagement fraction" here represents the proportion of the applied braking force relative to the maximum torque capacity. A value of 1 indicates full engagement (maximum braking force), while 0 represents no braking force.

Similar to the dry clutch, the brake model includes a "locked" mode, where a clamp is activated to prevent the plate from rotating. The lock remains engaged until the brake is disengaged or if external forces cause the plate to rotate in the opposite direction, as with dynamic braking scenarios. This "locked" mode functions as a "parking brake".

This brake model has two operational modes: manual and automatic. In manual mode, the user directly controls the engagement fraction or activates the lock mechanism using a control algorithm and step event listener. The brake pedal can be engaged or disengaged manually by the user.

In automatic mode, the engagement is handled by a time constant, which dictates the transition between fully disengaged (no braking) and fully engaged (maximum braking). The function "engage" controls the increase or decrease in braking force. If the auto lock mode is active, logic determines when to engage or disengage the lock based on slip velocity. If the slip velocity is sufficiently small compared to the input shaft velocity, the lock is engaged. The lock is disengaged if either the function "engage(false)" is called or if the brake torque becomes negative, indicating dynamic braking.

Automatic engagement causes the engagement fraction to increase linearly from the moment "engage(true)" is called, or decrease linearly from the moment "engage(false)" is called.

For this model, we assume that the brake pad behaves like a linear spring, so the normal force is directly proportional to the pad's position relative to the plate.

◆ ~Brake()

virtual agxDriveTrain::Brake::~Brake ( )
protectedvirtual

Member Function Documentation

◆ getConstraint() [1/2]

agxDriveTrain::VelocityConstraint * agxDriveTrain::Brake::getConstraint ( )
Returns
The VelocityConstraint of the brake.

◆ getConstraint() [2/2]

const agxDriveTrain::VelocityConstraint * agxDriveTrain::Brake::getConstraint ( ) const
Returns
The VelocityConstraint of the brake.

◆ getDisengageTimeConstant()

agx::Real agxDriveTrain::Brake::getDisengageTimeConstant ( ) const
Returns
- Returns the time constant of the brake for disengaging.

◆ getEngageTimeConstant()

agx::Real agxDriveTrain::Brake::getEngageTimeConstant ( ) const
Returns
- Returns the time constant of the brake for engaging.

◆ getFraction()

agx::Real agxDriveTrain::Brake::getFraction ( ) const
Returns
- Returns the fraction of the brake pedal opening (fraction of maximum normal force betwen the friction plates).

◆ getInputVelocity()

agx::Real agxDriveTrain::Brake::getInputVelocity ( ) const
Returns
- Angular velocity of input shaft.

◆ getMinRelativeSlip()

agx::Real agxDriveTrain::Brake::getMinRelativeSlip ( ) const
Returns
- Minimum relative velocity for lock.

◆ getTorque()

agx::Real agxDriveTrain::Brake::getTorque ( ) const
Returns
- Torque transferred between the friction plates.

◆ getTorqueCapacity()

agx::Real agxDriveTrain::Brake::getTorqueCapacity ( ) const
Returns
- Returns the torque capacity of the brake.

◆ isAutoLock()

bool agxDriveTrain::Brake::isAutoLock ( ) const
Returns
- State of auto lock.

◆ isEngaged()

bool agxDriveTrain::Brake::isEngaged ( ) const
Returns
- Returns whether the brake is engaged or not.

◆ isLocked()

bool agxDriveTrain::Brake::isLocked ( ) const

Returns the lock status.

◆ isManualMode()

bool agxDriveTrain::Brake::isManualMode ( ) const
Returns
- Returns true in manual mode, false otherwise.

◆ setAutoLock()

void agxDriveTrain::Brake::setAutoLock ( bool  autoLock)

In auto lock mode, the friction plates will lock when the slip is small enough.

Parameters
autoLock- true or false to enable or disable autoLock, respectively (Default: False).

◆ setDisengageTimeConstant()

void agxDriveTrain::Brake::setDisengageTimeConstant ( agx::Real  tau)

Set the time constant for brake disengagement.

Disengagement is linear and proceeds by a fraction of +/- step/tau per step. The default time constant is in seconds.

Parameters
tau- the time constant. The unit of tau is the same as the unit of time step size defined by the user (Default: 1.0).

◆ setEngage()

void agxDriveTrain::Brake::setEngage ( bool  engage)

Puts the brake pedal in assisted mode so it will fully engage or disengage in a time period determined by setTimeConstant below.

Using setEngage(true) will turn manual mode to false as per the rule: respect the users's intention.

Parameters
engage- true to engage, false to disengage from current fraction (Default: False).

◆ setEngageTimeConstant()

void agxDriveTrain::Brake::setEngageTimeConstant ( agx::Real  tau)

Set the time constant for the brake engagement.

Engagement is linear and proceeds by a fraction of +/- step/tau per step. The default time constant is in seconds.

Parameters
tau- the time constant. The unit of tau is the same as the unit of time step size defined by the user (Default: 2.5).

◆ setFraction()

void agxDriveTrain::Brake::setFraction ( agx::Real  fraction)
Parameters
fraction- Set the fraction of the brake pedal opening in range [0,1] (Default: 0.0).

◆ setLock()

void agxDriveTrain::Brake::setLock ( bool  setLock)

Lock or unlock the brake.

In locked mode, it will behave as a parking brake.

Parameters
setLock- desired state (Default: False).

◆ setManualMode()

void agxDriveTrain::Brake::setManualMode ( bool  manual)

When manual mode is true, user must control all aspects of the brake engagement and disengagement.

Using the engage method will turn this flag to false.

Parameters
manual- Set or unset manual mode (Default: False).

◆ setMinRelativeSlip()

void agxDriveTrain::Brake::setMinRelativeSlip ( agx::Real  minRelativeSlip)

In autolock mode, the friction plates will lock with the ratio of slip is less than this threshold.

Parameters
minRelativeSlip- the threshold of the minimum slip (Default: 1e-5).

◆ setTorqueCapacity()

void agxDriveTrain::Brake::setTorqueCapacity ( agx::Real  capacity)

This is the maximum torque that the brake plates can transfer: it will slip if this MinRelativeSlip is exceeded.

Set the torque capacity directly here (Default: 2000).

Member Data Documentation

◆ m_disengageTimeConstant

agx::Real agxDriveTrain::Brake::m_disengageTimeConstant
protected

Definition at line 244 of file Brake.h.

◆ m_engageTimeConstant

agx::Real agxDriveTrain::Brake::m_engageTimeConstant
protected

Definition at line 243 of file Brake.h.

◆ m_fraction

agx::Real agxDriveTrain::Brake::m_fraction
protected

Definition at line 246 of file Brake.h.

◆ m_isAutoLock

bool agxDriveTrain::Brake::m_isAutoLock
protected

Definition at line 241 of file Brake.h.

◆ m_isEngaged

bool agxDriveTrain::Brake::m_isEngaged
protected

Definition at line 240 of file Brake.h.

◆ m_isLocked

bool agxDriveTrain::Brake::m_isLocked
protected

Definition at line 247 of file Brake.h.

◆ m_isManual

bool agxDriveTrain::Brake::m_isManual
protected

Definition at line 242 of file Brake.h.

◆ m_minRelativeSlip

agx::Real agxDriveTrain::Brake::m_minRelativeSlip
protected

Definition at line 245 of file Brake.h.

◆ m_torqueCapacity

agx::Real agxDriveTrain::Brake::m_torqueCapacity
protected

Definition at line 239 of file Brake.h.

◆ m_velocityConstraint

agxDriveTrain::VelocityConstraintRef agxDriveTrain::Brake::m_velocityConstraint
protected

Definition at line 238 of file Brake.h.


The documentation for this class was generated from the following file: