Team Virgo v3 / Orion_newPCB_test_LV

Dependencies:   mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo

Fork of Orion_newPCB_test by Team Virgo v3

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pidControl.h Source File

pidControl.h

00001 #ifndef pidControl_H
00002 #define pidControl_H
00003 
00004 #include "mbed.h"
00005 #include "generalFunctions.h"
00006 #include "config.h"
00007 
00008 class pidControl
00009 {    
00010 public:
00011     pidControl();
00012     void setGains(float kP,float kI, float kD, float kFf);
00013     void setTermLimits(float P_min, float P_max, float I_min, float I_max, float D_min, float D_max, float Ff_min, float Ff_max);
00014     void setOutputRange(float outMin, float outMax);
00015     float calcOutput(float setPoint, float feedback, float servoTime);
00016     float processAcc(float setPoint, float targetAcc, float servoTime);
00017                     
00018     float PIDFf_terms[4];    
00019     float Summ_term;                    
00020                            
00021 private:
00022     float PIDFf_gains[4];
00023     float PIDFf_limits[4][2];
00024     float output_limits[2];
00025     
00026     float controlError[2];       
00027     
00028     float prevSetPoint; //for acceleration
00029     float compensatedSetPoint;
00030     
00031     //float PIDFf_terms[4];    
00032     //float Summ_term;
00033 };
00034 
00035 
00036 #endif