AGX Dynamics  2.35.0.1
ElectricMotor.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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);
53 
57  void setResistance(agx::Real resistance);
62 
67  void setTorqueConstant(agx::Real torqueConstant);
72 
77  void setEmfConstant(agx::Real emfConstant);
79 
84  void setInductance(agx::Real inductance);
89 
98 
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 
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXMODEL_EXPORT
An electric motor is a roational unit that is a source of power in a drive train.
Definition: ElectricMotor.h:33
void setInductance(agx::Real inductance)
Set the inductance of the motor.
agx::Real getTorqueConstant() const
agx::Real getResistance() const
agx::Real getCurrent() const
void setVoltage(agx::Real voltage)
Set the input voltage to the electrical motor.
virtual bool postStore(agxStream::StorageStream &str) const override
void setResistance(agx::Real resistance)
Set the electrical reistance of the motor.
void setTorqueConstant(agx::Real torqueConstant)
Set the torque constant of the motor.
virtual bool postRestore(agxStream::StorageStream &str) override
virtual bool addNotification(agxSDK::Simulation *simulation) override
ElectricMotor(agx::Real resistance, agx::Real torqueConstant, agx::Real emfConstant, agx::Real inductance)
Create an electrical motor with the properties of the given parameters.
const agxDriveTrain::ElectricMotorConstraint * getConstraint() const
agx::Real getEmfConstant() const
void setEmfConstant(agx::Real emfConstant)
Set the back electromotive force constant.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual bool removeNotification(agxUtil::ConstraintHolder *constraintHolder, agxSDK::Simulation *simulation) override
agx::Real getEmfVoltage() const
agx::Real getInductance() const
virtual bool preUpdate(agx::Real timeStep) override
agx::Real getVoltage() const
/return The current input voltage of the motor.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
A rotational unit has one degree of freedom.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:464
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
double Real
Definition: Real.h:42