#include <SparkBaseConfig.h>
Inherits rev::spark::BaseConfig.
Inherited by rev::spark::SparkFlexConfig, and rev::spark::SparkMaxConfig.
◆ IdleMode
◆ SparkBaseConfig() [1/3]
rev::spark::SparkBaseConfig::SparkBaseConfig |
( |
| ) |
|
|
default |
◆ ~SparkBaseConfig()
rev::spark::SparkBaseConfig::~SparkBaseConfig |
( |
| ) |
|
|
overridedefault |
◆ SparkBaseConfig() [2/3]
◆ SparkBaseConfig() [3/3]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Apply() [1/8]
◆ Apply() [2/8]
◆ Apply() [3/8]
◆ Apply() [4/8]
◆ Apply() [5/8]
◆ Apply() [6/8]
◆ Apply() [7/8]
◆ Apply() [8/8]
◆ SetIdleMode()
Sets the idle mode setting for the SPARK.
- Parameters
-
- Returns
- The modified SparkBaseConfig object for method chaining
◆ Inverted()
Common interface for inverting direction of a speed controller.
This call has no effect if the controller is a follower. To invert a follower, see the follow() method.
- Parameters
-
inverted | True for inverted |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ SmartCurrentLimit()
SparkBaseConfig & SparkBaseConfig::SmartCurrentLimit |
( |
int |
stallLimit, |
|
|
int |
freeLimit = 0 , |
|
|
int |
limitRpm = 20000 |
|
) |
| |
|
virtual |
Sets the current limit in Amps.
The motor controller will reduce the controller voltage output to avoid surpassing this limit. This limit is enabled by default and used for brushless only. This limit is highly recommended when using the NEO brushless motor.
The NEO Brushless Motor has a low internal resistance, which can mean large current spikes that could be enough to cause damage to the motor and controller. This current limit provides a smarter strategy to deal with high current draws and keep the motor and controller operating in a safe region.
The controller can also limit the current based on the RPM of the motor in a linear fashion to help with controllability in closed loop control. For a response that is linear the entire RPM range leave limit RPM at 0.
- Parameters
-
stallLimit | The current limit in Amps at 0 RPM. |
freeLimit | The current limit at free speed (5700RPM for NEO). |
limitRpm | RPM less than this value will be set to the stallLimit, RPM values greater than limitRpm will scale linearly to freeLimit |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ SecondaryCurrentLimit()
SparkBaseConfig & SparkBaseConfig::SecondaryCurrentLimit |
( |
double |
limit, |
|
|
int |
chopCycles = 0 |
|
) |
| |
|
virtual |
Sets the secondary current limit in Amps.
The motor controller will disable the output of the controller briefly if the current limit is exceeded to reduce the current. This limit is a simplified 'on/off' controller. This limit is enabled by default but is set higher than the default Smart Current Limit.
The time the controller is off after the current limit is reached is determined by the parameter limitCycles, which is the number of PWM cycles (20kHz). The recommended value is the default of 0 which is the minimum time and is part of a PWM cycle from when the over current is detected. This allows the controller to regulate the current close to the limit value.
The total time is set by the equation t = (50us - t0) + 50us * limitCycles t = total off time after over current t0 = time from the start of the PWM cycle until over current is detected
- Parameters
-
limit | The current limit in Amps. |
chopCycles | The number of additional PWM cycles to turn the driver off after overcurrent is detected. |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ OpenLoopRampRate()
Sets the ramp rate for open loop control modes.
This is the maximum rate at which the motor controller's output is allowed to change.
- Parameters
-
rate | Time in seconds to go from 0 to full throttle. |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ ClosedLoopRampRate()
Sets the ramp rate for closed loop control modes.
This is the maximum rate at which the motor controller's output is allowed to change.
- Parameters
-
rate | Time in seconds to go from 0 to full throttle. |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ VoltageCompensation()
SparkBaseConfig & SparkBaseConfig::VoltageCompensation |
( |
double |
nominalVoltage | ) |
|
|
virtual |
Sets the voltage compensation setting for all modes on the SPARK and enables voltage compensation.
- Parameters
-
nominalVoltage | Nominal voltage to compensate output to |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ DisableVoltageCompensation()
Disables the voltage compensation setting for all modes on the SPARK.
- Returns
- The modified SparkBaseConfig object for method chaining
◆ Follow() [1/2]
SparkBaseConfig & SparkBaseConfig::Follow |
( |
int |
leaderCanId, |
|
|
bool |
invert = false |
|
) |
| |
|
virtual |
Causes this controller's output to mirror the provided leader.
Only voltage output is mirrored. Settings changed on the leader do not affect the follower.
Following anything other than a CAN-enabled SPARK is not officially supported.
- Parameters
-
leaderCanId | The CAN ID of the device to follow. |
invert | Set the follower to output opposite of the leader |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ Follow() [2/2]
Causes this controller's output to mirror the provided leader.
Only voltage output is mirrored. Settings changed on the leader do not affect the follower.
Following anything other than a CAN-enabled SPARK is not officially supported.
- Parameters
-
leader | The motor controller to follow. |
invert | Set the follower to output opposite of the leader |
- Returns
- The modified SparkBaseConfig object for method chaining
◆ DisableFollowerMode()
Disables follower mode on the controller.
- Returns
- The modified SparkBaseConfig object for method chaining
◆ Flatten()
std::string SparkBaseConfig::Flatten |
( |
| ) |
|
|
overridevirtual |
◆ absoluteEncoder
◆ analogSensor
◆ closedLoop
◆ encoder
◆ limitSwitch
◆ signals
◆ softLimit
The documentation for this class was generated from the following files: