|
Talon SRX Swerve Control
We have been using Talon SRXs to control our swerve drive that's in development. For clarity "turn" will refer to the angle of the wheel, and "spin" will refer to the velocity. While attempting to turn the wheel past the 1023 limit, instead of continuing past 1023, the Talon will return to a point in the 0-1023 interval. I am currently using an Analog Encoder with the Talon in the Position closed-loop mode.
To attempt to solve this problem, I converted the encoder signal into an equivalent degree value, processed it to get my new setpoint, and then converted it back to a 0-1023 value in the same interval that the encoder is in. I believe my problem lies in the red boxed area of my code, but I could very easily be wrong. Any help is appreciated, and I will provide any additional information if needed.
|