Main Page   Hardware Class Hierarchy   Hardware API     Mapping Class Hierarchy  Mapping API 

oPID Class Reference

A baisc method to implement a controller proportion-(integral)-derivative algorithm. More...

#include <opid.h>


Public Member Functions

 oPID (void)
 oPID (float cv)
float value (float target_value)
int value (int target_value)
void PID (float P, float I, float D)
 sets the Proportional/Derivative multiplication factors.

void center (float target_center)
 adjusts PID around a fixed center value.


Private Member Functions

FIXED_POINT _value (FIXED_POINT target_value)

Private Attributes

FIXED_POINT _lastvalue
FIXED_POINT _target_center
FIXED_POINT _proportional
FIXED_POINT _integral
FIXED_POINT _derivative


Detailed Description

A baisc method to implement a controller proportion-(integral)-derivative algorithm.

Current implementation only uses proportional and derivative.

Operation
Remarks
Note: all external accesses or with either basic types--int or float, but internally everything is fixed point math. thus no value should be expected to exceed 32767. Also, if you pass an integer value it returns an integer value, but if you pass a float it returns a float value.
Sample Code
#include <opid.h>
int main()
{
 TBD
}


Constructor & Destructor Documentation

oPID void   ) 
 

oPID float  cv  ) 
 


Member Function Documentation

FIXED_POINT _value FIXED_POINT  target_value  )  [private]
 

void center float  target_center  ) 
 

adjusts PID around a fixed center value.

void PID float  P,
float  I,
float  D
 

sets the Proportional/Derivative multiplication factors.

int value int  target_value  ) 
 

float value float  target_value  ) 
 


Field Documentation

FIXED_POINT _derivative [private]
 

FIXED_POINT _integral [private]
 

FIXED_POINT _lastvalue [private]
 

FIXED_POINT _proportional [private]
 

FIXED_POINT _target_center [private]
 


Generated on Mon Oct 8 19:32:26 2007 for OOMRM Mapping API by doxygen1.3