10 years, 8 months ago.

digital PID control help for non-inverting buck boost converter

Hello guys,

I am new to this mbed and now i am doing non inverting buck boost converter project with mbed. I need to do PID for voltage control and i am struggling with this . /media/uploads/phoowalone/non-inverting-buck-boost-circuit.jpg

first i am going to use voltage control . the process is shown in the picture .

/media/uploads/phoowalone/control_non_inverting_buck_boost.jpg

when the circuit is produce output voltage, firstly, the voltage is scale down by using voltage divider as Mbed board can accept ( 0- 3.3) volt . than do the ADC . then gain .

my problem is i do not know how to write PID control for this circuit. here is the few line of code up to the gain point . and then i need to do comparison with reference voltage and PID control. but i do not know how to write PID control.

this circuit works as buck ,boost and buck boost according to the pwm changing. so i need to compute the PID values and then update my pid values to adjust the pwm. this is what i am struggling now. Please anyone help me with this.

  1. include "mbed.h"
  1. include "PID.h"

AnalogIn VoutRAW(p20);

float VoutActual;

double R1 = 920000;

double R2 = 146000; int main() {

while (1) {

VoutActual= VoutRAW*(3.3* (1066/146)); doing adc and gain.

}

}

thanks for help.

is anyone knows where can i see the sample code for that. thanks you.

posted by phoo wa 09 Apr 2014

Here are quite some different PID codes: https://mbed.org/search/?type=&q=PID. Many of the libraries also have 'dependants', which implement that library.

posted by Erik - 09 Apr 2014

thanks , i have look around for this PID and this is mostly for motor control and i do not see anything relating with power converter control. but thanks for that.

posted by phoo wa 09 Apr 2014

1 Answer

10 years, 7 months ago.

The ARM CMSIS dsp library has a simple PID implementation.

There is not much difference between motor control and power converter control, except that you'll have to ensure that you don't create too high a voltage in boost mode (it would help to have a zener or other protective device, at least for development).

Some good information:

http://www.ecircuitcenter.com/Circuits/pid1/pid1.htm

http://www.mstarlabs.com/control/selftest.html

http://www.jashaw.com/