Configure a One-Axis Gantry

Configure a oneaxis gantry to integrate a one-axis gantry into your robot:

Navigate to the Config tab of your robot’s page in the Viam app. Click on the Components subtab and navigate to the Create component menu. Enter a name for your sensor, select the type gantry, and select the oneaxis model.

Click Create component.

Creation of a one-axis gantry component in the Viam app config builder.

Edit and fill in the attributes as applicable.

{
  "components": [
    // < Your motor config >
    {
      "name": "<your-oneaxis-gantry-name>",
      "type": "gantry",
      "model": "oneaxis",
      "attributes": {
        "motor": "<your-motor-name>",
        "length_mm": <int>,
        "axis": {
          "X": <int>,
          "Y": <int>,
          "Z": <int>
        }
      },
      "depends_on": []
    }
  ]
}

The following attributes are available for oneaxis gantries:

AttributeTypeInclusionDescription
length_mmintRequiredLength of the axis of the gantry in millimeters.
motorstringRequiredname of the motor that moves the gantry’s actuator.
axisobjectRequiredThe translational axis for the gantry. Must be exactly one of x, y, or z.
boardOptionalstringname of the board containing the limit switches and pins. If limit_pins exist, board is required.
limit_pinsOptionalobjectThe boards’s pins attached to the limit switches on either end. If the motor used does not include an encoder, limit_pins are required to be set.
limit_pin_enabled_highbooleanOptionalWhether the limit pins are enabled.
Default: false
mm_per_revintOptionalHow far the gantry moves (linear, distance in mm) per one revolution of the motor’s output shaft. This typically corresponds to Distance = PulleyDiameter * pi, or the pitch of a linear screw.
gantry_rpmintOptionalThe gantry motor’s default revolutions per minute (RPM).


Have questions, or want to meet other people working on robots? Join our Community Discord.