lib/LowPassFilter2.hh
00001 // 2次低域通過濾波器クラス
00002 // 2011/02/14 Yuki YOKOKURA
00003 //
00004 // 2次低域通過濾波器 G(s)=w^2/(s^2 + w/Q*s + w^2) (双一次変換)
00005 //
00006 // Copyright (C) 2011 Yuki YOKOKURA
00007 // This program is free software;
00008 // you can redistribute it and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 3 of the License, or any later version.
00010 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
00011 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00012 // See the GNU General Public License for more details <http://www.gnu.org/licenses/>.
00013 // Besides, you can negotiate about other options of licenses instead of GPL.
00014 // If you would like to get other licenses, please contact us<yuki@katsura.sd.keio.ac.jp>.
00015 
00016 #ifndef LOWPASSFILTER2
00017 #define LOWPASSFILTER2
00018 
00019 namespace ARCS {        // ARCS名前空間
00020         class LowPassFilter2 {
00021                 private:
00022                         double Ts;      // [s]          制御周期
00023                         double w;       // [rad/s]      遮断周波数
00024                         double Q;       //                      鋭さ(0.5のときに重根設定となる)
00025                         double uZ1;     //                      状態変数1 変数名Z1の意味はz変換のz^(-1)を示す
00026                         double uZ2;     //                      状態変数2
00027                         double uZ3;     //                      状態変数3
00028                         double yZ1;     //                      状態変数4
00029                         double yZ2;     //                      状態変数5
00030                         double yZ3;     //                      状態変数6
00031                 
00032                 public:
00033                         LowPassFilter2(double CutFreq, double Sharp, double SmplTime);
00034                         // コンストラクタ CutFreq;[rad/s] 遮断周波数,Sharp;鋭さ,SmplTime;[s] 制御周期
00035                         ~LowPassFilter2();                                      // デストラクタ
00036                         double GetSignal(double u);                     // 出力信号の取得 u;入力信号
00037                         void SetCutFreq(double CutFreq);        // 遮断周波数の再設定 CutFreq;[rad/s] 遮断周波数
00038                         void SetSharpness(double Sharp);        // 鋭さの再設定 Sharp;鋭さ
00039                         void SetSmplTime(double SmplTime);      // 制御周期の再設定 SmplTime;[s] 制御周期
00040                         void ClearStateVars(void);                      // すべての状態変数のリセット
00041         };
00042 }
00043 
00044 #endif
00045 
00046 
00047 
 All Classes Files