|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#3
|
||||
|
||||
|
Re: Using PID with Talon SRX and Mag Encoder
Since you have read the manuals, I will try to tie it all together for you as best I can. Ignore motion profile. It would be an advanced approach.
In brief terms, setting the brake on the talons only holds position in a kind of passive mode. the motor resists turning, but it is not powered and keeping your position. You need to have the motor actively running to keep the arm in position. Here's the basic approach for you. You do need to use position control PID. Here are two videos to explain (P is not for position). https://www.youtube.com/watch?v=_bWv...q4iGo s5CQKuw and go to about 4:00 on this one to see how changing the PID constants affects the behavior https://www.youtube.com/watch?v=lfMMPe7s9nU You set the Talon SRX to position control and feed it (motor output VI) the position (in native talon units) you want it to control to and it goes there. You get the positions by moving your arm in manual mode and reading the positions from the web dashboard. Use the Set PID VI to set the PID constants. Some words of caution. Be very careful. You can easily break your arm. If the position is wrong or the PID constants are wrong, the arm will get jammed against whatever physical limits you have and probably break something. Start with very small P, have the motors disconnected and probe to see what the code is telling the talon to do and the status output VI to see what throttle is being applied and see if that matches what you think should be happening. Reduce the P if large throttle outputs are being observed. Use graphical outputs to see target position and actual position. Connect the motor and proceed to tune as per the second video. Always be ready to disable at a moments notice. Because of different behavior up and down, an arm is going to be very challenging to position control. Sorry this is so brief, but I need to get rolling to the Palmetto Regional. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|