PID.cpp 912 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "PID.h"

PID::PID(pidParameterSet parameterIn) {
  PID::p = parameterIn.p;
  PID::i = parameterIn.i;
  PID::d = parameterIn.d;
  PID::soll = parameterIn.soll;
  PID::base = parameterIn.base;
  PID::antiWindup = parameterIn.antiWindup;
  PID::outMin = parameterIn.outMin;
  PID::outMax = parameterIn.outMax;
}

PID::~PID() {}

Manuel Pitz's avatar
Manuel Pitz committed
16
//The following function needs modifications
17
18
19
20
21
22
23
24
25
double PID::calcOutput(double input) {

  return out;
}

double PID::getBase() {
  return base;
}

Manuel Pitz's avatar
Manuel Pitz committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
double PID::getP(){
  return p;  
}

double PID::getI(){
  return i;
}

double PID::getD(){
  return d;
}

void PID::setP(double parameterP){
  p = parameterP;
  return;
}

void PID::setI(double parameterI){
  i = parameterI;
  resetIntegrator();
  return;
}

void PID::setD(double parameterD){
  d = parameterD;
  return;
}


55
56
57
58
59
60
61
62
63
void PID::resetIntegrator() {
  integral = 0;
}


void PID::setSoll(double soll) {
  PID::soll = soll;
}