|
Using PID on Talon SRX with Gyro for feedback
We are looking at off season activities and wanted to explore using the Talon SRX controller's internal PID capabilities on our drive system to drive both to a fixed distance (using a quadrature encoder) and in a straight line (using a gyro).
I'm not sure if this is possible; I'm looking for a sanity check on the concept.
We have a tank drive six wheel drop center drive system. The thought was to wire the encoder to the left side Talon SRX, and use positional PID to control this side. We'd tune our PID with the right Talon slaved to the left. After tuning, the right Talon SRX would get attached to the Gyro, using the analog connection, just like wiring a potentiometer. We would read the current setting of the gyro before moving, and send that as the positional PID target for the right side.
The thought is that as the left side starts to move, the right side will detect a direction change and speed up to correct.
I know that this will require a great deal of tuning to get correct. What I don't know is if it is technically possible. Also, I know that in Labview there are a number of VI's that are used to get data from and to control the gyro. I believe that these expect the gyro to be attached to an analog port on the roborio. If the gyro is attached to the Talon SRX, I would assume that I can no longer use these VI's to get an angle, pitch, or yawl, or reset the angle to zero. That would be a major drawback to this approach, as we would no longer be able to say, turn 90 degrees in place. I suppose an alternative might be to put another gyro on an analog roborio port and use percent Vbus mode on the talons to turn that way.
Has anyone done this type of control? or see reasons why it just plain won't work? We have code to do this without PID using victors or the old talons, but want to take advantage of the processing power in the new controllers.
We used the PID capabilities of the Talon SRX on this past years robot, so we are familiar with CAN, the break out board, etc...[/size]
|