WormWheel

class WormWheel(name: str, n_teeth: int, inertia_moment: InertiaMoment, helix_angle: Angle, pressure_angle: Angle, module: Length | None = None, face_width: Length | None = None)

Bases: HelicalGear

WormWheel object.

Attributes

namestr

Name of the worm wheel.

n_teethint

Number of gear teeth.

inertia_momentInertiaMoment

Moment of inertia of the gear.

helix_angleAngle

Helix angle of the worm wheel.

pressure_angleAngle

Pressure angle of the worm wheel.

moduleLength

Unit of the gear teeth size.

reference_diameterLength

Reference diameter of the gear.

face_widthLength

Face width of the gear.

lewis_factorfloat

Factor used to compute stresses on the gear tooth.

driven_byRotatingObject

Rotating object that drives the gear, for example a DCMotor, a Flywheel or another gear (SpurGear, HelicalGear, WormGear, WormWheel).

drivesRotatingObject

Rotating object driven by the gear, it can be a Flywheel or another gear (SpurGear, HelicalGear, WormGear, WormWheel).

master_gear_ratiofloat

Gear ratio of the mating between the gear and its driving gear.

master_gear_efficiencyfloat or int

Efficiency of the gear mating between the gear and its driving gear.

mating_role: Role

The role of the gear in the gear mating.

angular_positionAngularPosition

Angular position of the gear.

angular_speedAngularSpeed

Angular speed of the gear.

angular_accelerationAngularAcceleration

Angular acceleration of the gear.

torqueTorque

Net torque applied on the gear.

driving_torqueTorque

Driving torque applied on the gear by its driving gear.

load_torqueTorque

Load torque applied on the gear by its driven gear or an external load.

tangential_forceForce

Tangential force applied on the gear teeth by the mating gear.

tangential_force_is_computablebool

Whether is possible to compute the tangential_force on the gear teeth.

bending_stressStress

Bending stress applied on the gear teeth by the mating gear.

bending_stress_is_computablebool

Whether is possible to compute the bending_stress on the gear teeth.

time_variablesdict

Time variables of the gear.

Methods

compute_tangential_force()

It computes the tangential_force applied on the gear teeth by the mating gear.

compute_bending_stress()

It computes the bending_stress applied on the gear teeth by the mating gear.

external_torque()

Custom function to compute the external torque applied on the gear.

update_time_variables()

It updates time_variables dictionary by appending the last value of each time variable to corresponding list.

property angular_acceleration: AngularAcceleration

Angular acceleration of the gear. It must be an instance of AngularAcceleration.

Returns

AngularAcceleration

Angular acceleration of the gear.

Raises

TypeError

If angular_acceleration is not an instance of AngularAcceleration.

property angular_position: AngularPosition

Angular position of the gear. It must be an instance of AngularPosition.

Returns

AngularPosition

Angular position of the gear.

Raises

TypeError

If angular_position is not an instance of AngularPosition.

property angular_speed: AngularSpeed

Angular speed of the gear. It must be an instance of AngularSpeed.

Returns

AngularSpeed

Angular speed of the gear.

Raises

TypeError

If angular_speed is not an instance of AngularSpeed.

property bending_stress: Stress

Bending stress applied on the gear teeth by the mating gear. It must be an instance of Stress.

Returns

Stress

Bending stress applied on the gear teeth by the mating gear.

Raises

TypeError

If bending_stress is not an instance of Stress.

property bending_stress_is_computable: bool

Whether is possible to compute the bending_stress on the gear teeth.

The bending stress computation depends on the value of module and face_width and the reference_diameter of the mating WormGear, so if these optional parameters have been set at worm wheel and worm gear instantiations, then it is possible to compute the bending stress and this property is True, otherwise is False.

Returns

bool

Whether is possible to compute the bending stress on the gear teeth.

compute_bending_stress() None

It computes the bending_stress applied on the gear teeth by the mating gear.

Notes

The bending stress computation is based on the following assumptions:

  • the tooth is stressed by the overall force acting on the tip of the tooth itself,

  • the most unfavorable situation is considered in the calculation, as if there is only one pair of teeth in contact within the contact segment,

  • the component of the overall force that determines the bending on the tooth is the only one considered and, for simplicity, is taken as having a value equal to the tangential force on the reference diameter,

  • the radial component of the overall force that causes a compressive stress on the tooth is neglected.

The bending stress is computed with the following formula:

\[\sigma_b = \frac{F_t}{p_n \, b_{eff} \, Y_{LW}}\]

where:

  • \(F_t\) is the tangential_force applied on the tooth,

  • \(p_n\) is the normal pitch,

  • \(b_{eff}\) is the effective tooth face width,

  • \(Y_{LW}\) is the gear Lewis factor lewis_factor.

The normal pitch can be computed with:

\[p_n = \frac{\pi d_{wg} \sin \beta}{N}\]

where:

The effective tooth face width \(b_{eff}\) is the minimum between the worm wheel face width face_width and the mating worm gear reference diameter multiplied by 0.67.

compute_tangential_force() None

It computes the tangential_force applied on the gear teeth by the mating gear.

Considering a gear mating:

  • if the gear is the master one, then it takes into account the load_torque for the computation,

  • if the gear is the slave one, then it take into account the driving_torque for the computation.

The tangential force is computed dividing the just described reference torque by the reference radius (half of the reference_diameter).

Raises

ValueError

If a gear mating between two gears has not been set.

property driven_by: RotatingObject

Rotating object that drives the gear, for example a DCMotor, a Flywheel or another gear (SpurGear, HelicalGear, WormGear, WormWheel). It must be a RotatingObject.

To set this property use add_worm_gear_mating or add_fixed_joint.

Returns

RotatingObject

Master rotating object that drives the gear.

Raises

TypeError

If driven_by is not an instance of RotatingObject.

property drives: RotatingObject

Rotating object driven by the gear, it can be a Flywheel or another gear (SpurGear, HelicalGear, WormGear, WormWheel). It must be a RotatingObject.

To set this property use add_worm_gear_mating or add_fixed_joint.

Returns

RotatingObject

Rotating object driven by the gear.

Raises

TypeError

If drives is not an instance of RotatingObject.

property driving_torque: Torque

Driving torque applied on the gear by its driving gear. It must be an instance of Torque.

Returns

Torque

Driving torque applied on the gear by its driving gear.

Raises

TypeError

If driving_torque is not an instance of Torque.

property external_torque: Callable[[AngularPosition, AngularSpeed, Time], Torque]

Custom function to compute the external torque applied on the gear. It must be a function with parameters angular_position, angular_speed and time. The function must return an instance of Torque.

Returns

Callable

The function to compute the external torque applied on the gear.

Raises

TypeError

If external_torque is not callable.

KeyError

If external_torque misses parameters angular_position, angular_speed or time.

Examples

Constant torque, not dependent on angular_position, angular_speed or time.

>>> from gearpy.mechanical_objects import WormWheel
>>> from gearpy.units import InertiaMoment, Torque
>>> gear = WormWheel(name = 'gear', n_teeth = 10, inertia_moment = InertiaMoment(1, 'kgm^2'))
>>> gear.external_torque = lambda angular_position, angular_speed, time: Torque(5, 'Nm')

Torque dependent on angular_position and time.

In this case the gear gets a periodic load, dependent on time, and an extra load dependent on its angular position. The dependence by angular position may be used to model cases where cams are involved.

>>> import numpy as np
>>> from gearpy.units import AngularPosition, AngularSpeed, Time
>>> def custom_external_torque(angular_position: AngularPosition,
...                            angular_speed: AngularSpeed,
...                            time: Time):
...     return Torque(value = angular_position.sin() +
...                           np.cos(time.to('sec').value),
...                   unit = 'Nm')
>>> gear.external_torque = custom_external_torque

Torque dependent on angular_position, angular_speed and time.

With respect ot the previous case, the gear gets an extra load dependent on its angular speed. The dependence by angular speed may be used to model cases where air friction is not negligible.

>>> def complex_external_torque(angular_position: AngularPosition,
...                             angular_speed: AngularSpeed,
...                             time: Time):
...     return Torque(value = angular_position.sin() +
...                           0.001*(angular_speed.to('rad/s').value)**2 +
...                           np.cos(time.to('sec').value),
...                   unit = 'Nm')
>>> gear.external_torque = complex_external_torque
property face_width: Length | None

Face width of the gear. It must be an instance of Length.

Returns

Length

Face width of the gear.

Raises

TypeError

If face_width is not an instance of Length.

property helix_angle: Angle

Helix angle of the worm wheel. It must be an instance of Angle.

The maximum allowable value of helix angle depends on the pressure_angle.

Once set at the worm gear instantiation, it cannot be changed afterward.

Returns

Angle

The helix angle of the worm wheel.

Raises

TypeError

If helix_angle is not an instance of Angle.

ValueError

If helix_angle is greater than the maximum allowable helix angle, depending on pressure_angle value.

property inertia_moment: InertiaMoment

Moment of inertia of the gear. It must be an instance of InertiaMoment.

Once set at the worm wheel instantiation, it cannot be changed afterward.

Returns

InertiaMoment

Moment of inertia of the gear.

Raises

TypeError

If inertia_moment is not an instance of InertiaMoment.

property lewis_factor: float | None

Factor used to compute stresses on the gear tooth.

It is a tabular value that depends on the pressure_angle.

Returns

float

Factor used to compute stresses on the gear tooth.

property load_torque: Torque

Load torque applied on the gear by its driven gear or an external load. It must be an instance of Torque.

Returns

Torque

Load torque applied on the gear by its driven gear or an external load.

Raises

TypeError

If load_torque is not an instance of Torque.

property master_gear_efficiency: float | int

Efficiency of the gear mating between the gear and its driving gear. It must be a float or an int within 0 and 1.

To set this property use add_worm_gear_mating or add_fixed_joint.

Returns

float or int

Efficiency of the gear mating between the gear and its driving gear.

Raises

TypeError

If master_gear_efficiency is not a float or an int.

ValueError

If master_gear_efficiency is not within 0 and 1.

property master_gear_ratio: float

Gear ratio of the mating between the gear and its driving gear. It must be a positive a float.

If the wheel gear is fixed to another driving RotatingObject, then the ratio is 1, otherwise it is defined as the ratio between the worm wheel number of teeth n_teeth and the driving worm gear number of starts WormGear.n_starts.

To set this property use add_worm_gear_mating or add_fixed_joint.

Returns

float

Gear ratio of the mating between the gear and its driving gear.

Raises

TypeError

If master_gear_ratio is not a float.

ValueError

If master_gear_ratio is negative or null.

property mating_role: Role

Role of the gear in the gear mating.

If the gear drives the mate one, then it is the “master” gear and its role is MatingMaster, otherwise it is the “slave” one and its role is MatingSlave.

To set this parameter use add_worm_gear_mating.

Returns

Role

The role of the gear in the gear mating.

Raises

ValueError

If mating_role is not a subclass of Role.

property module: Length | None

Unit of the gear teeth size. It must be an instance of Length.

Once set at the worm wheel instantiation, it cannot be changed afterward.

Returns

Length

Unit of the gear teeth size.

Raises

TypeError

If module is not an instance of Length.

property n_teeth: int

Number of gear teeth. It must be a positive int.

Once set at the worm wheel instantiation, it cannot be changed afterward.

Returns

int

Number of gear teeth.

Raises

TypeError

If n_teeth is not an int.

ValueError

If n_teeth is less than the minimum number of teeth, based on Lewis Factor table.

property name: str

Name of the worm wheel. 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 worm wheel instantiation, it cannot be changed afterward.

Returns

str

Name of the worm wheel.

Raises

TypeError

If name is not a str.

ValueError

If name is an empty str.

property pressure_angle: Angle

Pressure angle of the worm wheel. It must be an instance of Angle and its value must be one of: 14.5 deg, 20 deg, 25 deg or 30 deg.

Once set at the worm wheel instantiation, it cannot be changed afterward.

Returns

Angle

The pressure angle of the worm wheel.

Raises

TypeError

If pressure_angle is not an instance of Angle.

ValueError

If pressure_angle value is not among available ones: 14.5 deg, 20 deg, 25 deg or 30 deg.

property reference_diameter: Length | None

Reference diameter of the gear. It must be an instance of Length.

It is computed as the product of n_teeth times module at the worm wheel instantiation and it cannot be changed afterward.

Returns

Length

Reference diameter of the gear.

property tangential_force: Force

Tangential force applied on the gear teeth by the mating gear. It must be an instance of Force.

Returns

Force

Tangential force applied on the gear teeth by the mating gear.

Raises

TypeError

If tangential_force is not an instance of Force.

property tangential_force_is_computable: bool

Whether is possible to compute the tangential_force on the gear teeth.

The tangential force computation depends on the value of module, so if this optional parameter has been set at worm wheel instantiation, then it is possible to compute the tangential force and this property is True, otherwise is False.

Returns

bool

Whether is possible to compute the tangential force on the gear teeth.

property time_variables: dict[str, list[UnitBase]]

Time variables of the worm wheel. Each time variable is stored as a dictionary key-value pair. The available time variables are:

'tangential force' and 'bending stress' are listed among time variables only if they are computable indeed, depending on which gear parameters are set at worm wheel instantiation; see tangential_force_is_computable and bending_stress_is_computable.

Corresponding values of the dictionary are lists of the respective time variable values.

At each time iteration, the Solver appends every time variables’ values to the relative list in the dictionary.

Returns

dict

Time variables of the worm wheel.

property torque: Torque

Net torque applied on the gear. It must be an instance of Torque.

It is computed as the difference between driving_torque and load_torque.

Returns

Torque

Net torque applied on the gear.

Raises

TypeError

If torque is not an instance of Torque.

update_time_variables() None

It updates time_variables dictionary by appending the last value of each time variable (key of the dictionary) to corresponding list (value of the dictionary).