Implement new controller

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

06_AttitudeControl/pidAttitudeControl.h

Committer:
ahmed_lv
Date:
2018-03-20
Revision:
30:44676e1b38f8
Parent:
10:ea4b90be68dc

File content as of revision 30:44676e1b38f8:

#ifndef pidAttitudeControl_H
#define pidAttitudeControl_H

#include "mbed.h"
#include "generalFunctions.h"
#include "config.h"

class pidAttitudeControl
{    
public:
    pidAttitudeControl();
    void setGains(float kP,float kI, float kD, float kFf);
    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);
    void setOutputRange(float outMin, float outMax);
    float calcOutput(float setPoint, float feedback, float servoTime);
                    
    float PIDFf_terms[4];    
    float Summ_term;                    
                           
private:
    float PIDFf_gains[4];
    float PIDFf_limits[4][2];
    float output_limits[2];
    
    float controlError[2];       
    
    float prevSetPoint; //for acceleration
    float compensatedSetPoint;
    
    //float PIDFf_terms[4];    
    //float Summ_term;
};


#endif