We have a CAN Talon SRX wired to an encoder. When in PercentVBus mode, the motor moves and we can see our encoder values changing. When changed to kSpeed mode, the motor does not move. We have checked the System Configuration webpage on the roboRIO, and have even run a Self-Test while this is running. The Self-Test shows an error and an applied throttle, but the motor does not move. We have tried values in the range of 20 to 200.
Here is a snapshot of one Self-Test:
We followed the code given in the Software Reference:
Code:
elevatorMotor = new CANTalon(RobotMap::Elevator::elevatorMotorID);
elevatorMotor->SetControlMode(CANSpeedController::kSpeed);
elevatorMotor->SetSensorDirection(true);
elevatorMotor->ConfigSoftPositionLimits(
RobotMap::Elevator::maxPosition,
RobotMap::Elevator::minPosition
);
elevatorMotor->SetPID(
RobotMap::Elevator::P,
RobotMap::Elevator::I,
RobotMap::Elevator::D
);
elevatorMotor->SelectProfileSlot(0);
elevatorMotor->SetIzone(300);
elevatorMotor->SetCloseLoopRampRate(48);
elevatorMotor->SetVoltageRampRate(0);
Code:
elevatorMotor->Set(speed);
Anyone have any thoughts?