Package yams.core.motorcontrollers.local
package yams.core.motorcontrollers.local
REV Robotics motor controller wrappers whose closed-loop control runs on the roboRIO.
This package contains adapters for REV SPARK MAX and SPARK FLEX motor controllers. Because the REV hardware offloads PID execution to the roboRIO (rather than to the motor controller itself), these wrappers are classified as local: the control loop runs on the robot controller and sends periodic duty-cycle or voltage commands to the hardware.
Core type
SparkWrapperunified adapter for both the SPARK MAX (NEO, NEO 550) and SPARK FLEX (NEO Vortex).
Absolute encoder discontinuity
When a SparkAbsoluteEncoder (REV Through Bore Encoder) is used as the feedback device,
a discontinuity point must be configured so the SPARK firmware knows
where the sensor wraps around. Set this via
SmartMotorControllerConfig.withExternalEncoderDiscontinuityPoint(Angle):
0.5sensor range[-0.5, 0.5): useful when the mechanism travels through zero and must not have a wrap at the midpoint of travel.1.0sensor range[0, 1): useful when the mechanism only moves in the positive direction and zero is never crossed.
Construction
SmartMotorControllerConfig config = new SmartMotorControllerConfig()
.withExternalEncoderDiscontinuityPoint(0.5);
SmartMotorController motor = new SparkWrapper(
new SparkMax(5, MotorType.kBrushless), DCMotor.getNEO(1), config);
- See Also:
-
ClassesClassDescriptionNova wrapper for The Thrifty Bot's Thrifty Nova motor controller, using ThriftyLib 2027.Spark wrapper for REV Spark Motor controllers.