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
Diff: 06_AttitudeControl/pidAttitudeControl.h
- Revision:
- 10:ea4b90be68dc
diff -r 77bc74e53e21 -r ea4b90be68dc 06_AttitudeControl/pidAttitudeControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/06_AttitudeControl/pidAttitudeControl.h Sat Apr 23 10:29:24 2016 +0000 @@ -0,0 +1,35 @@ +#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 \ No newline at end of file