1 #ifndef ORG_EEROS_CONTROL_ZTRANSFERFUNCTION_HPP_
2 #define ORG_EEROS_CONTROL_ZTRANSFERFUNCTION_HPP_
12 template <
int ORDER >
14 static constexpr
int N = (ORDER + 1);
40 return (
I(Ts, Tn) +
DT1(Ts, Tv, Tv1) + 1)*Kp;
43 template <
int RORDER >
52 template <
int RORDER >
63 last_out[0] = last_in[0] * fraction.numerator.c[0];
64 for (
int i = 1;
i < N;
i++) {
65 last_out[0] += (last_in[
i] * fraction.numerator.c[
i] - last_out[
i] * fraction.denominator.c[
i]);
67 last_out[0] /= fraction.denominator.c[0];
72 for (
int i = (N - 1);
i >= 0;
i--) {
73 last_in[
i] = last_in[
i - 1];
74 last_out[
i] = last_out[
i - 1];
virtual Signal< T > & getSignal()
Definition: Output.hpp:13
static ZTransferFunction< 1 > I(double Ts, double Tn)
Definition: ZTransferFunction.hpp:31
virtual T getValue() const
Definition: Signal.hpp:46
ZTransferFunction(const std::vector< double > a, const std::vector< double > b)
Definition: ZTransferFunction.hpp:20
ZTransferFunction< ORDER+RORDER > operator*(const ZTransferFunction< RORDER > right)
Definition: ZTransferFunction.hpp:44
static ZTransferFunction< 1 > D(double Ts, double Tv)
Definition: ZTransferFunction.hpp:27
Output< double > out
Definition: Block1i1o.hpp:26
static uint64_t getTimeNs()
Definition: System_POSIX.cpp:30
static ZTransferFunction< 2 > PID(double Ts, double Kp, double Tn, double Tv, double Tv1)
Definition: ZTransferFunction.hpp:39
virtual void setValue(T newValue)
Definition: Signal.hpp:50
ZTransferFunction(const eeros::math::Fraction< ORDER > ©)
Definition: ZTransferFunction.hpp:17
virtual void setTimestamp(timestamp_t newTimestamp)
Definition: Signal.hpp:63
Definition: Fraction.hpp:13
Input< double > in
Definition: Block1i1o.hpp:25
virtual void run()
Definition: ZTransferFunction.hpp:61
Definition: Block1i1o.hpp:12
static ZTransferFunction< 1 > PT1(double Ts, double K, double T1)
Definition: ZTransferFunction.hpp:23
Definition: ZTransferFunction.hpp:13
int i
Definition: RingBufferTest.cpp:12
static ZTransferFunction< 1 > DT1(double Ts, double Tv, double T1)
Definition: ZTransferFunction.hpp:35
ZTransferFunction< ORDER+RORDER > operator+(const ZTransferFunction< RORDER > right)
Definition: ZTransferFunction.hpp:53