Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hi,
I am trying to implement the transfer function of the controller designed for buck converter in Code Composer Studio for closed loop duty ratio control.
The controller transfer function in s domain is this
Hc(s) = (958s^2 +5.2e6s + 6.9e9) / (s^3 + 117140 s^2 + 3.43e9s)
The controller transfer function in z domain is this
Hc(z) = (2.3e-4 - 2.3e-4z^-1 - 2.3e-4 z^-2 + 2.3e-4 z^-3) / (1 - 2.94z^-1 + 2.8z^-2 - 0.9431z^-3)
In discrete domain, the controller transfer function is found to be
u(n) = 2.9*u(n-1) - 2.8*u(n-2) + 0.94*u(n-3) + 2.3e-4*e(n) - 2.3e-4*e(n-1) - 2.3e-4*e(n-2) + 2.3e-4*e(n-3)
where e(n) = input to controller = error
and u(n) = output of controller = duty ratio
Now I have trouble implementing this transfer function in C. Can you please tell me how to program this in code composer studio?
Thanks a lot.