> For the complete documentation index, see [llms.txt](https://yams.yassrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yams.yassrobotics.com/documentation/reference/mechanism-configs/arm-config.md).

# ArmConfig

An arm is a mechanism that swings about a pivot and has to hold itself up against gravity. The [Arms](https://yams.yassrobotics.com/documentation/understanding/arms.md) page shows a complete arm.

`ArmConfig` has the [shared options](https://yams.yassrobotics.com/documentation/reference/mechanism-configs/shared-options.md) and one of its own.

## `withLength`

The length of the arm, from the pivot to its end.

<figure><img src="https://1354553280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZM0CFmYiQzcrY4zDcTtZ%2Fuploads%2Fgit-blob-afeaf6518bd6bf813e17b35d6216581bc8c83757%2Fmech-arm.png?alt=media" alt="An arm drawn at 40 degrees above a level dashed line marked 0 degrees, with straight up marked 90 degrees. Its length, set by withLength, runs from the pivot to the end of the arm, and gravity pulls down on the end. Level is zero because gravity pulls hardest on a level arm and ArmFeedforward uses kG times the cosine of the angle."><figcaption><p>An arm's angle is measured from level, and its length sets how hard it is to move.</p></figcaption></figure>

```java
new ArmConfig().withLength(Feet.of(3));
```

The simulation uses the length for its physics and for the drawing. A longer arm is harder to hold and to swing, so retune the gains if the length changes.

**Used in:** simulation only. **Required** for an `Arm` to be created in simulation.

## Zero is level

Angles on an `Arm` are measured from level: 0° is parallel to the ground and 90° is straight up. That is what [`ArmFeedforward`](https://yams.yassrobotics.com/documentation/reference/editor/config/feedforward.md#withfeedforward) expects, and it is why an arm's encoder must read 0 when the arm is level.

* With an absolute encoder, set its [zero offset](https://yams.yassrobotics.com/documentation/reference/editor/config/encoders.md#withexternalencoderzerooffset) so it reads 0 when the arm is level.
* Without one, set a [starting position](https://yams.yassrobotics.com/documentation/reference/editor/config/encoders.md#withstartingposition) and always turn the robot on with the arm there.

## What else an arm needs

| For                            | Use                                                                                                                                                              |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The physical stops             | [`withHardLimits`](https://yams.yassrobotics.com/documentation/reference/mechanism-configs/shared-options.md#withhardlimits) on `ArmConfig`                      |
| The limits the motor obeys     | [`withSoftLimits`](https://yams.yassrobotics.com/documentation/reference/editor/config/limits-and-protection.md#withsoftlimits) on the motor config              |
| The arm's weight in simulation | [`withMomentOfInertia(length, mass)`](https://yams.yassrobotics.com/documentation/reference/editor/config/simulation.md#withmomentofinertia) on the motor config |
| Holding against gravity        | [`ArmFeedforward`](https://yams.yassrobotics.com/documentation/reference/editor/config/feedforward.md#withfeedforward) with `kG`                                 |
| An absolute encoder            | [How do I use absolute encoders on my arm?](https://yams.yassrobotics.com/documentation/how-to-mechanisms/how-do-i-use-absolute-encoders-on-my-arm.md)           |

## Code reference

* [`ArmConfig`](https://github.com/Yet-Another-Software-Suite/YAMS/blob/master/yams/java/yams/core/mechanisms/config/ArmConfig.java)
* [`Arm`](https://github.com/Yet-Another-Software-Suite/YAMS/blob/master/yams/java/yams/core/mechanisms/positional/Arm.java)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://yams.yassrobotics.com/documentation/reference/mechanism-configs/arm-config.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
