AGX Dynamics  2.37.3.2
DriveTrainComponents.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agxPowerLine/PowerLine.h>
22 #include <agxDriveTrain/Shaft.h>
23 #include <agxDriveTrain/Gear.h>
24 #include <agxDriveTrain/GearBox.h>
25 
26 #include <agx/Hinge.h>
27 #include <agx/Constraint.h>
28 
29 namespace agxDriveTrain
30 {
31  class Clutch;
32 
33  namespace deprecated
34  {
35 
41  {
42  public:
43  DriveTrainComponent( agxPowerLine::Connector* internalConnector );
44 
49  virtual agxPowerLine::DimensionAndSide getConnectableDimension(
51 
52  virtual void getConnectableDimensionTypes(
54 
55 
56  const agxDriveTrain::Shaft* getOutputShaft( ) const;
57  const agxDriveTrain::Shaft* getInputShaft( ) const;
58 
59  virtual void setInertia( agx::Real inertia ) override;
60  virtual agx::Real getInertia( ) const override;
61 
62  virtual agxPowerLine::Connector* getConnector( );
63 
64  agxPowerLine::RotationalDimension* getRotationalDimension( agxPowerLine::Side side );
65  const agxPowerLine::RotationalDimension* getRotationalDimension( agxPowerLine::Side side ) const;
66 
67  using RotationalUnit::getRotationalDimension;
68 
69 
70  virtual const agxPowerLine::Connector* getConnector( ) const;
71 
75  virtual bool store( agxStream::StorageStream& str ) const override;
76 
80  virtual bool restore( agxStream::StorageStream& str ) override;
81 
82  virtual void getConnectorsRecursive( agxPowerLine::ConnectorPtrVector& connectors ) override;
83  virtual void getUnitsRecursive( agxPowerLine::UnitPtrVector& units ) override;
84 
85  void store( agxStream::OutputArchive& out ) const override;
86  void restore( agxStream::InputArchive& in ) override;
87 
89 
90  protected:
91  void connectInternalConnector( );
92  bool replaceConnector( agxPowerLine::Connector* connector );
93 
94  virtual ~DriveTrainComponent( );
97 
98  };
99 
104  {
105  public:
110 
111  agx::Real getWantedEfficiency( ) const;
112 
113  agx::Real getCurrentEfficiency( ) const;
114 
119  void setMaxMultiplication( agx::Real maxMultiplication );
120 
124  agx::Real getMaxMultiplication( ) const;
125 
130  void setPumpTorqueTable( agx::Vector<std::pair<agx::Real, agx::Real> > const& nu_torques );
131 
135  void setMuTable( agx::Vector<std::pair<agx::Real, agx::Real> > const& nu_to_mu );
136 
140  agx::Real getCurrentMultiplication( ) const;
141 
145  const agxPowerLine::LinearLookupTable* getPumpTorqueTable( ) const;
146  agxPowerLine::LinearLookupTable* getPumpTorqueTable( );
147 
151  const agxPowerLine::LinearLookupTable* getMuTable( ) const;
152 
156  void clearMuTable( );
157 
161  void insertNuMuLookupValue( agx::Real nu, agx::Real mu );
162 
168  void setPumpTorqueReferenceRPM( agx::Real rpm );
169 
173  agx::Real getPumpTorqueReferenceRPM( ) const;
174 
175  // virtual void createConnector();
176 
177 
181  virtual bool store( agxStream::StorageStream& str ) const override;
182 
186  virtual bool restore( agxStream::StorageStream& str ) override;
187 
189  protected:
190 
191  virtual ~TorqueConverterTable( );
192 
194 
195  };
197 
198 
211  {
212  public:
216  FixedGear( );
217 
218  explicit FixedGear( agx::Real ratio );
219 
223  void setGearRatio( agx::Real ratio );
224 
225 
226 
227  agx::Real getGearRatio( ) const;
228 
229  // Removed because we're now passing the correct connector to the DriveTrain-
230  // Component constructor.
231  // void createConnector() override;
232 
233  virtual bool preUpdate( agx::Real timeStep ) override;
234 
238  virtual bool store( agxStream::StorageStream& str ) const override;
239 
243  virtual bool restore( agxStream::StorageStream& str ) override;
244 
246  protected:
247  virtual ~FixedGear( );
249 
250  };
252 
253 
268  {
269  public:
273  GearBox( );
274 
279  GearBox( const agx::RealVector& gears );
280 
284  void setGearRatios( const agx::RealVector& gear_ratios );
285 
289  bool gearUp( );
290  bool gearDown( );
291  bool setGear( int gearIndex );
292 
296  int getGear( ) const;
297 
301  agx::Real getGearRatio( int gearIndex ) const;
302 
303  agx::Real getCurrentGearRatio( ) const;
304 
305  const agxDriveTrain::GearBox* getGearBox( ) const;
306 
310  virtual bool preUpdate( agx::Real timeStep ) override;
311 
315  virtual bool store( agxStream::StorageStream& str ) const override;
316 
320  virtual bool restore( agxStream::StorageStream& str ) override;
321 
323  protected:
324  virtual ~GearBox( );
325  void createBox( const agx::RealVector& gears );
327  };
329 
330 
331 
333  {
334  public:
338  Clutch( );
339 
345  void setEfficiency( agx::Real efficiency );
346 
348  agx::Real getEfficiency( ) const;
349 
350 
361  void setTorqueTransferConstant( agx::Real constant );
362  agx::Real getTorqueTransferConstant( ) const;
363 
368  void setForcedCompliance( agx::Real compliance );
369  agx::Real getForcedCompliance( ) const;
370 
371 
372  agxDriveTrain::Clutch* getClutchConnector( );
373  const agxDriveTrain::Clutch* getClutchConnector( ) const;
374 
375  /*
376  Function that have to be public since it is called by static functions. Do NOT use.
377  */
378 
382  virtual bool store( agxStream::StorageStream& str ) const override;
383 
387  virtual bool restore( agxStream::StorageStream& str ) override;
388 
390 
391  protected:
392  virtual ~Clutch( );
393 
394  protected:
395  // The reference is owned by DriveTrainComponent, a base class of Clutch.
397  };
398 
400  }
401 
402 }
403 
404 
agxDriveTrain::Clutch * m_clutchConnector
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:400
Links two connections together.
Definition: Connector.h:53
Linear interpolation between the inserted variable/value pairs.
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
agx::ref_ptr< FixedGear > FixedGearRef
agxDriveTrain::deprecated::TorqueConverterRef m_torqueConverterConnector
agx::ref_ptr< GearBox > GearBoxRef
Defines a viscous coupling between two rotational dimensions.
Definition: Clutch.h:32
A Shaft is the most basic PowerLine Unit.
Definition: Shaft.h:34
A library of agxPowerLine components designed to model the various parts of a vehicle drive train...
agxDriveTrain::GearBoxRef m_gearBoxConnector
The gear box can have an arbitrary number of gears.
Definition: GearBox.h:29
Templated vector class.
Definition: Vector.h:52
The gear box can have an arbitrary number of gears.
The rotational has one rotational degree of freedom.
agx::ref_ptr< TorqueConverterTable > TorqueConverterTableRef
A DriveTrainComponent is a Shaft that comes with a Connector and an input shaft.
The gear box can have an arbitrary number of gears.
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
Base Torque converter for an automatic transmission.
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
std::pair< agxPowerLine::PhysicalDimension *, agxPowerLine::Side > DimensionAndSide
#define AGXMODEL_EXPORT
agx::ref_ptr< Clutch > ClutchRef
double Real
Definition: Real.h:42