|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#8
|
||||
|
||||
|
Re: Tuning PID Code
I won't go in the method of tuning a PID as others have done, but here are some tips to get you up in running FAST.
1. Use three POTs on a board labeling them P,I,D. Connect them to Analog ports. Say 14,15,16 respectfully. Make a function to read the pots, and then multiply the values out. Like K_P = analog14 * 0.0001. Of course K_P needs to be a float. Your analog will be 0-1024 so you need to make your K_P, K_I, K_D values smaller, normally less than 1 K_P = analog14 * 0.0001 K_I = analog15 * 0.0001 K_D = analog16 * 0.0001 If you need a bigger "tweak" just shrink the multiplier K_P = analog14 * 0.001 K_I = analog15 * 0.001 K_D = analog16 * 0.001 You won't be able to view K_P in your "Print to Screen" so just display your analog value, so you can multiply or divide back to get your "real" K_P,K_I,orK_D value to "hard code" it back into the system so you can REMOVE the PID trimmer pot board. 2. Wow...use LABVIEW to tune your PID system. We tuned our ball velocity PID by connecting the ball motor to PWM1, then mapped our velocity variable to PWM2. Start Labview Dashboard. Both applications, the connections one, and the view application. Of course there ARE NO MOTORS connected to PWM2, we are just transporting the information to Labview because we don't know how to edit Labview. Out of the box, PWM1 and PWM2 was configured in a graph......;-) See these handy video tutorials if you haven't done it yet. http://www.lasarobotics.org/Forum/viewtopic.php?t=366 Now you can view your PWM1 which is your motor OUTPUT, and your pretending that PWM2 is your velocity output so you can just use Labview PWM2 to view, graph and log your PID tuning. You'll see very quickly how effective this tool is. In combination of the two tools, making a PID tuning POT trimmer board, and displaying the tune on Labview, you'll have your PID tuning done in a matter of minutes. Hopfully this helps. - Last edited by Chris_Elston : 15-02-2006 at 08:16. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Out of the Box Camera Code | russell | Programming | 9 | 21-10-2009 05:28 |
| Problem with idata_user_routines.o? | Adrien | Programming | 3 | 12-02-2006 01:33 |
| Drive Straight C Code using Encoders without PID? | Chris_Elston | Programming | 17 | 15-02-2005 23:41 |
| Team THRUST - Kevin's Code and Camera Code Combine | Chris_Elston | Programming | 3 | 31-01-2005 22:28 |
| heres the code. y this not working | omega | Programming | 16 | 31-03-2004 15:18 |