Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo
Fork of Orion_newPCB_test by
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
Generated on Tue Jul 12 2022 20:53:07 by
1.7.2
