View Full Version : Talon SRX PID tuning
tedlasai
23-02-2016, 12:17
I am working two shooter motors that are used to throw the ball out. One of the shooters motors has perfect PID values at P=5 I =0.01 D =2. We have tried these values on the other motor but it shoots up very fast. The values we were playing with last night gave us p=4 i =0 d=2. This produced a steady oscillation under the target. However, when we increased the i to match the target line it just shot of. Any amount of I caused the motor to shoot off really fast. We are setting the i small at the beginning like values of 0.01 or 0.001. Is there an explanation for this?
Sai
Alan Anderson
23-02-2016, 12:37
Do you want the motors to run at the same speed? If so, you can set one of the Talons to be a "slave" to the other as a "master", and run the closed-loop control on only the master. This assumes that you're controlling them over CAN.
tedlasai
23-02-2016, 14:07
No, they will have to run at different speeds. Do you have an idea of why the Integral gain of 0.01 or 0.001 causes the speed of the motor to accelerate like crazy.
Jared Russell
23-02-2016, 14:08
Read the Talon SRX Software Reference Manual (https://www.ctr-electronics.com/Talon%20SRX%20Software%20Reference%20Manual.pdf) very closely so that you understand what exactly each of your gains does.
In particular, there is a very useful example in this document to help tune velocity PID loops.
tr6scott
23-02-2016, 16:50
Also there github is very helpful with actual code.
https://github.com/CrossTheRoadElec/FRC-Examples/tree/master/LabVIEW%20Speed%20Closed%20Loop
kevin.li.rit
23-02-2016, 17:08
This may also be useful
http://www.chiefdelphi.com/forums/showthread.php?t=143728&highlight=Bang+bang
tr6scott
23-02-2016, 17:16
Also read up on the SRX "IZone", sounds like you could use that feature to limit the I accumulated when out of zone.
I had a tough time with getting the SRX units straight. It is all in the manual, but I'm and engineer, and I don't read manuals.
OMAR has spent a good amount of time getting all of the options documented, and giving good examples. We shoot at 9000 rpm, and the control on the SRX is simply unbelievable is a sub $100 controller.
pipsqueaker
29-02-2016, 22:12
No, they will have to run at different speeds. Do you have an idea of why the Integral gain of 0.01 or 0.001 causes the speed of the motor to accelerate like crazy.
Rate PIDs are a little weird- you actually only tune I and P. You can think of the reasoning as "I'm tuning for the derivative of position, so all the constants act as if they were derived: in a rate PID, I acts like P, P acts like D, and the D value is, afaik useless
I'd recommend using the feedforward (F gain) in the talon's PID. You can read about it in the talon documentation.
With that, I've been able to get very solid shooter wheel velocity control with just P and F -- no integral or derivative.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.