View Single Post
  #2   Spotlight this post!  
Unread 25-01-2007, 22:24
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Camera for turning

i actually have a bit of code that may help you.

PHP Code:
unsigned char PIkDControl(char Kpchar Kichar Kdint error) {
    static 
int errorTotal 0;  //there is a better way to do this... meh
    
static int prevError 0;
    
int P 0;
    
int I 0;
    
int D 0;
    
    
= (error*Kp)/100;
    
= (errorTotal*Ki)/100;
    
= ((error prevError)*Kd)/100;

    
errorTotal += error;
    
prevError error;

    return  (
Limit_Mix(2000+127+P+I-D));

There are a couple of other tweaks, but i edited them out. you should come across them whilst testing (=
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY

Last edited by Uberbots : 26-01-2007 at 00:22. Reason: MINUS D NOT PLUS D... oops