Hello,
I am using an F2812 DSP to implement a digitally controlled voltage mode buck converter. I designed my controller in the s-domain and used a bilinear transformation to generate the z-function and accompanying difference equation.
I am having some issues figuring out how to implement the controller, and I don't thoroughly understand how to implement the Q notation even after reading many of TI's links and code examples (the coefficients are normally already converted to integers with no explanation of how).
To start, I have a 12 bit ADC. After truncating the 4 LSB, I can then left shift the result to create a Q15 number that will vary between 0 and 1 (actually -1 and 1, but it will never be below zero). I can then feed in a reference that is also scaled on a per-unit fashion (Q15) to get a pu error signal that varies between -1 and 1 (Q15). I then feed this error signal into a 2-pole, 3-zero controller,
H(z)= 8.246z^3-8.101z^2-8.245z-8.102
z^3-2.474z^2+1.99z-0.5157
How do I turn these coefficients into an integer that will ensure that the output of H(z) (call it u) also varies between 0 and 1?
How do I then scale u so that a value of 1 corresponds to a full period, aka 3750 clock cycles? Or more practically, saturate u at 0.95 and have it correspond to 3560 clock cycles?
Thanks for the help!