Class NovaWrapper

java.lang.Object
yams.core.motorcontrollers.SmartMotorController
yams.core.motorcontrollers.local.NovaWrapper

public class NovaWrapper extends SmartMotorController
Nova wrapper for The Thrifty Bot's Thrifty Nova motor controller, using ThriftyLib 2027.

The closed loop controller runs on the SystemCore and commands the Nova with voltage, like the profiled controllers of the other wrappers. ThriftyLib's simulation ignores the Nova's onboard PID gains, so running the loop on the SystemCore keeps simulation and the robot the same.

External encoders, given to SmartMotorControllerConfig.withExternalEncoder(Object):

  • Motor.FeedbackSensorType.ABS: an absolute encoder wired to the Nova's data port. Its type comes from the vendor config, such as NovaConfig.absoluteEncoderType(Motor.AbsoluteEncoderType.REV_ENCODER).
  • Motor.FeedbackSensorType.QUAD: a quadrature encoder wired to the Nova's data port. Its type comes from the vendor config, such as NovaConfig.quadratureEncoderType(Motor.QuadratureEncoderType.custom(2048)).
  • CanEncoder: a Thrifty CAN Encoder on the same CAN bus.

Example

// Configure and create a Nova driving a NEO on CAN bus 0, CAN ID 3
SmartMotorControllerConfig config = new SmartMotorControllerConfig()
    .withMotorInverted(false)
    .withStatorCurrentLimit(Amps.of(40))
    .withClosedLoopController(0.2, 0, 0)
    .withVendorConfig(new NovaConfigBatch(NovaConfig.tempThrottleEnable(true)));
SmartMotorController motor = new NovaWrapper(new Nova(0, 3, MotorType.NEO),
    DCMotor.getNEO(1), config);