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.
Communication/PID/PID.h
- Committer:
- kishibekairohan
- Date:
- 2018-10-01
- Revision:
- 5:3ae504b88679
File content as of revision 5:3ae504b88679:
#ifndef PID_H_
#define PID_H_
namespace PID_SPACE
{
class PID
{
private:
double diff[2];
double integral;
double deltaTime;
double dataRangeLower;
double dataRangeUpper;
double kp,ki,kd;
double mv;
public:
// deltaTime:1サイクル時間( 1 / Process Frequency )
PID(double deltaTime);
PID(double deltaTime, double dataRangeLower, double dataRangeUpper);
PID(double deltaTime, double dataRangeLower, double dataRangeUpper, double KP, double KI, double KD);
//パラメータを設定
void SetParam(double KP, double KI, double KD);
//測定量を入力し操作量を取得
double SetPV(double sensorData, double targetData);
//操作量を取得
double GetMV();
//入力した値を制限して取得
double limit(double data, double lower, double upper);
};
}
#endif /* PID_H_ */