Forum Discussion
Altera_Forum
Honored Contributor
14 years agoI have done sort of PI that consisted of two branches only (proportional and integral parts). I used it for phase error control in a receiver carrier tracking.
It was very simple in vhdl (but have the code misplaced). The proportional part is just a multiplier; you multiply the error(input) by a constant (I used .1 ~ 200). The integral part is just an acuumulator; you add up the error nonstop and hopefully will not overflow. You will need to add a term here to decide how much to feedback = leakage (e.g. .001 ~ 1), again needs multiplier in the accumulator loop. The two branches are just added up. Testing is more difficult and best is in-system testing