SRX Position Woes

I am a mentor with the FRC team 3534 at Davison High School. We are attempting to control a gear with a rotation range of about 180 degrees in a subsystem called Pivot. The gear is driven by Bag motor attached to a VEX planetary gear box . The last stage of the gear box is a CTR encoder module. The module is connected directly to a Talon SRX controller. We are talking to the Talon via CAN bus. We are using joystick input to manually move the gear by bumping the position each cycle the joystick method is called. This allows the pivot to remain at the last joystick commanded position as barriers are crossed. That code is at the bottom of the attachment. It works just as intended.
Our problem occurs when we attempt to programatically send the pivot to a particular position. We are attempting to read the current position of the gear, determine the difference between the current and commanded positions and use the difference with a SET() command to move to the desired position.
Apparently we don’t understand something because every time we execute the SetPivotAngle command the gear rotates constantly. This is true even though the IsFinished requirements are met in the command.
The code is below as you can see we have made several stabs at it.
Basically, we need to make the CTR encoder look like a one turn potentiometer and command it to selected positions.
There are two files attached below. The first has most of the code, the second is the complete SetPivotAngle command class. All programming is in Java.
Thanks in advance for your help. We still don’t have the thing working; the encoder position is still staying at 0 even though everything else looks right. We can’t find anything in the code keeping the encoder position at zero. Please find the code attached. Maybe you or some one can tell us what is happening. Is it possible we have a problem with the CTR encoder?

SetPivotAngle.java (2.06 KB)
Pivot.java (2.9 KB)
OI.java (2.6 KB)
Robot.java (4.58 KB)
RobotMap.java (2.5 KB)


SetPivotAngle.java (2.06 KB)
Pivot.java (2.9 KB)
OI.java (2.6 KB)
Robot.java (4.58 KB)
RobotMap.java (2.5 KB)

The SRX runs in absolute positions.

Aka, if you want to move your arm 400 ticks from where it is, you have to move it to the value that is 400 ticks from where it is.

We are attempting to read the current position of the gear, determine the difference between the current and commanded positions and use the difference with a SET() command to move to the desired position.

This leads me to believe you’re attempting a relative move. If your arm is at 400, and you want to move to 800, you should use Set(800) if your SRX is in position mode.