Using Interconnecting Functions for Controller Design

We consider a double-integrator model of the satellite control system and design a PID (proportional-integral-derivative) controller that would place the poles of the closed-loop system in some predefined positions. The block diagram of a PID controller connected to the system is shown in the figure below. Only the propagation of the reference signal r to the controlled output c is taken into account. A typical system would also have a disturbance input, not shown on the diagram. The prefilter can be used to further correct the dynamics of the system, for example, by eliminating unwanted zeros from the closed-loop transfer function. Note that the derivative part of the controller includes the term 1/(τ  s + 1), with a presumably small time constant τ. Otherwise that part would not be physically realizable.

Load the application.

<< ControlSystems`

Here is a double integrator plant.

plant = StateSpace[{{0, 1}, {0, 0}}, {{0}, {1}}, {{1, 0}}]

This describes the PID controller.

pid = 
      TransferFunction[s, 
        (Subscript[k, p]) + ((Subscript[k, i])/s) + (((Subscript[k, d]) s)/(1 + τ s))]

This connects the controller to the plant, closes the feedback loop, and simplifies the result.

SeriesConnect[pid, plant] // FeedbackConnect // Simplify

This finds the transfer function of the closed-loop system.

TransferFunction[s, %] // ExpandRational

Here is the denominator of the transfer function as a polynomial in the variable s.

Denominator[%[s]][[1, 
      1]]

This makes the polynomial monic.

\(d\_1 = Expand[%\/τ]\)

Suppose now that the closed-loop system with desired dynamics has poles at -(Subscript[p, 1]), -(Subscript[p, 2]), -(Subscript[p, 3]), and -(Subscript[p, 4]). This is the denominator of the corresponding transfer function.

(Subscript[d, 2]) = (s + (Subscript[p, 1])) (s + (Subscript[p, 2])) (s + (Subscript[p, 3])) (s + 
            (Subscript[p, 4]))

To find the unknown parameters (Subscript[k, i]), (Subscript[k, d]), (Subscript[k, p]), and τ we equate the coefficients of powers of s in the denominators and solve the resultant system of equations.

Solve[
        CoefficientList[(Subscript[d, 1]) - (Subscript[d, 2]), s] == 0, {(Subscript[k, i]), (Subscript[k, d]), 
          (Subscript[k, p]), τ}] // Simplify

This is a simplified result for negligible τ.

% /. (k_ -> expr_) :> k -> 
          Limit[expr, (Subscript[p, 1]) -> -∞]