|
Using PID with Talon SRX and Mag Encoder
Hi all,
We are still trying to control an arm with Talon SRXs and CTRE's magnetic encoders. We would like to be able to move the y-axis on a joystick, have the arm move up to a set position (currently in rotations because I can't find a way to change it), and hold there until the joystick is moved again. I have a bunch of questions concerning how to go about this. I have read both Talon SRX manuals several times (Software Ref and Motion Profile).
1. Right now, I am using the Talon SRX configured with Percent VBus in Begin. In TeleOp, I have logic that causes the arm to move up to a certain point and then stop. However, when the joystick is moved, it moves rapidly and doesn't hold it's position, although the brake is enabled in the RoboRIO web dashboard.
I feel like I am going about this wrong, and that I should have the Talon set to Position in Begin, but whenever I do this I can't get a response.
2. There is also a block for the Talon SRX called "Set PID". I've been watching a lot of videos and reading a lot of posts about this, but I still don't understand the first thing about PID. It can be configured in the Web Dashboard and through the block, but how would I activate it with the joystick if I used the Web Dashboard? Also, I think it would control the movement of the arm, but are there units to the values of P, I, and D so that I can figure out how to set them?
From watching a video, I believe P is the desired position, and I and D adjust around the position to get closer to the desired position. If I wired the joystick's y-axis to the P value and somehow converted the joystick value to rotations or degrees, would this work? If so, how would I set I and D?
As you can tell, I am really confused trying to figure out how to implement this. Any examples or explanations would be greatly appreciated. Thank you.
|