Hello everyone,
I am trying to design SEPIC converter. I am going to use typical SEPIC schematics ( http://www.coilcraft.com/misc/lpd4012s.html ) to drive MOSFET with PWM by changing duty cycle. I am going to use PID algorithm C code from STM:
uint16_t DoFullPID(uint16_t In, uint16_t Ref, uint16_t *Coeff)
{
uint16_t Kp, Ki, Kd, Output, Error;
Error = Ref - In;
Kp = Coeff[0];
Ki = Coeff[1];
Kd = Coeff[2];
IntTerm_C += Ki*Error;
Output = Kp * Error;
Output += IntTerm_C;
Output += Kd * (Error - PrevError_C);
PrevError_C = Error;
return (Output);
}
The main thing I do not understand how to relate OUTPUT with PWM duty cycle? Maybe somebody could advice me or show any example code?
I am trying to design SEPIC converter. I am going to use typical SEPIC schematics ( http://www.coilcraft.com/misc/lpd4012s.html ) to drive MOSFET with PWM by changing duty cycle. I am going to use PID algorithm C code from STM:
uint16_t DoFullPID(uint16_t In, uint16_t Ref, uint16_t *Coeff)
{
uint16_t Kp, Ki, Kd, Output, Error;
Error = Ref - In;
Kp = Coeff[0];
Ki = Coeff[1];
Kd = Coeff[2];
IntTerm_C += Ki*Error;
Output = Kp * Error;
Output += IntTerm_C;
Output += Kd * (Error - PrevError_C);
PrevError_C = Error;
return (Output);
}
The main thing I do not understand how to relate OUTPUT with PWM duty cycle? Maybe somebody could advice me or show any example code?