# Gear Ratios

A **gear ratio** is defined as the ratio between the number of teeth (or diameters) of two meshing gears:

$$
Gear Ratio = \frac{\text{Driven Gear Teeth}}{\text{Driving Gear Teeth}}
$$

* The **driving gear** is the gear powered by the motor.
* The **driven gear** is the gear connected to the mechanism.

Gear ratios modify torque and speed between the motor and the output mechanism. The motor's raw speed and torque values must be transformed accordingly for accurate control.

Different subsystems in FRC require different torque ranges depending on their mechanical load.

⚙️ Use this [gear ratio optimization tool](https://www.chiefdelphi.com/t/paper-jvns-mechanical-design-calculator-2016/146281/6) to help find efficient ratios given motor specs, torque needs, and speed requirements.

{% hint style="danger" %}
It is extremely important to communicate the ratios you need to the design team.\
An **under torqued subsystem will not perform reliably** and is very difficult to fix later in the season. Always verify torque requirements early!
{% endhint %}

***

#### Coding Considerations

* Encoders measure position or velocity at the **motor shaft**, not the output. As a result, it is necessary to scale these values in software:

```java
double gearRatio = 3.0;
double outputPosition = motorEncoder.getPosition() / gearRatio;
```

* PID Constants should be relative to the gear ratio, units example: volts/meterError
