File: optiPIDctrl.m

package info (click to toggle)
octave-control 2.3.52-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,680 kB
  • sloc: cpp: 5,104; objc: 91; makefile: 52
file content (18 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
% ===============================================================================
% optiPIDctrl                      Lukas Reichlin                   February 2012
% ===============================================================================
% Return PID controller with roll-off for given parameters Kp, Ti and Td.
% ===============================================================================

function C = optiPIDctrl (Kp, Ti, Td)

  tau = Td / 10;    % roll-off

  num = Kp * [Ti*Td, Ti, 1];
  den = conv ([Ti, 0], [tau^2, 2*tau, 1]);
  
  C = tf (num, den);

end

% ===============================================================================