I'd be happy to try to help. I do have a question though: What is your position reference? You need to have an encoder or a potentiometer on it otherwise the position control would do nothing.
The SetX() method on the CAN Jaguar sets the position in terms of rotations of the motor, from where you started.
A few things to note to get it to work:
- In order for the Position mode to work on your Jaguar, you need to set the jaguar to say how many lines the encoder has (assuming it's an encoder).
- You need to set up a PID loop on the jaguar in order for it to do anything.
As an example, here's our turret setup (using position mode). It's in C++, and from your use of SetX() I assume you're in Java. But you'll see still what it's doing.
Code:
m_turretJaguar.ChangeControlMode(CANJaguar::kPosition);
m_turretJaguar.ConfigMaxOutputVoltage(k_driveMaxOutputVoltage);
m_turretJaguar.SetPID(k_turretP,k_turretI,k_turretD);
m_turretJaguar.SetPositionReference(CANJaguar::kPosRef_QuadEncoder);
m_turretJaguar.ConfigEncoderCodesPerRev(k_encoderPulsesPerRev);
m_turretJaguar.ConfigNeutralMode(CANJaguar::kNeutralMode_Brake);
m_turretJaguar.EnableControl();
Hopefully this was sorta helpful. I'd be happy to help further. We just fought for a week on our position controlled turret, so I know how to make it work.
-Arthur