title: PID controller and transfer function in C++
body: <p>I have a PID controller working in simulink, but I want to pass it to C++ code. I found how to make a PID with code, something like this:</p>
  
  <pre><code>error = input - refeed;
  iError += error * sampleTime;
  dError = (error - lastError)/ sampleTime;
  //PID Function
  output = Kp * error + Ki * iError + Kd * dError;
  refeed = output;
  lastError = error;
  </code></pre>
  
  <p>But, that's the only clear thing I got in my research.</p>
  
  <p>I need to know what's the next step, I have the transfer function discretized but I'm not sure about what should I do with the "z" parameters, the times, ...</p>
  
  <p>Is it possible to pass manually a PID controller to C++? How?</p>