STM32G474 FMAC for 3p3z controller
Hi all,
I am trying to study the buck converter program provided by ST for the STM32G474 discovery kit. From previous study, I know that buck converter uses the 3p3z (3 poles 3 zeros) structure to calculate the current output, as shown in the figure below, where the equation of this structure can be written as follows.


In the sample code, the IIR filer in the FMAC register is used to represent this controller, the structure diagram of IIR filer and the corresponding equation can be written as follows.


where X is the vector representing {x0, x1, x2, x3}, Y' is the vector represent {y1, y2, y3} and Y is the output y0.
From the information given, A is the vector representing {a1, a2, a3} in the IIR filter and B is the vector representing {b0, b1, b2, b3} in the IIR filter. From my understanding, the values in this 2 vector should be identical to the parameters in the 3p3z controller, however, when I study the program, I see that this is only the case for vector A, for vector B, despite still having the same magnitude, it is defined as {-B0, -B1, -B2, -B3} (i.e. b0 from the IIR value = -B0 from the 3p3z controller). My problem is, where is this negative sign from, because I see the two case identical and cannot understand why a -1 factor is multiplied for each entry for vector B.

Thanks.
Regards,
Joshua
