Class CurrentLimitsConfigs
- All Implemented Interfaces:
ParentConfiguration,ISerializable,Cloneable
Contains the supply/stator current limit thresholds and whether to enable them.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleThe amount of current allowed in the motor (motoring and regen current).booleanEnable motor stator current limiting.doubleThe absolute maximum amount of supply current allowed.booleanEnable motor supply current limiting.doubleThe amount of supply current allowed after the regular SupplyCurrentLimit is active for longer than SupplyCurrentLowerTime.doubleReduces supply current to the SupplyCurrentLowerLimit after limiting to SupplyCurrentLimit for this period of time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()final StatusCodedeserialize(String to_deserialize) Take a string and deserialize it to this configuration group.final CurrentHelper method to get this configuration's StatorCurrentLimit parameter converted to a unit type.final CurrentHelper method to get this configuration's SupplyCurrentLimit parameter converted to a unit type.final CurrentHelper method to get this configuration's SupplyCurrentLowerLimit parameter converted to a unit type.final TimeHelper method to get this configuration's SupplyCurrentLowerTime parameter converted to a unit type.final StringGet the serialized form of this configuration group.toString()final CurrentLimitsConfigswithStatorCurrentLimit(double newStatorCurrentLimit) Modifies this configuration's StatorCurrentLimit parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithStatorCurrentLimit(Current newStatorCurrentLimit) Modifies this configuration's StatorCurrentLimit parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithStatorCurrentLimitEnable(boolean newStatorCurrentLimitEnable) Modifies this configuration's StatorCurrentLimitEnable parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithSupplyCurrentLimit(double newSupplyCurrentLimit) Modifies this configuration's SupplyCurrentLimit parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithSupplyCurrentLimit(Current newSupplyCurrentLimit) Modifies this configuration's SupplyCurrentLimit parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithSupplyCurrentLimitEnable(boolean newSupplyCurrentLimitEnable) Modifies this configuration's SupplyCurrentLimitEnable parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithSupplyCurrentLowerLimit(double newSupplyCurrentLowerLimit) Modifies this configuration's SupplyCurrentLowerLimit parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithSupplyCurrentLowerLimit(Current newSupplyCurrentLowerLimit) Modifies this configuration's SupplyCurrentLowerLimit parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithSupplyCurrentLowerTime(double newSupplyCurrentLowerTime) Modifies this configuration's SupplyCurrentLowerTime parameter and returns itself for method-chaining and easier to use config API.final CurrentLimitsConfigswithSupplyCurrentLowerTime(Time newSupplyCurrentLowerTime) Modifies this configuration's SupplyCurrentLowerTime parameter and returns itself for method-chaining and easier to use config API.
-
Field Details
-
StatorCurrentLimit
The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.For torque current control, this is applied in addition to the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs.
Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.
A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 120
- Units: A
-
StatorCurrentLimitEnable
Enable motor stator current limiting.- Default Value: True
-
SupplyCurrentLimit
The absolute maximum amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentLowerLimit and SupplyCurrentLowerTime to reduce the supply current limit after the time threshold is exceeded.Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in scenarios where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, it is important to note that such brownouts may be caused by a bad battery or poor power wiring.
A reasonable starting point for a supply current limit is 70 A with a lower limit of 40 A after 1.0 second. Supply current limits commonly range from 20-80 A depending on the breaker used.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 70
- Units: A
-
SupplyCurrentLimitEnable
Enable motor supply current limiting.- Default Value: True
-
SupplyCurrentLowerLimit
The amount of supply current allowed after the regular SupplyCurrentLimit is active for longer than SupplyCurrentLowerTime. This allows higher current draws for a fixed period of time before reducing the current limit to protect breakers. This has no effect if SupplyCurrentLimit is lower than this value or SupplyCurrentLowerTime is 0.- Minimum Value: 0.0
- Maximum Value: 500
- Default Value: 40
- Units: A
-
SupplyCurrentLowerTime
Reduces supply current to the SupplyCurrentLowerLimit after limiting to SupplyCurrentLimit for this period of time. If this is set to 0, SupplyCurrentLowerLimit will be ignored.- Minimum Value: 0.0
- Maximum Value: 5.0
- Default Value: 1.0
- Units: seconds
-
-
Constructor Details
-
CurrentLimitsConfigs
public CurrentLimitsConfigs()
-
-
Method Details
-
withStatorCurrentLimit
Modifies this configuration's StatorCurrentLimit parameter and returns itself for method-chaining and easier to use config API.The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.
For torque current control, this is applied in addition to the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs.
Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.
A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 120
- Units: A
- Parameters:
newStatorCurrentLimit- Parameter to modify- Returns:
- Itself
-
withStatorCurrentLimit
Modifies this configuration's StatorCurrentLimit parameter and returns itself for method-chaining and easier to use config API.The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.
For torque current control, this is applied in addition to the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs.
Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.
A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 120
- Units: A
- Parameters:
newStatorCurrentLimit- Parameter to modify- Returns:
- Itself
-
getStatorCurrentLimitMeasure
Helper method to get this configuration's StatorCurrentLimit parameter converted to a unit type. If not using the Java units library,StatorCurrentLimitcan be accessed directly instead.The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.
For torque current control, this is applied in addition to the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs.
Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.
A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 120
- Units: A
- Returns:
- StatorCurrentLimit
-
withStatorCurrentLimitEnable
Modifies this configuration's StatorCurrentLimitEnable parameter and returns itself for method-chaining and easier to use config API.Enable motor stator current limiting.
- Default Value: True
- Parameters:
newStatorCurrentLimitEnable- Parameter to modify- Returns:
- Itself
-
withSupplyCurrentLimit
Modifies this configuration's SupplyCurrentLimit parameter and returns itself for method-chaining and easier to use config API.The absolute maximum amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentLowerLimit and SupplyCurrentLowerTime to reduce the supply current limit after the time threshold is exceeded.
Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in scenarios where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, it is important to note that such brownouts may be caused by a bad battery or poor power wiring.
A reasonable starting point for a supply current limit is 70 A with a lower limit of 40 A after 1.0 second. Supply current limits commonly range from 20-80 A depending on the breaker used.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 70
- Units: A
- Parameters:
newSupplyCurrentLimit- Parameter to modify- Returns:
- Itself
-
withSupplyCurrentLimit
Modifies this configuration's SupplyCurrentLimit parameter and returns itself for method-chaining and easier to use config API.The absolute maximum amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentLowerLimit and SupplyCurrentLowerTime to reduce the supply current limit after the time threshold is exceeded.
Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in scenarios where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, it is important to note that such brownouts may be caused by a bad battery or poor power wiring.
A reasonable starting point for a supply current limit is 70 A with a lower limit of 40 A after 1.0 second. Supply current limits commonly range from 20-80 A depending on the breaker used.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 70
- Units: A
- Parameters:
newSupplyCurrentLimit- Parameter to modify- Returns:
- Itself
-
getSupplyCurrentLimitMeasure
Helper method to get this configuration's SupplyCurrentLimit parameter converted to a unit type. If not using the Java units library,SupplyCurrentLimitcan be accessed directly instead.The absolute maximum amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentLowerLimit and SupplyCurrentLowerTime to reduce the supply current limit after the time threshold is exceeded.
Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in scenarios where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, it is important to note that such brownouts may be caused by a bad battery or poor power wiring.
A reasonable starting point for a supply current limit is 70 A with a lower limit of 40 A after 1.0 second. Supply current limits commonly range from 20-80 A depending on the breaker used.
- Minimum Value: 0.0
- Maximum Value: 800.0
- Default Value: 70
- Units: A
- Returns:
- SupplyCurrentLimit
-
withSupplyCurrentLimitEnable
Modifies this configuration's SupplyCurrentLimitEnable parameter and returns itself for method-chaining and easier to use config API.Enable motor supply current limiting.
- Default Value: True
- Parameters:
newSupplyCurrentLimitEnable- Parameter to modify- Returns:
- Itself
-
withSupplyCurrentLowerLimit
Modifies this configuration's SupplyCurrentLowerLimit parameter and returns itself for method-chaining and easier to use config API.The amount of supply current allowed after the regular SupplyCurrentLimit is active for longer than SupplyCurrentLowerTime. This allows higher current draws for a fixed period of time before reducing the current limit to protect breakers. This has no effect if SupplyCurrentLimit is lower than this value or SupplyCurrentLowerTime is 0.
- Minimum Value: 0.0
- Maximum Value: 500
- Default Value: 40
- Units: A
- Parameters:
newSupplyCurrentLowerLimit- Parameter to modify- Returns:
- Itself
-
withSupplyCurrentLowerLimit
Modifies this configuration's SupplyCurrentLowerLimit parameter and returns itself for method-chaining and easier to use config API.The amount of supply current allowed after the regular SupplyCurrentLimit is active for longer than SupplyCurrentLowerTime. This allows higher current draws for a fixed period of time before reducing the current limit to protect breakers. This has no effect if SupplyCurrentLimit is lower than this value or SupplyCurrentLowerTime is 0.
- Minimum Value: 0.0
- Maximum Value: 500
- Default Value: 40
- Units: A
- Parameters:
newSupplyCurrentLowerLimit- Parameter to modify- Returns:
- Itself
-
getSupplyCurrentLowerLimitMeasure
Helper method to get this configuration's SupplyCurrentLowerLimit parameter converted to a unit type. If not using the Java units library,SupplyCurrentLowerLimitcan be accessed directly instead.The amount of supply current allowed after the regular SupplyCurrentLimit is active for longer than SupplyCurrentLowerTime. This allows higher current draws for a fixed period of time before reducing the current limit to protect breakers. This has no effect if SupplyCurrentLimit is lower than this value or SupplyCurrentLowerTime is 0.
- Minimum Value: 0.0
- Maximum Value: 500
- Default Value: 40
- Units: A
- Returns:
- SupplyCurrentLowerLimit
-
withSupplyCurrentLowerTime
Modifies this configuration's SupplyCurrentLowerTime parameter and returns itself for method-chaining and easier to use config API.Reduces supply current to the SupplyCurrentLowerLimit after limiting to SupplyCurrentLimit for this period of time. If this is set to 0, SupplyCurrentLowerLimit will be ignored.
- Minimum Value: 0.0
- Maximum Value: 5.0
- Default Value: 1.0
- Units: seconds
- Parameters:
newSupplyCurrentLowerTime- Parameter to modify- Returns:
- Itself
-
withSupplyCurrentLowerTime
Modifies this configuration's SupplyCurrentLowerTime parameter and returns itself for method-chaining and easier to use config API.Reduces supply current to the SupplyCurrentLowerLimit after limiting to SupplyCurrentLimit for this period of time. If this is set to 0, SupplyCurrentLowerLimit will be ignored.
- Minimum Value: 0.0
- Maximum Value: 5.0
- Default Value: 1.0
- Units: seconds
- Parameters:
newSupplyCurrentLowerTime- Parameter to modify- Returns:
- Itself
-
getSupplyCurrentLowerTimeMeasure
Helper method to get this configuration's SupplyCurrentLowerTime parameter converted to a unit type. If not using the Java units library,SupplyCurrentLowerTimecan be accessed directly instead.Reduces supply current to the SupplyCurrentLowerLimit after limiting to SupplyCurrentLimit for this period of time. If this is set to 0, SupplyCurrentLowerLimit will be ignored.
- Minimum Value: 0.0
- Maximum Value: 5.0
- Default Value: 1.0
- Units: seconds
- Returns:
- SupplyCurrentLowerTime
-
toString
-
serialize
Get the serialized form of this configuration group.- Specified by:
serializein interfaceISerializable- Returns:
- Serialized form of this config group
-
deserialize
Take a string and deserialize it to this configuration group.- Specified by:
deserializein interfaceParentConfiguration- Returns:
- Return code of the deserialize method
-
clone
-