Package yams.gearing

Class GearBox

java.lang.Object
yams.gearing.GearBox

public class GearBox extends Object
GearBox class to calculate input and output conversion factors and check if the current configuration is supported.
  • Constructor Details

    • GearBox

      public GearBox(double[] reductionStage)
      Construct the GearBox with the reduction stages given.
      Parameters:
      reductionStage - Reduction stages where the number is > 0 to indicate a reduction.
    • GearBox

      public GearBox(String[] reductionStage)
      Construct the GearBox with the reduction stages given.
      Parameters:
      reductionStage - List of stages in the format of "IN:OUT".
  • Method Details

    • fromReductionStages

      public static GearBox fromReductionStages(double... reductionStages)
      Create the gearbox given the reduction stages of the gearbox.
      Parameters:
      reductionStages - Reduction stages where the number is > 0 to indicate a reduction.
      Returns:
      GearBox.
    • fromStages

      public static GearBox fromStages(String... stages)
      Create the gearbox given the reduction stages of the gearbox.
      Parameters:
      stages - Stages in the format of "IN:OUT". For example, "3:1"
      Returns:
      GearBox
    • times

      public GearBox times(double x)
      Multiply the gear reduction ratio by X.
      Parameters:
      x - X to multiply by.
      Returns:
      GearBox for chaining.
    • div

      public GearBox div(double x)
      Divide the gear reduction ratio by X.
      Parameters:
      x - X to divide by.
      Returns:
      GearBox for chaining.
    • getInputToOutputConversionFactor

      public double getInputToOutputConversionFactor()
      Get the conversion factor to transform the gearbox input into the gear box output rotations.
      Returns:
      OUT/IN or OUT:IN
    • getOutputToInputConversionFactor

      public double getOutputToInputConversionFactor()
      Get the conversion factor to transform the gearbox output value into the gear box input value.
      Returns:
      IN:OUT or IN/OUT