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 MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
PidWrapper.h
00001 #include "mbed.h" 00002 #include "Global.h" 00003 #include "PID.h" 00004 00005 #ifndef PidWrapper_H 00006 #define PidWrapper_H 00007 00008 class PidWrapper // begin declaration of the class 00009 { 00010 public: // begin public section 00011 PidWrapper(); // constructor 00012 ~PidWrapper(); 00013 00014 struct PidOutput 00015 { 00016 double yaw; 00017 double pitch; 00018 double roll; 00019 }; 00020 00021 struct PidParameter 00022 { 00023 double p; 00024 double i; 00025 double d; 00026 }; 00027 00028 struct PidState 00029 { 00030 double setPoint; 00031 double processValue; 00032 double output; 00033 }; 00034 00035 struct FlightControllerPidParameters 00036 { 00037 PidParameter yawRate; 00038 PidParameter pitchRate; 00039 PidParameter rollRate; 00040 PidParameter yawStab; 00041 PidParameter pitchStab; 00042 PidParameter rollStab; 00043 }; 00044 00045 struct NavigationControllerPidParameters 00046 { 00047 PidParameter altitudeRate; 00048 PidParameter altitudeStab; 00049 }; 00050 00051 struct RatePidState 00052 { 00053 PidState yawRate; 00054 PidState pitchRate; 00055 PidState rollRate; 00056 }; 00057 00058 struct StabPidState 00059 { 00060 PidState yawRate; 00061 PidState pitchRate; 00062 PidState rollRate; 00063 PidState yawStab; 00064 PidState pitchStab; 00065 PidState rollStab; 00066 }; 00067 00068 bool initialise(PidParameter pidParameter, double inputMin, double inputMax, double outputMin, double outputMax, float updateTime); 00069 double compute(double setPoint, double processValue); 00070 PidWrapper::PidParameter getPidParameters(); 00071 void reset(); 00072 void setPidParameters(PidWrapper::PidParameter pidParameters); 00073 void setBias(float bias); 00074 00075 private: 00076 PID* _pid; 00077 }; 00078 00079 #endif
Generated on Fri Jul 15 2022 00:21:58 by
1.7.2