Package yams.gearing
Class GearBox
java.lang.Object
yams.gearing.GearBox
GearBox class to calculate input and output conversion factors and check if the current configuration is supported.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondiv(double x) Divide the gear reduction ratio by X.static GearBoxfromReductionStages(double... reductionStages) Create the gearbox given the reduction stages of the gearbox.static GearBoxfromStages(String... stages) Create the gearbox given the reduction stages of the gearbox.doubleGet the conversion factor to transform the gearbox input into the gear box output rotations.doubleGet the conversion factor to transform the gearbox output value into the gear box input value.times(double x) Multiply the gear reduction ratio by X.
-
Constructor Details
-
GearBox
public GearBox(double[] reductionStage) Construct theGearBoxwith the reduction stages given.- Parameters:
reductionStage- Reduction stages where the number is > 0 to indicate a reduction.
-
GearBox
Construct theGearBoxwith the reduction stages given.- Parameters:
reductionStage- List of stages in the format of "IN:OUT".
-
-
Method Details
-
fromReductionStages
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
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
Multiply the gear reduction ratio by X.- Parameters:
x- X to multiply by.- Returns:
GearBoxfor chaining.
-
div
Divide the gear reduction ratio by X.- Parameters:
x- X to divide by.- Returns:
GearBoxfor 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
-