Dependents:   YMotor

Fork of PID by tarou yamada

PID.hpp

Committer:
inst
Date:
2016-03-03
Revision:
4:ed6aea0299df
Parent:
2:73618cad4762
Child:
6:4427687e6dbe

File content as of revision 4:ed6aea0299df:

#ifndef INCLUDED_MBED_STL_PID_H
#define INCLUDED_MBED_STL_PID_H

namespace mbed_stl {

template <typename T, typename K = T>
class PID{
public:
    PID(K kp, K ki, K kd);
    
    T update(T error);
    
private:
    const K kp_;    // 比例制御係数
    const K ki_;    // 積分制御係数
    const K kd_;    // 微分制御係数
    
    T integral_;
    T prev_error_;
};

} /* namespace mbed_stl */

#include "PID_impl.hpp"

#endif