|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#4
|
|||
|
|||
|
Re: Potentiometer PID
Thanks for the whitepaper
I think I understand fairly well, would this work: int Target; int Error; int Gain = 0.5; int Drive; int Arm_Out; if ( p1_sw_trig == 1 ) { Target = 600 ; } else if ( p2_sw_trig == 1 ) { Target = 1000 ; } else if ( p3_sw_trig == 1 ) { Target = 1600 ; } Arm_Out = Get_ADC_Result(2); //GetAnalogInput(Port) Checks the Port and Return 0-1024 Error = (Arm_Out - Target); // Computes Error Based on How Far you are from the goal Drive = ((Gain * Error)+127); // Based on the gain it outputs a number and then add 127 so the Victor Understands pwm01 = Drive; |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Potentiometer help | Unholy | Programming | 4 | 07-02-2006 17:48 |
| Potentiometer Help! | thoughtful | Programming | 4 | 18-02-2005 08:21 |
| coding a potentiometer | incognito_NICK | Programming | 5 | 14-02-2005 15:56 |
| Potentiometer | Joshua May | Technical Discussion | 8 | 22-05-2004 19:51 |
| Potentiometer Theory | Ulibrium | Technical Discussion | 6 | 25-01-2002 21:16 |