# Documentation

## Basic Motion, Torque, and Force Modeling

### About Inertia, Motion, and Gears

The purpose of a gear set is to transfer rotational motion and torque at a known ratio from one driveline axis to another. This section introduces you to modeling gears and using them to couple bodies rotating on driveline axes.

 Note:   The concepts and examples of this section explain angular gears in relation to rotational motion and torque. Analogous rules apply to linear gears, and translational motion and force.

### Couple Rotational Motion with Gears

A gear set consists of two or more meshed gears rotating together at some specified gear ratios. By convention, SimDriveline™ gear ratios are constant. The gear ratios determine how angular velocity and torque are transferred from one driveline component to another.

#### Gear Coupling Rules

Ideal gears mesh and rotate together at a point of contact without frictional loss or slippage.

The simplest gear coupling consists of two circular gear wheels of radii r1 and r2, spinning with angular velocities ω1 and ω2, respectively, and lying in the same plane. Their connected shafts are parallel and carry torques τ1 and τ2. The gear ratio of gear 2 to gear 1 is the ratio of their respective radii: g12 = r2/r1. The power transferred along either shaft is ω·τ.

The gear coupling is often specified in terms of the number of gear teeth on each gear, N1 and N2. The gear ratio of gear 2 to gear 1 is then g12 = N2/N1 = r2/r1.

The fundamental conditions on the simple gear coupling of rotational motion are ω2/ω1 = ±1/g12 and τ2/τ1 = ±g12. That is, the ratio of angular velocities is the reciprocal of the ratio of radii, while the ratio of torques is the ratio of radii. The transferred power, being the product of angular velocity and torque, is the same on either shaft.

The choice of signs indicates that the gears can spin in the same or in opposite directions. If the gears are external to one another (rotating together on their respective outside surfaces), they rotate in opposite directions. If the gears are internal to one another (rotating together with the outside of the smaller gear meshing with inside of the larger gear), they rotate in the same direction.

 Caution   Gear ratios in driveline model blocks must be strictly positive. Vanishing or negative gear ratios cause SimDriveline simulation to stop with an error at model initialization. If you need to reverse the relative rotation direction of a shaft connected to a gear, you can change the direction in the gear block dialog box.

#### Generalized Gear Coupling Rules

If you are coupling gears that are not constant in radii, not lying in the same plane, or not circular, you need the general ideal gear coupling conditions.

The general velocity constraint requires that the linear velocities of the gears at the point of contact be the same. This is a vector condition on the angular velocities ω1 and ω2 and the radius vectors r1 and r2: ω1r1 = ω2r2. The alternative form in terms of the number of gear teeth is equivalent to this linear velocity constraint. For the gear teeth to mesh, the number of teeth per unit length of gear circumference must be the same on the two gears.

The general torque condition arises from the force equilibrium at the point of contact. If there is no linear motion of the whole gear assembly, the forces at contact F must be equal and opposite. The ratio of torques is then:

|τ2|/|τ1| = |r2F|/|r1F|

The power transferred along either shaft is conserved across ideal gear couplings:

ω2·(r2F) = ω1·(r1F)

### Couple Two Spinning Inertias with Simple Gear

In this example, you couple two spinning inertias, first, along a single shaft (driveline axis), so that they spin with the same angular velocity; then spinning along two shafts and coupled by a gear so that they spin at different velocities; and finally, coupled by a gear and actuated by an external torque, spinning at different rates and experiencing different torques. You use the most basic Simscape™ mechanical and SimDriveline blocks, such as Inertia, Simple Gear, and Solver Configuration.

#### Modeling Two Spinning Inertias

Create the first version of the simplest, nontrivial driveline model, two inertias spinning together along the same axis. Open the SimDriveline, Simscape, and Simulink® block libraries and a new Simulink model window.

1. Drag and drop two Inertia, two Ideal Rotational Motion Sensor, two Mechanical Rotational Reference, and two PS-Simulink Converter blocks into the model window.

2. From the Simscape Utilities library, drag a Solver Configuration block. Every topologically distinct driveline block diagram requires exactly one instance of this block.

3. From the Simulink library, drag and drop a Scope, a Mux, and two pairs of Goto and From blocks. Connect the blocks as shown in the following figures. The sensor subsystems are arranged hierarchically.

Model with Two Spinning Inertias

Sensor Subsystem

Motion Sensor Subsystem

4. Open each Inertia block. In the Variables tab, select the Rotational velocity checkbox and set the Value parameter to pi radians/second (rad/s). The connection line between the two Inertia blocks requires them to have the same rotational velocity.

5. Open the Scope block and start the simulation. The two angular velocities are constant at 3.14 radians/second.

#### Coupling Two Spinning Inertias with a Simple Gear

Now you modify the model you just created by coupling the two spinning inertias with a simple, ideal gear with a fixed gear ratio.

1. From the SimDriveline block library, drag and drop a Simple Gear block into your model. Open the block. Change the default follower-base gear ratio value to 1. Change the Output shaft rotates menu to In same direction as input shaft and click OK. The simple gear then represents two gear wheels rotating together at the same rate in the same direction, with one wheel inside the other. Connect the blocks as shown in the following figure.

Model with Two Spinning Inertias Coupled by a Gear

Leave the initial angular velocities at pi in the Inertia blocks.

2. Open the Scope and start the simulation. The two angular velocities are constant at 3.14 radians/second for both Inertias.

3. Change the Output shaft rotates menu back to In opposite direction to input shaft. The simple gear then becomes two wheels rotating together in opposite directions, with the two wheels meshed on their respective outer surfaces. Change initial velocity in Inertia2 to -pi.

4. Restart the simulation. The two angular velocities are 3.14 and –3.14 radians/second for Inertia1 and Inertia2, respectively. The second angular velocity is the same, but with opposite sign, because the two bodies are spinning in opposite directions.

5. Change the Output shaft rotates menu again to In same direction as input shaft.

#### Torque-Actuating Two Coupled, Spinning Inertias

In the final version of the simple gear model, you actuate the inertias with an external torque instead of starting them with fixed initial angular velocities. The external torque varies sinusoidally. You can find a completed version of this model in the sdl_simple_gear example model.

1. From the Simscape Foundation library, copy an Ideal Torque Source and two Ideal Torque Sensor blocks, plus a Simulink-PS Converter block and another Mechanical Rotational Reference block. From the Simulink library, drag and drop a Sine Wave block and two more pairs of Goto and From blocks.

2. Connect the blocks as shown in the following figures. Note that the Torque Sensor subsystems are arranged in parallel with the Motion Sensor subsystems inside the Sensor subsystem blocks. Set the initial velocities of both Inertias to zero. Modify the Scope block to add another axis for measuring the torques. Connect the other blocks as shown.

Model with Two Spinning Inertias Coupled by a Gear and Actuated with Torque

Updated Sensor Subsystem

Torque Sensor Subsystem

3. Open the Scope block and start the simulation.

The measured torques and angular velocities vary sinusoidally. As in the preceding models, the angular velocity of Inertia2 is half that of Inertia1. The torque in the second (follower) shaft is twice that in the first, as required by the laws of gear coupling.

If you change the Output shaft rotates menu to In opposite direction to input shaft in Simple Gear and restart the simulation, the same angular velocities and torques result, except that the values associated with Inertia2 and the second shaft are negative, because the second body and second shaft are spinning in opposite directions.

#### Sensing and Actuating Motion and Torque

The mechanical sensor and source blocks that you use in the preceding models illustrate their dual nature. They act as driveline components themselves, but also let you inject and extract physical signals associated with motion and torque, including the correct physical units. You can use these physical signals with other blocks in the Simscape physical modeling environment, or convert them to dimensionless Simulink signals for use in the nonphysical part of your model. Both sensor and source blocks have pairs of mechanical ports and are connected either in series with or across physical connection lines.

• Mechanical sensor and source blocks have both mechanical conserving ports and physical signal ports .

Many SimDriveline blocks also feature a mix of mechanical conserving and physical signal ports.

• An Ideal Torque Source injects torque along, or in series with, the driveline connection line. An Ideal Torque Sensor measures the torque flowing along, or in series with, the driveline connection line.

• An Ideal Rotational Motion Sensor reports the difference between the motions at its two connection ports.

If you want to extract the absolute motion at its R port, connect the C port to a mechanical reference block that grounds that port to zero motion.

### Couple Two Spinning Inertias with Variable Ratio Transmission

You can modify the simple gear model further by replacing the fixed-ratio gear with a transmission whose gear ratio varies in time. You specify the gear ratio variation with a Simulink signal converted to a unitless physical signal. Start with the simple gear model you built in the preceding section or by opening and editing the sdl_simple_gear example.

1. From the SimDriveline block library, drag and drop a Variable Ratio Transmission block and replace the Simple Gear block with it. Open the Variable Ratio Transmission block dialog box and make sure that the Output shaft rotates parameter is set to In same direction as input (the default setting). The two shafts will spin in the same direction. Ignore the other settings and close the block dialog box.

2. The Variable Ratio Transmission block accepts the continuously varying gear ratio as a physical signal Simulink signal through the extra physical signal input labeled r. For this example, create a variable signal for the gear ratio with a Signal Builder block from the Simulink block library and Simulink-PS Converter block. Build a signal that rises with constant slope from 1 to 2 over 10 seconds. Then connect the converted physical signal to the r port.

Simple Variable Ratio Transmission Model

3. Do not change the other, original settings of the simple gear model. Open the Scope and start the simulation.

The angular velocities and torques of the two shafts have the same signs. The ratios of angular velocities and torques start at 1, because the initial gear ratio is 1. As the gear ratio increases toward 2, the angular velocity of Inertia2 becomes smaller than that of Inertia1, while the associated torque in the second shaft becomes larger than that in the first shaft. Because of the changing gear ratio, the motion and the torques are no longer strictly sinusoidal, even though the actuating external torque is.

The sdl_variable_gear example is a full model of this type. To learn more about how to use variable gear ratios, consult the Variable Ratio Transmission block reference page.

### Couple Three Spinning Inertias with Planetary Gear

You can further modify the simple gear model and use it as a starting point for studying more complex gear sets. One of the most important complex gear sets is the planetary gear, which has three wheels, the ring, the sun, and the planet, all held in place by a common carrier body. The planetary gear is important because it is a common component in complex, realistic transmissions.

1. Replace the Simple Gear in your model with a Planetary Gear from the SimDriveline block library. A planetary gear splits input angular motion from the carrier between the ring and sun wheels, each connected to their respective bodies.

2. Copy another Inertia and two more Ideal Rotational Motion Sensors. Connect the blocks to form the new diagram as shown in the following figure. In this example, the torque source and the motion sensors are organized into the Torque Actuator and Motion Sensor subsystems.

Simple Planetary Gear Model

3. Enter 2 for the Ring to sun teeth ratio in Planetary Gear. Open the Scope and start the simulation to observe the angular velocities of the ring, carrier, and sun, from largest to smallest. The ratio of the ring to sun gear velocities is always 2.

4. To see the ring and sun wheels spinning alone, you must lock the carrier. In this case, you switch the torque actuation to the ring wheel. Copy a Mechanical Rotational Reference block from the Simscape Foundation library. Disconnect and delete Inertia, replacing it on the carrier driveline axis with the reference block, and reconnect the Solver Configuration block to this connection line.

5. Reconnect the Torque Actuator subsystem and Sine Wave block as shown in the following figure.

Simple Planetary Gear Model with Locked Carrier

6. Open the Scope and start your model. Observe the angular velocities of the ring, carrier, and sun.

The carrier, connected to Mechanical Rotational Reference, does not move. The ring is driven with a sinusoidal torque, and the sun responds by spinning in the opposite direction (ring and sun gear wheels are external to one another) at twice the rate. The ring wheel has twice the radius (or twice the number of teeth) as the sun, so it spins half as fast.