Looking for a practical implementation of fixed point PI controller using MCU. Simulation in laplace domain has fetched Kp=0.1 and Ki= 1.75 as results. My ADC 16 bit data input is 2's complement (Range -1.0 to +1.0). If I were to use Q15 format ( FOR ADC), how do I convert Ki value to this format?
As a first step, you'll identify the required number range for all variables in your controller, also determine if 16 bit length is sufficient for all variables, e.g. the integrator. Obviously some have to use integer bits in a fixed point representation, e.g. mentioned Ki.
Perform appropriate scaling in every operation, apply saturation logic where necessary.
I am new to this stuff. Multiplying Ki by 32767 gives me value that is greater than 16 bits. Do you suggest mixing different Q formats for different variables? Taking my own requirement, could you suggest the scaling factors?