**Authors**: Chad Glinsky

**Description**: Kinematics of rotationally connected bodies, including examples for parallel and planetary gear sets.

In [1]:

```
import numpy as np
# notebook modules
import kinematics as kin
```

In [2]:

```
# DEVELOPMENT USE: %autoreload 1
# PRODUCTION USE: %autoreload 0
%load_ext autoreload
%autoreload 0
%aimport kinematics
```

This notebook provides a review of the kinematics in systems of rotationally connected bodies, an important subject matter in drivetrain engineering. Technical explanations and interactive examples are provided for different gear system architectures, including parallel and planetary arrangements.

This notebook has two main objectives:

- Educate the reader about the kinematics in rotational systems, such as gearboxes.
- Provide practical use cases for rotational kinematics, namely formulating and solving angular velocities in parallel and planetary gear systems.

Symbol | Description |
---|---|

$X$ | Cartesian global x-coordinate |

$Y$ | Cartesian global y-coordinate |

$Z$ | Cartesian global z-coordinate |

$x$ | Cartesian x-coordinate |

$y$ | Cartesian y-coordinate |

$z$ | Cartesian z-coordinate |

$\x$ | Cartesian x-axis unit vector |

$\y$ | Cartesian y-axis unit vector |

$\z$ | Cartesian z-axis unit vector |

$i$ | Transmission ratio |

$z$ | Number of teeth |

$r$ | Pitch radius |

$\theta$ | Angle of rotation |

$v$ | Linear velocity |

$\omega$ | Angular velocity |

$\Omega$ | Constant angular velocity |

Any symbols combined with a overhead arrow, $\vec{}$, indicates a *vector*, a term with magnitude and direction. Any symbols with an overhead hat, $\hat{}$, indicates a *unit vector*. For example, $\vec{v}$ is a linear velocity vector and $\hat{v}$ is the unit vector of velocity.

In the context of this notebook, a physical rotating system is a collection of bodies that rotate based on the conditions and constraints applied to the system. Many types of numerical analyses are possible for rotating systems, depending on the fidelity of the mathematical model. Types of analysis include:

- Statics (linear and nonlinear)
- Kinematics (rigid body motion)
- Steady-state dynamics (linearized frequency-domain)
- Transient dynamics (linear and nonlinear time-domain)

This notebook focuses on *kinematics*, the rigid body motion of rotating systems. It is the most fundamental to assessing the operation and performance of a drivetrain, requiring the least fidelity to mathematically model and solve.

The kinematics of a three-dimensional system of bodies is considered throughout this notebook. To simplify analysis without misrepresenting the physical system, an axis of rotation is assumed for each rotating body. Plus, any rotational couplings between bodies are assumed to affect only motion about each axis of rotation.

Axis of rotation in three-dimensional space

These assumptions allow analysis of a three-dimensional system of arbitrarily oriented bodies to be simplified to the analysis of a single degree-of-freedom (DOF) for each body. Without this simplification, each body would have 3-DOF that require solving, i.e. rotation about three orthogonal axes. Specifically, kinematics is interested in the rate of change for the DOF, $\theta$, about the axis of rotation:

$$\vec{\omega} = \frac{\rm{d}\vec{\theta}}{\rm{d}t}$$Since kinematics is only concerned about the steady state motion of rigid bodies, it is unecessary to model mass, inertia, forces, or moments. The field of *kinetics*, sometimes generally referred to as *dynamics*, is concerned with those quantities. Kinetics is outside the scope of this notebook.

If a system is constrained to rotate about a specific axis, e.g. by use of rolling element bearings, there will be a single principal axis of rotation and the average speed of any off-axis rotations must be zero. Therefore, the assumption of single-axis rotation is valid. For transient dynamic analysis, it is recommended to model the full 6-DOF system to capture any off-axis rotations.

This section explains the kinematics of parallel gears, such as spur and helical gears. The following gear architectures are considered, with the number of gears indicated by (#):

- Gear pair (2)
- Idler gear set (3)
- Compound gear set (5)

Despite the architectures being different, it will be shown how the formulation of kinematics is similar for each gear set.

This section formulates the kinematics of a single parallel gear pair, as illustrated below.

Kinematics diagram of parallel gear pair

The gear pair is rotationally coupled by meshing gear teeth. Since each gear body is modeled with a single DOF, $\theta$, two variables exist for the kinematics of this system: $\omega_1, \omega_2$. To create a solvable system of equations for the kinematics, we must formulate equations as a function of these variables. As explained in our notebooks on gear geometry, the transmission ratio of the gear pair is easily calculated as the ratio of gear teeth:

$$i = \frac{z_2}{z_1} = \frac{\|\vec{\omega_1}\|}{\|\vec{\omega_2}\|}$$where the magnitude of angular velocities are related by this ratio. By knowing that gears in an external gear mesh rotate in opposite directions and that a single component of each angular velocity vector is non-zero, the classical form of a linear equation can be written as:

$$\omega_1 + i \omega_2 = 0$$If this were not a 1-DOF formulation, $\omega_1$ would be expressed as $\omega_{1z}$ if the local z-axis were the axis of rotation. For brevity, the notation has been simplified. For the kinematics to be fully defined, we must impose a speed constraint on the system. If we arbitrarily choose to specify a constant input speed, $\Omega_1$, a second equation is written as:

$$\omega_1 = \Omega_1$$Finally, the system of equations for kinematics of a single parallel gear pair is assembled in matrix form as:

$$ \begin{bmatrix} 1 & 0 \\ 1 & i \end{bmatrix} \begin{bmatrix} \omega_1 \\ \omega_2 \end{bmatrix} = \begin{bmatrix} \Omega_1 \\ 0 \end{bmatrix} $$and numerical solvers can be used to solve the linear system.

Angular velocity of pinion gear: $\omega_1$

In [3]:

```
# GIVEN
# -----
number_of_teeth1 = 20 # input pinion
number_of_teeth2 = 40 # output wheel
input_speed = 1
# SOLUTION
# --------
# formulate
transmission_ratio = number_of_teeth2 / number_of_teeth1
coefficients_matrix = [[1, 0], [1, transmission_ratio]]
constants = [input_speed, 0]
# solve
omegas = np.linalg.solve(coefficients_matrix, constants)
# speeds
rpms = kin.rpm(omegas)
omega1, omega2 = omegas
rpm1, rpm2 = rpms
# DISPLAY RESULTS
# ---------------
cols = ['Description', 'Symbol', 'Gear 1', 'Gear 2', 'Units']
data = [
['Number of teeth', '$z$', number_of_teeth1, number_of_teeth2, '-'],
['Angular velocities', '$\omega$', omega1, omega2, '$\text{rad/s}$'],
['Revolutions per minute', 'RPM', rpm1, rpm2, '$\text{rpm}$'],
]
kin.df_display(data, cols, ['Gear 1', 'Gear 2'])
```

Description | Symbol | Gear 1 | Gear 2 | Units |
---|---|---|---|---|

Number of teeth | $z$ | 20.000 | 40.000 | - |

Angular velocities | $\omega$ | 1.000 | -0.500 | $\text{rad/s}$ |

Revolutions per minute | RPM | 9.549 | -4.775 | $\text{rpm}$ |

This section formulates the kinematics of a parallel idler gear set, as illustrated below.

Kinematics diagram of idler gear set

The gear set consists of two gear pairs, each rotationally coupled by meshing gear teeth. Since each gear body is modeled with a single DOF, $\theta$, three variables exist for the kinematics of this system: $\omega_1, \omega_2, \omega_3$. To create a solvable system of equations for the kinematics, we must formulate equations as a function of these variables. The transmission ratio of the input-idler gear pair is calculated as:

$$i_{12} = \frac{z_2}{z_1} = \frac{\|\vec{\omega_1}\|}{\|\vec{\omega_2}\|}$$and similarly for the idler-output gear pair:

$$i_{23} = \frac{z_3}{z_2} = \frac{\|\vec{\omega_2}\|}{\|\vec{\omega_3}\|}$$By formulating equations in terms of the angular velocity components, the linear equations are written as:

$$\omega_1 + i_{12} \omega_2 = 0$$$$\omega_2 + i_{23} \omega_3 = 0$$For the kinematics to be fully defined, we must impose a speed constraint on the system. If we arbitrarily choose to specify a constant input speed, $\Omega_1$, a third equation is written as:

$$\omega_1 = \Omega_1$$Finally, the system of equations for kinematics of a parallel idler gear set is assembled in matrix form as:

$$ \begin{bmatrix} 1 & 0 & 0 \\ 1 & i_{12} & 0 \\ 0 & 1 & i_{23} \end{bmatrix} \begin{bmatrix} \omega_1 \\ \omega_2 \\ \omega_3 \end{bmatrix} = \begin{bmatrix} \Omega_1 \\ 0 \\ 0 \end{bmatrix} $$and numerical solvers can be used to solve the linear system.

Angular velocity of pinion gear: $\omega_1$

In [4]:

```
# GIVEN
# -----
number_of_teeth1 = 20 # input
number_of_teeth2 = 40 # idler
number_of_teeth3 = 21 # output
input_speed = 1
# SOLUTION
# --------
# formulate
transmission_ratio12 = number_of_teeth2 / number_of_teeth1
transmission_ratio23 = number_of_teeth3 / number_of_teeth2
coefficients_matrix = [
[1, 0, 0],
[1, transmission_ratio12, 0],
[0, 1, transmission_ratio23]
]
constants = [input_speed, 0, 0]
# solve
omegas = np.linalg.solve(coefficients_matrix, constants)
# speeds
rpms = kin.rpm(omegas)
omega1, omega2, omega3 = omegas
rpm1, rpm2, rpm3 = rpms
# DISPLAY RESULTS
# ---------------
cols = ['Description', 'Symbol', 'Gear 1', 'Gear 2', 'Gear 3', 'Units']
data = [
['Number of teeth', '$z$', number_of_teeth1, number_of_teeth2, number_of_teeth3, '-'],
['Angular velocities', '$\omega$', omega1, omega2, omega3, '$\text{rad/s}$'],
['Revolutions per minute', 'RPM', rpm1, rpm2, rpm3, '$\text{rpm}$'],
]
kin.df_display(data, cols, ['Gear 1', 'Gear 2', 'Gear 3'])
```

Description | Symbol | Gear 1 | Gear 2 | Gear 3 | Units |
---|---|---|---|---|---|

Number of teeth | $z$ | 20.000 | 40.000 | 21.000 | - |

Angular velocities | $\omega$ | 1.000 | -0.500 | 0.952 | $\text{rad/s}$ |

Revolutions per minute | RPM | 9.549 | -4.775 | 9.095 | $\text{rpm}$ |

This section formulates the kinematics of a parallel compound gear set, as illustrated below.

Kinematics diagram of compound parallel gear set

The gear set consists of three gear pairs, each rotationally coupled by meshing gear teeth. Since each gear body is modeled with a single DOF, $\theta$, five variables exist for the kinematics of this system: $\omega_1, \omega_2, \omega_3, \omega_4, \omega_5$. To create a solvable system of equations for the kinematics, we must formulate equations as a function of these variables.

In addition to the transmission ratio equations of the previous section for the idler gear set, this gear set has an additional equation for the transmission ratio of the final gear pair:

$$i_{45} = \frac{z_5}{z_4} = \frac{\|\vec{\omega_4}\|}{\|\vec{\omega_5}\|}$$By formulating equations in terms of the angular velocity components, the linear equation is written as:

$$\omega_4 + i_{45} \omega_5 = 0$$The compound gear set has a feature that did not exist in the previous gear sets, namely gears 3 and 4 are constrained to rotate together. In a physical system, this feature is commonly encountered as a single shaft with two gears machined into it, or the thin shaft is machined with one gear and is press fit with a larger gear blank. Regardless, the kinematics equation to define this condition is:

$$\omega_3 - \omega_4 = 0$$For the kinematics to be fully defined, we must impose a speed constraint on the system. If we arbitrarily choose to specify a constant input speed, $\Omega_1$, another equation is written as:

$$\omega_1 = \Omega_1$$Finally, the system of equations for kinematics of a parallel compound gear set is assembled in matrix form as:

$$ \begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 1 & i_{12} & 0 & 0 & 0 \\ 0 & 1 & i_{23} & 0 & 0 \\ 0 & 0 & 1 & -1 & 0 \\ 0 & 0 & 0 & 1 & i_{45} \\ \end{bmatrix} \begin{bmatrix} \omega_1 \\ \omega_2 \\ \omega_3 \\ \omega_4 \\ \omega_5 \end{bmatrix} = \begin{bmatrix} \Omega_1 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix} $$and numerical solvers can be used to solve the linear system.

Angular velocity of input gear: $\omega_1$

In [5]:

```
# GIVEN
# -----
number_of_teeth1 = 20 # idler input
number_of_teeth2 = 40 # idler gear
number_of_teeth3 = 30 # idler output
number_of_teeth4 = 25 # output stage pinion
number_of_teeth5 = 50 # output stage wheel
input_speed = 1
# SOLUTION
# --------
# formulate
transmission_ratio12 = number_of_teeth2 / number_of_teeth1
transmission_ratio23 = number_of_teeth3 / number_of_teeth2
transmission_ratio45 = number_of_teeth5 / number_of_teeth4
coefficients_matrix = [
[1, 0, 0, 0, 0],
[1, transmission_ratio12, 0, 0, 0],
[0, 1, transmission_ratio23, 0, 0],
[0, 0, 1, -1, 0],
[0, 0, 0, 1, transmission_ratio45],
]
constants = [input_speed, 0, 0, 0, 0]
# solve
omegas = np.linalg.solve(coefficients_matrix, constants)
# speeds
rpms = kin.rpm(omegas)
omega1, omega2, omega3, omega4, omega5 = omegas
rpm1, rpm2, rpm3, rpm4, rpm5 = rpms
# DISPLAY RESULTS
# ---------------
gears = ['Gear 1', 'Gear 2', 'Gear 3', 'Gear 4', 'Gear 5']
cols = ['Description', 'Symbol'] + gears + ['Units']
data = [
['Number of teeth', '$z$', number_of_teeth1, number_of_teeth2, number_of_teeth3, number_of_teeth4, number_of_teeth5, '-'],
['Angular velocities', '$\omega$', omega1, omega2, omega3, omega4, omega5, '$\text{rad/s}$'],
['Revolutions per minute', 'RPM', rpm1, rpm2, rpm3, rpm4, rpm5, '$\text{rpm}$'],
]
kin.df_display(data, cols, gears)
```

Description | Symbol | Gear 1 | Gear 2 | Gear 3 | Gear 4 | Gear 5 | Units |
---|---|---|---|---|---|---|---|

Number of teeth | $z$ | 20.000 | 40.000 | 30.000 | 25.000 | 50.000 | - |

Angular velocities | $\omega$ | 1.000 | -0.500 | 0.667 | 0.667 | -0.333 | $\text{rad/s}$ |

Revolutions per minute | RPM | 9.549 | -4.775 | 6.366 | 6.366 | -3.183 | $\text{rpm}$ |

This section explains the kinematics of planetary gears, applicable to both spur and helical gearing. Planetary gear sets with the following number of planets are considered:

- One planet
- Three planets

Different planet counts are considered to demonstrate how the kinematics formulation changes with planet count. It will be shown how more than one planet results in a linearly dependent system of equations.

The mathematical model for kinematics of a planetary gear set can be formulated regardless of the gears being realized physically, e.g. assembly may be impossible. To learn more about planetary gearing, refer to our notebook on geometry of planetary gears.

This section formulates the kinematics of a planetary gear set with a single planet, as illustrated below. Many architectures exist for planetary gearing, but the most traditional layout is considered here.

Kinematics diagram of planetary gear set with 1 planet

A planetary gear set with a single planet is a 4-DOF system. Namely, rotation of the sun gear, planet gear, carrier, and ring gear. It may not be obvious yet, but the kinematics of the planetary gear set are unique in several ways. It will be shown that more than a single constraint must be imposed to create a solvable system, unlike the parallel gearing architectures considered previously.

One planet is considered only for the purpose of deriving the equations of kinematics.

The angular velocity of the planet must be considered carefully because the planet *processes* with the carrier, therefore its angular velocity can be interpreted in two ways:

- Local angular velocity of the planet about its own axis, $\vec{\omega}_p$, i.e. angular velocity relative to carrier.
- Global angular velocity of the planet, $\vec{\omega}_{pg}$, i.e. angular velocity relative to ground.

To visualize the difference, imagine that $\|\vec{\omega}_p\| = 0$ and $\|\vec{\omega}_c\| \neq 0$. It is tempting to think the planet does not rotate at all, and you would be correct if referring to its rotation relative to the carrier reference frame. However, relative to ground, the planet is rotating at the same angular velocity as the carrier. This so-called *ground velocity* of the planet gear is calculated as:

To formulate the kinematics of the planetary gear set, we will consider the linear velocity at the pitch point of each mesh per the illustration below.

Planetary gear mesh pitch point velocities

For the sun-planet gear mesh, the constraint equation for linear velocity at the pitch point is written as:

$$\vec{v}_s = \vec{v}_{ps}$$where $\vec{v}_{ps}$ is the linear *ground* velocity of the planet gear at the sun-planet mesh pitch point. From the figure, we can see how to write these linear velocity vectors as a function of angular velocities, which is what we are interested in solving:

where $r$ is pitch radius. Notice how the carrier angular velocity, $\vec{\omega}_c$, contributes to the linear ground velocity of the planet. By enforcing a consistent sign convention, the vector equation can be expressed in terms of its angular velocity components as:

$$\omega_s r_s = -\omega_p r_p + \omega_c r_s$$By defining a ratio analogous to a parallel gear mesh as:

$$i_{sp} = \frac{z_p}{z_s} = \frac{r_p}{r_s}$$The linear equation in its desired form is written as:

$$\omega_s + i_{sp} \omega_p - \omega_c = 0$$where it is obvious the gear mesh behaves as a parallel gear set when the carrier is stationary, $\omega_c = 0$.

For the planet-ring gear mesh, the constraint equation for linear velocity at the pitch point is written as:

$$\vec{v}_r = \vec{v}_{pr}$$where $\vec{v}_{pr}$ is the linear *ground* velocity of the planet gear at the planet-ring mesh pitch point. From the figure, we can see how to write these linear velocity vectors as a function of angular velocities, which is what we are interested in solving:

where $r$ is pitch radius. Notice how the carrier angular velocity, $\vec{\omega}_c$, contributes to the linear ground velocity of the planet. By enforcing a consistent sign convention, the vector equation can be expressed in terms of its angular velocity components as:

$$\omega_r r_r = \omega_p r_p + \omega_c r_r$$By defining a ratio analogous to a parallel gear mesh as:

$$i_{pr} = -\frac{z_r}{z_p} = -\frac{r_r}{r_p}$$where negative $(-)$ is used as the convention for an internal gear mesh. The linear equation in its desired form is written as:

$$\omega_p - i_{pr}\omega_c + i_{pr}\omega_r = 0$$where it is obvious the gear mesh behaves as a parallel gear set when the carrier is stationary, $\omega_c = 0$.

Two equations have been derived for the two gear meshes in the planetary gear set. However, it is a 4-DOF system and therefore cannot be solved yet. For the kinematics to be fully defined, we must impose *two* speed constraints on the system, independent of each other. Which speed constraints to apply depends on the application and how the planetary gear set is integrated within a drivetrain system.

If we arbitrarily choose to specify constant speeds for the sun and ring gears, two additional equations are written as:

$$\omega_s = \Omega_s$$$$\omega_r = \Omega_r$$Note that speed constraints can be imposed on *any* of the components to create a solvable system of equations. Finally, the system of equations for kinematics of a planetary gear set is assembled in matrix form as:

and numerical solvers can be used to solve the linear system.

This is one of characteristics that makes planetary gearing so interesting and useful. This enables planetary gear sets to be used in drivetrain systems with complex powerflows, such as automatic transmissions, regenerating drives, and power splitting drives.

In simpler applications, a planetary gear set has one component (sun, planet, carrier, or ring) constrained to ground, i.e. it cannot rotate but must react torque. The kinematics will differ depending on which component is constrained.

Angular velocities for ring and sun gears: $\omega_r, \omega_s$

In [8]:

```
# GIVEN
# -----
number_of_teeth_sun = 36
number_of_teeth_ring = 72
number_of_teeth_planet = 42
omega_sun = 1
omega_ring = 0
# SOLUTION
# --------
# formulate
ratio_sp = number_of_teeth_planet / number_of_teeth_sun
ratio_pr = - number_of_teeth_ring / number_of_teeth_planet
coefficients_matrix = [
[1, 0, 0, 0],
[1, ratio_sp, -1, 0],
[0, 1, -ratio_pr, ratio_pr],
[0, 0, 0, 1],
]
constants = [omega_sun, 0, 0, omega_ring]
# solve
omegas = np.linalg.solve(coefficients_matrix, constants)
# speeds
rpms = kin.rpm(omegas)
# DISPLAY RESULTS
# ---------------
gears = ['Sun', 'Planet', 'Carrier', 'Ring']
cols = ['Description', 'Symbol'] + gears + ['Units']
data = [
['Number of teeth', '$z$', number_of_teeth_sun, number_of_teeth_planet, None, number_of_teeth_ring, '-'],
['Angular velocities', '$\omega$', *omegas, '$\text{rad/s}$'],
['Revolutions per minute', 'RPM', *rpms, '$\text{rpm}$'],
]
kin.df_display(data, cols, gears)
# planet ground speed
kin.display_eqn(f'$\\omega_{{pg}} = {round(sum(omegas[1:3]), 3)} \\text{{ rad/s}}$')
```

Description | Symbol | Sun | Planet | Carrier | Ring | Units |
---|---|---|---|---|---|---|

Number of teeth | $z$ | 36.000 | 42.000 | NaN | 72.0 | - |

Angular velocities | $\omega$ | 1.000 | -0.571 | 0.333 | 0.0 | $\text{rad/s}$ |

Revolutions per minute | RPM | 9.549 | -5.457 | 3.183 | 0.0 | $\text{rpm}$ |

$\omega_{pg} = -0.238 \text{ rad/s}$

This section formulates the kinematics of a planetary gear set with a three planets, as illustrated below. Many architectures exist for planetary gearing, but the most traditional layout is considered here. Three planets is a common layout with attributes for robust planet load sharing under conditions of system errors caused by manufacturing, assembly, and operating deflections.

Kinematics diagram of planetary gear set with 3 planets

A planetary gear set with three planets is a 6-DOF system. Namely, rotation of the sun gear, three planet gears, carrier, and ring gear. The same concepts apply the three-planet system as were revied for the single-planet system. Deriving the equations for kinematics is analogous, but now the angular velocities of a second and third planet, $\omega_{p2}$ and $\omega_{p3}$, must be considered.

Before proceeding with the kinematics formulation, it must be known that each planet is required to have the same number of teeth for a valid planetary gear set.

$$z_{p1} = z_{p2} = z_{p3}$$Since the relationship of number of teeth and pitch radius is linearly proportional for cylindrical involute gearing, the pitch radii are also equal.

$$r_{p1} = r_{p2} = r_{p3}$$The sun-planet gear mesh equations derived for a single planet system remain valid, so we will apply those equations to the three-planet system as:

$$\omega_s + i_{sp} \omega_{p1} - \omega_c = 0$$$$\omega_s + i_{sp} \omega_{p2} - \omega_c = 0$$$$\omega_s + i_{sp} \omega_{p3} - \omega_c = 0$$where the same coefficient, $i_{sp}$, is used for each equation by acknowledging the relationship of pitch radii:

$$i_{sp} = \frac{r_{p1}}{r_s} = \frac{r_{p2}}{r_s} = \frac{r_{p3}}{r_s}$$Although we will continue with the use of these equations to fully define a solvable linear system, it is obvious that each planet must have the same angular velocity to satisfy these equations.

where the same coefficient, $i_{pr}$, is used for each equation by acknowledging the relationship of pitch radii:

$$i_{pr} = -\frac{r_r}{r_{p1}} = -\frac{r_r}{r_{p2}} = -\frac{r_r}{r_{p3}}$$where negative $(-)$ is used as the convention for an internal gear mesh. Again, it is obvious that each planet must have the same angular velocity to satisfy these equations, thus agreeing with the sun-planet equations.

Six equations have been derived for the six gear meshes in the planetary gear set. Despite being a 6-DOF system, we are *not* ready to solve it. You can try but will find that it is not solvable. This can be proved by calculating the rank of the coefficient matrix for the current system of equations:

Since the rank evaluates to four (4), which is less than the number of variables (6), the system of equations is linearly dependent. For the kinematics to be fully defined, two more equations are needed that independently define angular velocities in the system.

All mesh equations have been derived, therefore we must impose *two* speed constraints on the system that are *independent* of each other. Defining the speeds for two planets will not be sufficient, since they are *dependent*. Which speed constraints to apply depends on the application and how the planetary gear set is integrated within a drivetrain system.

If we arbitrarily choose to specify constant speeds for the sun and ring gears, two additional equations are written as:

$$\omega_s = \Omega_s$$$$\omega_r = \Omega_r$$Note that speed constraints can be imposed on *any* of the components to create a solvable system of equations. Finally, the system of equations for kinematics of a planetary gear set is assembled in matrix form as:

Despite creating a fully defined system, the linearly dependent equations have not been removed. This is why the coefficient matrix does not have $n \times n$ dimensions, where $n$ is the number of variables. There are two suggested approaches to solving a system of this type:

- Remove the linearly dependent equations by using Gaussian elimination, then calculate the exact solution.
- Use a least-squares solver to minimize any errors in the solution.

In the example below, the least-squares solution is used for its ease-of-use with existing solvers.

Angular velocities for ring and sun gears: $\omega_r, \omega_s$

In [7]:

```
# GIVEN
# -----
number_of_teeth_sun = 36
number_of_teeth_ring = 72
number_of_teeth_planet1 = 42
number_of_teeth_planet2 = number_of_teeth_planet1
number_of_teeth_planet3 = number_of_teeth_planet1
omega_sun = 1
omega_ring = 0
# SOLUTION
# --------
# formulate
ratio_sp = number_of_teeth_planet / number_of_teeth_sun
ratio_pr = - number_of_teeth_ring / number_of_teeth_planet
coefficients_matrix = [
[1, 0, 0, 0, 0, 0],
[1, ratio_sp, 0, 0, -1, 0],
[1, 0, ratio_sp, 0, -1, 0],
[1, 0, 0, ratio_sp, -1, 0],
[0, 1, 0, 0, -ratio_pr, ratio_pr],
[0, 0, 1, 0, -ratio_pr, ratio_pr],
[0, 0, 0, 1, -ratio_pr, ratio_pr],
[0, 0, 0, 0, 0, 1],
]
constants = [omega_sun, 0, 0, 0, 0, 0, 0, omega_ring]
# solve
omegas, res, rank, s = np.linalg.lstsq(coefficients_matrix, constants, rcond=1)
# speeds
w_s, w_p1, w_p2, w_p3, w_c, w_r = omegas
rpms = kin.rpm(omegas)
# DISPLAY RESULTS
# ---------------
gears = ['Sun', 'Planet 1', 'Planet 2', 'Planet 3', 'Carrier', 'Ring']
cols = ['Description', 'Symbol'] + gears + ['Units']
data = [
['Number of teeth', '$z$', number_of_teeth_sun, number_of_teeth_planet1, number_of_teeth_planet2, number_of_teeth_planet3, None, number_of_teeth_ring, '-'],
['Angular velocities', '$\omega$', *omegas, '$\text{rad/s}$'],
['Revolutions per minute', 'RPM', *rpms, '$\text{rpm}$'],
]
kin.df_display(data, cols, gears)
# planet ground speed - assumes equal for all planes
kin.display_eqn(f'$\\omega_{{pg}} = {round(w_p1 + w_c, 3)} \\text{{ rad/s}}$')
```

Description | Symbol | Sun | Planet 1 | Planet 2 | Planet 3 | Carrier | Ring | Units |
---|---|---|---|---|---|---|---|---|

Number of teeth | $z$ | 36.000 | 42.000 | 42.000 | 42.000 | NaN | 72.0 | - |

Angular velocities | $\omega$ | 1.000 | -0.571 | -0.571 | -0.571 | 0.333 | -0.0 | $\text{rad/s}$ |

Revolutions per minute | RPM | 9.549 | -5.457 | -5.457 | -5.457 | 3.183 | -0.0 | $\text{rpm}$ |

$\omega_{pg} = -0.238 \text{ rad/s}$

Continue reading the Drivetrain Hub | Notebook Series to learn more about rotational mechanics and drivetrain engineering.

Accurately model complex gear architectures in 3-dimensional space and solve the rotational kinematics with the Drivetrain Hub | Gears App, a modern drivetrain modeling environment 100% online at drivetrainhub.com.

Our notebooks are publicly hosted in GitHub repositories, available for anyone to view and propose edits.

- Engineering Mechanics: Dynamics, 12th Edition. Russell C. Hibbeler
- Matrix Analysis and Applied Linear Algebra. Carl D. Meyer