|
UniSet
2.6.0
|
00001 /* 00002 * Copyright (c) 2015 Pavel Vainerman. 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU Lesser General Public License as 00006 * published by the Free Software Foundation, version 2.1. 00007 * 00008 * This program is distributed in the hope that it will be useful, but 00009 * WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Lesser General Lesser Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public License 00014 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00015 */ 00016 // ----------------------------------------------------------------------------- 00017 #ifndef PID_H_ 00018 #define PID_H_ 00019 // ----------------------------------------------------------------------------- 00020 #include <sstream> 00021 #include <iomanip> 00022 // -------------------------------------------------------------------------- 00023 namespace uniset 00024 { 00025 // ----------------------------------------------------------------------------- 00034 class PID 00035 { 00036 public: 00037 PID(); 00038 ~PID(); 00039 00046 void step( const double& X, const double& Z, const double& Ts ); 00047 00049 void reset(); 00050 00052 void recalc(); 00053 00054 double Y; 00055 double Kc; 00056 double Ti; 00057 double Td; 00059 double vlim; 00062 double d0; 00063 double d1; 00064 double d2; 00065 double sub1; 00066 double sub2; 00067 double sub; 00068 double prevTs; 00069 00070 friend std::ostream& operator<<(std::ostream& os, PID& p ); 00071 00072 friend std::ostream& operator<<(std::ostream& os, PID* p ) 00073 { 00074 return os << (*p); 00075 } 00076 00077 protected: 00078 private: 00079 }; 00080 // -------------------------------------------------------------------------- 00081 } // end of namespace uniset 00082 // ----------------------------------------------------------------------------- 00083 #endif // PID_H_ 00084 // -----------------------------------------------------------------------------
1.7.6.1