Using a DetachedEncoder as a SPARK's feedback sensor

A DetachedEncoder, such as the MAXSpline Encoder, may be used as a FeedbackSensor for Closed Loop Control in SPARK MAX and SPARK Flex motor controllers.

This is configured in the ClosedLoopConfig class using the feedbackSensor(FeedbackSensor, int) or feedbackSensor(FeedbackSensor, DetachedEncoder) methods as follows:

SplineEncoder spline = new SplineEncoder(12);
SparkFlex spark = new SparkFlex(1, MotorType.kBrushless);

SparkFlexConfig sparkConfig = new SparkFlexConfig();
sparkConfig.closedLoop
feedbackSensor(FeedbackSensor.kDetachedAbsoluteEncoder, spline);
  
// Continue with other configuration

Last updated

Was this helpful?