Skip to content

calc_PID_coeff.m

Basic Information

  SYNTAX:  [P1,P2,D1,D2,I1,I2] = calc_PID_coeff(dt,taup,taud,taui)

  PURPOSE:  Calculate PID coefficients as computed by PCS. Discrete filters
  constructed from these coefficients are:
    proportional:   P1(z+1)/(z+P2)
    derivative:     D1(z-1)/(z+D2)
    integral:   I1(z+1)/(z+I2)

  INPUT:
    dt = sample time
    taup = proportional time constant (sec)
    taud = derivative time constant (sec)
    taui = integral time constant (sec)

  OUTPUT:
    P1,P2 = proportional calculation coefficients
    D1,D2 = derivative calculation coefficients
    I1,I2 = integral calculation coefficients