Skip to content

REVLib: SPARK MAX / SPARK Flex with NEO and NEO Vortex

learnfrc.com
learnfrc.comAuthor
Veer Bajaj
Veer BajajMaintainer

REV Robotics makes the NEO and NEO Vortex brushless motors, driven by the SPARK MAX and SPARK Flex motor controllers. Unlike the Talon FX, the controller and motor are separate (you wire a SPARK MAX to a NEO). They run on CAN and use the REVLib software library and the REV Hardware Client desktop app.

Install REVLib via “Manage Vendor Libraries” using REV’s vendordep URL.

Starting with REVLib 2025 , all SPARK classes moved into a com.revrobotics.spark package and configuration became declarative (similar in spirit to Phoenix 6). Instead of calling setters directly on the controller, you build a SparkMaxConfig (or SparkFlexConfig) and apply it:

import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkBase;
import com.revrobotics.spark.SparkLowLevel.MotorType;
import com.revrobotics.spark.config.SparkMaxConfig;
import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;
SparkMax motor = new SparkMax(2, MotorType.kBrushless); // CAN ID 2, NEO
SparkMaxConfig config = new SparkMaxConfig();
config.idleMode(IdleMode.kBrake);
config.smartCurrentLimit(40);
motor.configure(config,
SparkBase.ResetMode.kResetSafeParameters,
SparkBase.PersistMode.kPersistParameters);

ResetMode/PersistMode control whether old settings are wiped and whether the config survives a power cycle.

The simplest output is percent power:

motor.set(0.5); // 50% output

Configure PID gains under the config’s closedLoop member, then command the on-board controller through getClosedLoopController(). In REVLib 2025 the controller class was renamed from SparkPIDController to SparkClosedLoopController , and you command it with setReference(value, ControlType) (as of REVLib 2026 setReference(...) is deprecated in favor of an identical setSetpoint(...) , so use that on the 2026 library):

config.closedLoop
.feedbackSensor(FeedbackSensor.kPrimaryEncoder)
.pid(0.1, 0.0, 0.0);
motor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
// Run on-board velocity control to 1000 RPM
motor.getClosedLoopController().setReference(1000, ControlType.kVelocity);

REV’s on-board smooth-motion feature is MAXMotion (configured under closedLoop.maxMotion with parameters like cruise velocity and max acceleration), commanded with control types such as kMAXMotionPositionControl.

The NEO/NEO Vortex have built-in encoders read through the SPARK:

RelativeEncoder enc = motor.getEncoder();
double position = enc.getPosition(); // rotations
double velocity = enc.getVelocity(); // RPM

In REVLib 2025, read-back parameter getters live on a configAccessor field rather than on the controller directly.

Use the REV Hardware Client to set CAN IDs, update firmware, and test motors on the bench. As with CTRE, every device on the CAN bus needs a unique ID.

| CTRE Talon FX| REV SPARK MAX/Flex
—|—|—
Motor| Kraken X60/X44 / Falcon 500 (integrated)| NEO / NEO Vortex (separate)
Library| Phoenix 6| REVLib
Config| TalonFXConfiguration + apply| SparkMaxConfig + configure
Command| setControl(request)| set() / getClosedLoopController().setReference()

Many teams mix both. The patterns rhyme: configure declaratively, then either set open-loop output or command the on-board closed-loop controller.

  • REV’s NEO / NEO Vortex motors are driven by separate SPARK MAX / SPARK Flex controllers.
  • REVLib 2025 uses declarative config: build SparkMaxConfig, then motor.configure(…).
  • Open-loop is motor.set(value); closed-loop uses getClosedLoopController().setSetpoint() (setReference is deprecated).
  • Configure PID under config.closedLoop; MAXMotion provides on-board smooth motion.
  • Use the REV Hardware Client to set unique CAN IDs and update firmware.

This lesson was adapted from learnfrc.com.