DCMotor¶
- class DCMotor(name: str, inertia_moment: InertiaMoment, no_load_speed: AngularSpeed, maximum_torque: Torque, no_load_electric_current: Current | None = None, maximum_electric_current: Current | None = None)¶
Bases:
MotorBaseDCMotorobject.Attributes¶
namestrName of the DC motor.
drivesRotatingObjectRotating object driven by DC motor, it can be a
Flywheelor a gear (SpurGear,HelicalGear,WormGear,WormWheel).angular_positionAngularPositionAngular position of the DC motor.
angular_speedAngularSpeedAngular speed of the DC motor.
angular_accelerationAngularAccelerationAngular acceleration of the DC motor.
no_load_speedAngularSpeedNo load angular speed of the DC motor.
maximum_torqueTorqueMaximum torque developed by the DC motor.
torqueTorqueNet torque applied on the DC motor.
driving_torqueTorqueDriving torque developed by the DC motor.
load_torqueTorqueLoad torque applied on the DC motor by its driven gear.
inertia_momentInertiaMomentMoment of inertia of the DC motor.
no_load_electric_currentCurrentNo load electric current absorbed by the DC motor.
maximum_electric_currentCurrentMaximum electric current absorbed by the DC motor.
electric_current_is_computableboolWhether is possible to compute the
electric_currentabsorbed by the DC motor.electric_currentCurrentElectric current absorbed by the DC motor.
pwmfloatorintPulse Width Modulation duty cycle of the supply voltage of the DC motor.
time_variablesdictTime variables of the DC motor.
Methods¶
compute_torque()It computes the
driving_torquedeveloped by the DC motor.compute_electric_current()It computes the
electric_currentabsorbed by the DC motor.update_time_variables()It updates
time_variablesdictionary by appending the last value of each time variable to corresponding list.
- property angular_acceleration: AngularAcceleration¶
Angular acceleration of the DC motor. It must be an instance of
AngularAcceleration.Returns¶
AngularAccelerationAngular acceleration of the DC motor.
Raises
TypeErrorIf
angular_accelerationis not an instance ofAngularAcceleration.
- property angular_position: AngularPosition¶
Angular position of the DC motor. It must be an instance of
AngularPosition.Returns¶
AngularPositionAngular position of the DC motor.
Raises
TypeErrorIf
angular_positionis not an instance ofAngularPosition.
- property angular_speed: AngularSpeed¶
Angular speed of the DC motor. It must be an instance of
AngularSpeed.Returns¶
AngularSpeedAngular speed of the DC motor.
Raises
TypeErrorIf
angular_speedis not an instance ofAngularSpeed.
- compute_electric_current() None¶
It computes the
electric_currentabsorbed by the DC motor.The absorbed electric current depends on the two constants
no_load_electric_currentandmaximum_electric_currentand the two variablesdriving_torqueandpwmof the DC motor.The computed electric current has the same unit of
maximum_electric_current.Notes
The computation is based on the following relationship:
\[i \left( T \right) = \left( i_{max}^D - i_0 \right) \frac{T}{T_{max}^D} + i_0\]where:
\(i\) is the
electric_currentabsorbed by the DC motor,\(T\) is the DC motor developed
driving_torque,\(i_{max}^D\) is the maximum electric current absorbed by the DC motor keeping into account
pwm,\(i_0\) is the
no_load_electric_currentabsorbed by the DC motor,\(T_{max}^D\) is the DC motor maximum torque developed by the DC motor keeping into account
pwm.
The maximum torque can be computed as:
\[T_{max}^D \left( D \right) = T_{max} \frac{D \, i_{max} - i_0}{i_{max} - i_0}\]and the maximum electric current can be computed as:
\[i_{max}^D \left( D \right) = D \, i_{max}\]where:
\(D\) is the DC motor supply voltage PWM duty cycle (
pwm),\(T_{max}\) is the DC motor
maximum_torque,\(i_{max}\) is the DC motor
maximum_electric_current,\(i_0\) is the DC motor
no_load_electric_current.
If the
pwmis lower than a critical threshold, then the motor cannot develop any torque, so theelectric_currentwill depend only onpwmvalue. The criticalpwmvalue can be computed as:\[D_{lim} = \frac{i_0}{i_{max}}\]and the relative electric current can be computed as:
\[i_{lim} \left( D \right) = D \, i_{max}\]
- compute_torque() None¶
It computes the
driving_torquedeveloped by the DC motor.The driving torque depends on the two constants
no_load_speedandmaximum_torqueand the two variablesangular_speedandpwmof the DCMotor.The computed torque has the same unit of
maximum_torque.Notes
The computation is based on the following relationship:
\[T \left( \dot{\theta} , T_{max}^D , \dot{\theta}_0^D \right) = T_{max}^D \left( 1 - \frac{\dot{\theta}}{\dot{\theta}_0^D} \right)\]where:
\(T\) is the DC motor developed driving torque
driving_torque,\(\dot{\theta}\) is the actual DC motor angular speed
angular_speed,\(T_{max}^D\) is the DC motor maximum torque developed by the DC motor keeping into account
pwm,\(\dot{\theta}_0^D\) is the DC motor no load angular speed keeping into account
pwm.
The maximum torque can be computed as:
\[T_{max}^D \left( D \right) = T_{max} \frac{D \, i_{max} - i_0}{i_{max} - i_0}\]and the no load angular speed can be computed as:
\[\dot{\theta}_0^D \left( D \right) = D \, \dot{\theta}_0\]where:
\(D\) is the DC motor supply voltage PWM duty cycle (
pwm),\(T_{max}\) is the DC motor
maximum_torque,\(i_{max}\) is the DC motor
maximum_electric_current,\(i_0\) is the DC motor
no_load_electric_current,\(\dot{\theta}_0\) is the DC motor
no_load_speed.
If the
pwmis lower than a critical threshold, then the motor cannot develop any torque, so thedriving_torquewill be null. The criticalpwmvalue can be computed as:\[D_{lim} = \frac{i_0}{i_{max}}\]
- property drives: RotatingObject¶
Rotating object driven by DC motor, it can be a
Flywheelor a gear (SpurGear,HelicalGear,WormGear,WormWheel). It must be an instance ofRotatingObject.To set this property use
add_fixed_joint.Returns¶
RotatingObjectRotating object driven by the DC motor.
Raises
TypeErrorIf
drivesis not an instance ofRotatingObject.
- property driving_torque: Torque¶
Driving torque developed by the DC motor. It must be an instance of
Torque.Returns¶
TorqueDriving torque developed by the DC motor.
Raises
TypeErrorIf
driving_torqueis not an instance ofTorque.
See Also
- property electric_current: Current | None¶
Electric current absorbed by the DC motor. It must be an instance of
Current.Returns¶
CurrentElectric current absorbed by the DC motor.
Raises
TypeErrorIf
electric_currentis not an instance ofCurrent.
See Also
- property electric_current_is_computable: bool¶
Whether is possible to compute the
electric_currentabsorbed by the DC motor.The electric current computation depends on the value of
no_load_electric_currentandmaximum_electric_current, so if these optional parameters have been set at DC motor instantiation, then it is possible to compute the absorbed electric current and this property isTrue, otherwise isFalse.Returns¶
boolWhether is possible to compute the electric current absorbed by the DC motor.
See Also
- property inertia_moment: InertiaMoment¶
Moment of inertia of the DC motor’s rotor. It must be an instance of
InertiaMoment.Once set at the DC motor instantiation, it cannot be changed afterward.
Returns¶
InertiaMomentMoment of inertia of the DC motor’s rotor.
Raises
TypeErrorIf
inertia_momentis not an instance ofInertiaMoment.
- property load_torque: Torque¶
Load torque applied on the DC motor by its driven gear. It must be an instance of
Torque.Returns¶
TorqueLoad torque applied on the DC motor by its driven gear.
Raises
TypeErrorIf
load_torqueis not an instance ofTorque.
- property maximum_electric_current: Current | None¶
Maximum electric current absorbed by the DC motor. It must be an instance of
Current. Its value must be positive and greater thanno_load_electric_current.It is the maximum electric current the DC motor can absorb when its rotor is kept still by the load.
Once set at the DC motor instantiation, it cannot be changed afterward.
Returns¶
CurrentMaximum electric current absorbed by the DC motor.
Raises
TypeErrorIf
maximum_electric_currentis not an instance ofCurrent.ValueErrorIf
maximum_electric_currentis negative or null,if
maximum_electric_currentis lower than or equal tono_load_electric_current.
- property maximum_torque: Torque¶
Maximum torque developed by the DC motor. It must be an instance of
Torque. Its value must be positive.It is the maximum torque the DC motor can develop when its rotor is kept still by the load.
Once set at the DC motor instantiation, it cannot be changed afterward.
Returns¶
TorqueMaximum torque developed by the DC motor.
Raises
TypeErrorIf
maximum_torqueis not an instance ofTorque.ValueErrorIf
maximum_torqueis negative or null.
- property name: str¶
Name of the DC motor. It must be a non-empty
str.It must be a unique name, not shared by other elements in the powertrain elements.
Once set at the DC motor instantiation, it cannot be changed afterward.
Returns¶
strName of the DC motor.
- property no_load_electric_current: Current | None¶
No load electric current absorbed by the DC motor. It must be an instance of
Current. Its value must be positive or null and lower thanmaximum_electric_current.It is the electric current absorbed by the DC motor when no load is applied to its rotor.
Once set at the DC motor instantiation, it cannot be changed afterward.
Returns¶
CurrentNo load electric current of the DC motor.
Raises
TypeErrorIf
no_load_electric_currentis not an instance ofCurrent.ValueErrorIf
no_load_electric_currentis negative,if
no_load_electric_currentis higher than or equal tomaximum_electric_current.
- property no_load_speed: AngularSpeed¶
No load angular speed of the DC motor. It must be an instance of
AngularSpeed. Its value must be positive.It is the angular speed at which the DC motor rotates when no load is applied to its rotor.
Once set at the DC motor instantiation, it cannot be changed afterward.
Returns¶
AngularSpeedNo load angular speed of the DC motor.
Raises
TypeErrorIf
no_load_speedis not an instance ofAngularSpeed.ValueErrorIf
no_load_speedis negative or null.
- property pwm: float | int¶
Pulse Width Modulation duty cycle of the supply voltage of the DC motor.
It must be a
floator anintwithin-1and1.In general the duty cycle can be between
0and1, butpwmcan be between-1and1, in order to take into account the voltage sign with respect to the direction of rotation:if
pwmis positive, then the supply voltage pushes the motor to rotate in the positive direction,if
pwmis negative, then the supply voltage pushes the motor to rotate in the negative direction,if
pwmis null, then the supply voltage is null to and the motor does not develop any driving torque.
The
pwmvalue has an impact on thedriving_torquedeveloped and theelectric_currentabsorbed by the DC motor.Returns¶
- property time_variables: dict[str, list[UnitBase]]¶
Time variables of the DC motor. Each time variable is stored as a dictionary key-value pair. The available time variables are:
angular_position:'angular position',angular_speed:'angular speed',angular_acceleration:'angular acceleration',torque:'torque',driving_torque:'driving torque',load_torque:'load torque',electric_current:'electric current',pwm:'pwm'.
'electric current'is listed among time variables only if it is computable indeed, depending on which motor parameters was set at DC motor instantiation; seeelectric_current_is_computablefor more details.Corresponding values of the dictionary are lists of the respective time variable values.
At each time iteration, the
Solverappends every time variables’ values to the relative list in the dictionary.Returns¶
dictTime variables of the DC motor.
See Also
- property torque: Torque¶
Net torque applied on the DC motor. It must be an instance of
Torque.It is computed as the difference between
driving_torqueandload_torque.Returns¶
TorqueNet torque applied on the DC motor.
- update_time_variables() None¶
It updates
time_variablesdictionary by appending the last value of each time variable (key of the dictionary) to corresponding list (value of the dictionary).