AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
ElectricMotor.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or
9having been advised so by Algoryx Simulation AB for a time limited evaluation,
10or having purchased a valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agxModel/export.h>
20
23
24namespace 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);
49
54
58 void setResistance(agx::Real resistance);
63
68 void setTorqueConstant(agx::Real torqueConstant);
73
78 void setEmfConstant(agx::Real emfConstant);
80
85 void setInductance(agx::Real inductance);
90
99
104
105 public:
107 virtual bool addNotification(agxSDK::Simulation* simulation) override;
109 virtual bool removeNotification(agxUtil::ConstraintHolder* constraintHolder, agxSDK::Simulation* simulation) override;
110
112 virtual bool preUpdate(agx::Real timeStep) override;
113
115 virtual bool store(agxStream::StorageStream& str) const override;
117 virtual bool postStore(agxStream::StorageStream& str) const override;
118
120 virtual bool restore(agxStream::StorageStream& str) override;
122 virtual bool postRestore(agxStream::StorageStream& str) override;
123
125
126 protected:
127 ElectricMotor() = default;
128
130 virtual ~ElectricMotor();
131
132 private:
133 agx::Real m_resistance;
134 agx::Real m_torqueConstant;
135 agx::Real m_emfConstant;
136 agx::Real m_inductance;
137 agx::Real m_voltage;
138
140 };
141
143}
144
145
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#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.
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
const agxDriveTrain::ElectricMotorConstraint * getConstraint() const
virtual bool preUpdate(agx::Real timeStep) override
agx::Real getVoltage() const
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:131
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:523
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
double Real
Definition: Real.h:41