9.1 Functional Description

This section describes the implementation details of the PI Controller.

The following figure shows the block diagram of PI Controller.

Figure 9-1.  System-Level Block Diagram of PI Controller

The ref_input_i port connects to the reference input, while the act_input_i port connects to the actual input. The kp_i and ki_i inputs represent the proportional and integral gains. ymax_i and ymin_i represent the minimum and maximum outputs. The init_i input represents the initialization value (which is output if the PI Controller is disabled), and the pi_en_i input is used to enable the PI Controller operation. A pulse of one clock cycle width is used to start the computation. The done_o output signal represents valid data on the output_y_o port. A single clock pulse appears at the done_o signal to represent the end of computation.

The entire system is synchronized with the rising edge of clock and controlled by a finite state machine (FSM). The PI Controller block uses a multiply-accumulate-subtract (MAS) block to perform operations like multiplication, addition, and subtraction. There are two components that contribute to the output, the proportional term and the integral term as shown in the following figure. The proportional term is only dependent on the instantaneous value of the error signal whereas the integral term is dependent on the present and previous values of error.

Figure 9-2. PI Controller in Continuous Domain

PI Controller in continuous time domain can be expressed as:

where,

e(t) = reference(t) - feedback(t) is the error between Reference and feedback

y(t) = PI Controller output

To implement the PI Controller in digital domain, it has to be discretized. The discretized form of PI Controller based on zero-order hold method is shown in the following figure.

Figure 9-3. The Discretized Form of PI Controller
Figure 9-4. Equation

where,

P(n) = Proportional term output

I(n) = Integral term output

I(n-1) = Previous (buffered) value of Integral output

Ts = Sampling time in discrete domain