Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::TrackJointFeederMotorModel Class Reference

Class with functionality to support a track joint on a track system. Provides a model for friction, brake and drive. More...

#include <C:/Trend/Development/Trax3/Code/trax/rigid/TrackJointFeeder.h>

Inheritance diagram for trax::TrackJointFeederMotorModel:

Public Member Functions

 TrackJointFeederMotorModel (Real engine_meters_per_unit, Real engine_kilograms_per_unit)
bool dclspc Update (Time dt) override
 Simulation update method, to be called, after a simulation step is finished.
void dclspc TargetVelocity (Velocity vTarget) noexcept
 Sets the target velocity to aim for by using the supplied Thrust() and Brake() settings.
Velocity dclspc TargetVelocity () const noexcept
 Gets the target velocity set for this RailRunner.
Power dclspc MaximumPowerOutput () const noexcept
Power dclspc CurrentPowerOutput () const noexcept
Velocity dclspc MaximumVelocity () const noexcept
void dclspc Thrust (One byfactor) noexcept
 Sets the fraction of the maximum thrust to apply in order to reach the target velocity specified by TargetVelocity().
One dclspc Thrust () const noexcept
 Gets the fraction of the maximum thrust applied.
void dclspc ThrustAbsolute (Force thrust) noexcept
 Sets the thrust as absolute force values. If the value exceeds MaxThrust() it get clipped.
Force dclspc ThrustAbsolute () const noexcept
 Gets the thrust as absolute momentary force value.
void dclspc Brake (One byfactor) noexcept
 Sets the fraction of the maximum braking to apply in order
to reach a zero velocity.
One dclspc Brake () const noexcept
 Gets the fraction of the maximum braking applied.
void dclspc BrakeAbsolute (Force brake) noexcept
 Sets the brake as absolute force value. If the value exceeds MaxBrake() it gets clipped.
Force dclspc BrakeAbsolute () const noexcept
 Gets the brake as absolute force value.
Force dclspc MaxBrake () const noexcept
 Gets the maximal available braking. This value is determined by the properties of the Wheelsets attached to WheelFrames wich in turn are attached to a bogie.
void dclspc SetTractionForceCharacteristic (std::shared_ptr< const struct TractionForceCharacteristic > pCharacteristic)
 applies a TractionForceCharacteristic to the thrust calculations.
std::shared_ptr< const TractionForceCharacteristic > dclspc GetTractionForceCharacteristic () const noexcept
int dclspc Attach (const Wheelset &ws)
 Attaches a Wheelset to this WheelFrame.
void dclspc DetachAllWheelsets () noexcept
 Removes all the Wheelsets.
int dclspc CntWheelsets () const
 Gets the number of Wheelsets attached directly to this WheelFrame.
dclspc const WheelsetGetWheelset (int idx) const
 Gets the Wheelset denoted by idx.
dclspc JackJackOnMotorActive () noexcept
 Gets a Jack that pulses its Plug if the Feeder's motor gets activated in order to reach the target velocity.
dclspc JackJackOnMotorInactive () noexcept
 Gets a Jack that pulses its Plug if the Feeder's motor gets deactivated.
dclspc JackJackOnBrakeActive () noexcept
 Gets a Jack that pulses its Plug if the Feeder's brake gets activated in order to reach the target velocity.
dclspc JackJackOnBrakeInactive () noexcept
 Gets a Jack that pulses its Plug if the Feeder's brake gets deactivated.
Maximum Thrust

Gets the maximal available thrust. This value is determined by the properties of the Wheelsets attached to WheelFrames, wich in turn are attached to a bogie. It is also determined by the engine characteristic and the actual velocity.

Parameters
velocitythe velocity the maximum thrust is requested for.
Force dclspc MaxThrust () const noexcept
Force dclspc MaxThrust (Velocity velocity) const noexcept
Public Member Functions inherited from trax::TrackJointFeeder
dclspc TrackJointFeeder (Real engine_meters_per_unit, Real engine_kilograms_per_unit) noexcept
bool dclspc Rail (std::shared_ptr< const Track > pTrack, const TrackLocation &tl, bool doPulse=true)
bool dclspc Rail (const Location &location, bool doPulse=true)
void dclspc DeRail (bool doPulse=true)
bool dclspc IsRailed () const noexcept
bool dclspc IsMovableBodySleeping () const noexcept
void dclspc WakeUp () noexcept
void dclspc SetVelocity (Velocity velocity)
Velocity dclspc GetVelocity () const noexcept
dclspc const LocationGetLocation () const noexcept
virtual void SetLimits (const TrackJointLimits &wfl)=0
virtual void SetMotorForceLimits (Force min, Force max) noexcept=0
virtual void SetMotorTarget (Velocity) noexcept=0
virtual Velocity GetMotorTarget () noexcept=0
virtual spat::Frame< Length, OneGlobalAnchor () const =0
 Gets the anchor in global coordinates.
virtual spat::Frame< Length, OneAnchor () const noexcept=0
 Gets the anchor in local coordinates.
virtual void Anchor (const spat::Frame< Length, One > &frame)=0
 Sets the anchor in local coordinates.
dclspc std::shared_ptr< EventAttachEvent (std::shared_ptr< Event > pEvent) noexcept
 Attaches the sensor event to this TrackJointFeeder.
dclspc std::shared_ptr< SignalTargetAttachSignal (std::shared_ptr< SignalTarget > pSignalTarget) noexcept
 Attaches the signal target to this TrackJointFeeder.
dclspc JackJackOnRail () noexcept
 Gets a Jack that pulses its Plug if the WheelFrame gets railed on a track.
dclspc JackJackOnDerail () noexcept
 Gets a Jack that pulses its Plug if the WheelFrame derails.
dclspc JackJackOnRollingStart () noexcept
 Gets a Jack that pulses its Plug if the WheelFrame starts to roll.
dclspc JackJackOnRollingStop () noexcept
 Gets a Jack that pulses its Plug if the WheelFrame stops to roll.
dclspc JackJackOnStartTilting () noexcept
 Gets a Jack that pulses its Plug if the WheelFrame starts tilting.
dclspc JackJackOnStopTilting () noexcept
 Gets a Jack that pulses its Plug if the WheelFrame starts tilting.
dclspc JackJackOnTrackTransition () noexcept
 Gets a Jack that pulses its Plug if the WheelFrame passes the connection between two tracks.
Real EngineMetersPerUnit () const noexcept
Real EngineKilogramsPerUnit () const noexcept

Protected Member Functions

std::pair< Length, bool > MoveBy (Length ds) override
Protected Member Functions inherited from trax::TrackJointFeeder
virtual void TurnAnchor () const =0
virtual void TrackBodyChange (std::shared_ptr< const Body > pToBody)=0
virtual void SetTimeStep (Time dt)=0
virtual void UpdateBodies () const =0
virtual bool SetValues (const TrackData< Real > &trackData)=0
virtual bool DoIsMovableBodySleeping () const noexcept=0
virtual void DoWakeUp () const =0
virtual void DoRail ()=0
virtual void DoDerail ()=0

Detailed Description

Class with functionality to support a track joint on a track system. Provides a model for friction, brake and drive.

Member Function Documentation

◆ Attach()

int dclspc trax::TrackJointFeederMotorModel::Attach ( const Wheelset & ws)

Attaches a Wheelset to this WheelFrame.

Returns
The index of the attached Wheelset.

◆ Brake() [1/2]

One dclspc trax::TrackJointFeederMotorModel::Brake ( ) const
noexcept

Gets the fraction of the maximum braking applied.

Returns
Value between [0,1], specifying the fraction of the
total available braking.

◆ Brake() [2/2]

void dclspc trax::TrackJointFeederMotorModel::Brake ( One byfactor)
noexcept

Sets the fraction of the maximum braking to apply in order
to reach a zero velocity.

Parameters
byfactorValue between [0,1] specifying the fraction of the total available braking.

◆ CurrentPowerOutput()

Power dclspc trax::TrackJointFeederMotorModel::CurrentPowerOutput ( ) const
noexcept
Returns
The power output the engine is currently delivering.

◆ GetTractionForceCharacteristic()

std::shared_ptr< const TractionForceCharacteristic > dclspc trax::TrackJointFeederMotorModel::GetTractionForceCharacteristic ( ) const
noexcept
Returns
A pointer to the actually applied characteristic

◆ GetWheelset()

dclspc const Wheelset & trax::TrackJointFeederMotorModel::GetWheelset ( int idx) const

Gets the Wheelset denoted by idx.

Parameters
idxIndex of the Wheelset 0 <= idx < CntWheelsets()

◆ MaximumPowerOutput()

Power dclspc trax::TrackJointFeederMotorModel::MaximumPowerOutput ( ) const
noexcept
Returns
The maximal power output the engine can supply.

◆ MaximumVelocity()

Velocity dclspc trax::TrackJointFeederMotorModel::MaximumVelocity ( ) const
noexcept
Returns
The maximum velocity the RailRunner can theoretically propell itself to on even track.

◆ MoveBy()

std::pair< Length, bool > trax::TrackJointFeederMotorModel::MoveBy ( Length ds)
overrideprotectedvirtual

Reimplemented from trax::TrackJointFeeder.

◆ SetTractionForceCharacteristic()

void dclspc trax::TrackJointFeederMotorModel::SetTractionForceCharacteristic ( std::shared_ptr< const struct TractionForceCharacteristic > pCharacteristic)

applies a TractionForceCharacteristic to the thrust calculations.

The default is a characteristic wich will allways be 1.

Parameters
pCharacteristicPointer to functor.

◆ TargetVelocity()

void dclspc trax::TrackJointFeederMotorModel::TargetVelocity ( Velocity vTarget)
noexcept

Sets the target velocity to aim for by using the supplied Thrust() and Brake() settings.

The simulator will try to reach this by applying up to the fraction of maximum thrust, specified by Thrust() and up to the fraction of maximum braking force specified by Brake() if necessary to reduce the actual velocity. The brake will only be used, if the velocity exceeds the target velocity. E.g. on a hill the RailRunner might roll back due to too few thrust but the brake will not get applied in this case. These values will get propagated to all the child bogies.

Parameters
vTargetSigned target velocity to aim for. This very well might be set to extreme high values, wich can never be reached by the motor.

◆ Thrust() [1/2]

One dclspc trax::TrackJointFeederMotorModel::Thrust ( ) const
noexcept

Gets the fraction of the maximum thrust applied.

Returns
Value between [0,1], specifying the fraction of the total available thrust.

◆ Thrust() [2/2]

void dclspc trax::TrackJointFeederMotorModel::Thrust ( One byfactor)
noexcept

Sets the fraction of the maximum thrust to apply in order to reach the target velocity specified by TargetVelocity().

Parameters
byfactorValue between [0,1] specifying the fraction of the total available acceleration.

◆ Update()

bool dclspc trax::TrackJointFeederMotorModel::Update ( Time dt)
overridevirtual

Simulation update method, to be called, after a simulation step is finished.

Reimplemented from trax::TrackJointFeeder.


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