> For the complete documentation index, see [llms.txt](https://yagsl.gitbook.io/yams/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yagsl.gitbook.io/yams/documentation/how-to/how-to-find-your-mechanism-circumference.md).

# How to find your mechanism circumference?

<figure><img src="/files/7qY7Tsv4CrhaDnlPHbJU" alt=""><figcaption></figcaption></figure>

Mechanism circumference is used to convert mechanism rotations to measurements. This is primarily useful for Elevators or Linear Slides where the primary unit of control is in `Distance` (usually meters).&#x20;

Your **Mechanism Circumference** is the circumference of your final sprocket/gear which translates directly to Distance.

For elevators this is the drum circumference $$c = 2\*\pi \* r$$ OR if driven by a sprocket $$c = pitch\*teeth$$

{% hint style="warning" %}
Remember that you measurement ≠ actual height of the mechanism UNLESS you set the elevator starting height to be relative to the floor AND adjust your limits accordingly
{% endhint %}

## Set the circumference in YAMS

```java
SmartMotorControllerConfig smcConfig = new SmartMotorControllerConfig(this)
  .withControlMode(ControlMode.CLOSED_LOOP)
  // Mechanism Circumference is the distance traveled by each mechanism rotation converting rotations to meters.
  .withMechanismCircumference(Meters.of(Inches.of(0.25).times(22).in(Meters)))
  .withMechanismCircumference(Inches.of(4).times(Math.PI)) // 4in * PI
  .withWheelDiameter(Inches.of(4)) // Same as above
  .withWheelRadius(Inches.of(2)) // Same as above
  .withStartingPosition(Meters.of(0));
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yagsl.gitbook.io/yams/documentation/how-to/how-to-find-your-mechanism-circumference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
