AGX Dynamics  2.37.2.0
ElectricMotor.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
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a 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 <agxModel/export.h>
20 
23 
24 namespace agxDriveTrain
25 {
33  {
34  public:
42  ElectricMotor(agx::Real resistance, agx::Real torqueConstant, agx::Real emfConstant, agx::Real inductance);
43 
48  void setVoltage(agx::Real voltage);
52  agx::Real getVoltage() const;
53 
57  void setResistance(agx::Real resistance);
61  agx::Real getResistance() const;
62 
67  void setTorqueConstant(agx::Real torqueConstant);
71  agx::Real getTorqueConstant() const;
72 
77  void setEmfConstant(agx::Real emfConstant);
78  agx::Real getEmfConstant() const;
79 
84  void setInductance(agx::Real inductance);
88  agx::Real getInductance() const;
89 
93  agx::Real getCurrent() const;
97  agx::Real getEmfVoltage() const;
98 
102  const agxDriveTrain::ElectricMotorConstraint* getConstraint() const;
103 
104  public:
106  virtual bool addNotification(agxSDK::Simulation* simulation) override;
108  virtual bool removeNotification(agxUtil::ConstraintHolder* constraintHolder, agxSDK::Simulation* simulation) override;
109 
111  virtual bool preUpdate(agx::Real timeStep) override;
112 
114  virtual bool store(agxStream::StorageStream& str) const override;
116  virtual bool postStore(agxStream::StorageStream& str) const override;
117 
119  virtual bool restore(agxStream::StorageStream& str) override;
121  virtual bool postRestore(agxStream::StorageStream& str) override;
122 
124 
125  protected:
126  ElectricMotor() = default;
127 
129  virtual ~ElectricMotor();
130 
131  private:
132  agx::Real m_resistance;
133  agx::Real m_torqueConstant;
134  agx::Real m_emfConstant;
135  agx::Real m_inductance;
136  agx::Real m_voltage;
137 
139  };
140 
142 }
143 
144 
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:463
A rotational unit has one degree of freedom.
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
A library of agxPowerLine components designed to model the various parts of a vehicle drive train...
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
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
An electric motor is a roational unit that is a source of power in a drive train. ...
Definition: ElectricMotor.h:32
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42