I want to do an hysteresis current control with this circuit:
that have three operation modes:
in order to make the output current to follow a triangle wave as reference.
I made a simple C code to use it with the S-function block in Matlab/Simulink (which basically says: if output current is greater than triangular reference turn Sa and Sb OFF, otherwise (less than reference) turn Sa and Sb ON. However, I'm obtaining this output current:
As you can see, current is ugly and made me ask this question because I'm having trouble about selecting the correct values for capacitors and inductors.
Any suggestion or comment would be truly appreciated. Thanks!