# PID controlled boost converter

#### myil

Joined May 2, 2020
112
Hi Everyone,
I am trying to build a PID controlled boost converter by using a microcontroller. But having a difficult time to relate PID's output to duty cycle. Once it reaches the setpoint, output becomes zero and therefore duty cycle as well. So it kind of acts like unstable. I don't know how my approach should be to solve the problem.
Regards

#### crutschow

Joined Mar 14, 2008
28,580
Hard to tell the problem since we have no info on how you configured the system or what the parameters are for the PID and how you arrived at them.

You approach should be to derive the loop parameters for the boost converter and then determine the PID parameters needed to stabilize the control loop. Did you do that?
That's not a trivial problem.

#### Papabravo

Joined Feb 24, 2006
17,646
Making a determination of the "plant" dynamics is a fairly involved process. That should be your first step and a well constructed simulation can help with that. Once you have a control strategy for affecting the output variable, you need to chacterize the "closed" loop dynamics of the plant plus the control. Only then can you embark on the final step of selecting and chosing the PID parameters.

#### myil

Joined May 2, 2020
112
Let's say my setpoint is 2.5V and the voltage value I get from voltage divider as a feedback is 2.5V. In this case, the error will be zero right. So, how can convert this zero value to duty cycle? The duty cycle needs to get a positive number to keep the error to be zero. But error gets a greater number when it starts and approaches to zero when it tries to settle. I am confused with that.

Last edited:

#### Papabravo

Joined Feb 24, 2006
17,646
That is exactly the "plant" dynamics I am talking about. In a boost converter you are going from a lower voltage to a higher voltage. Each duty cycle that you can have will be equal to some relation between input voltage and output voltage. To regulate around that operating point you only need small changes. Let us say that a duty chcle of 45% gives us the relationship we want. Then if the output voltage is too much or too little we adjust it up or down by a small amount trying to maintain the duty cycle at or near 45%.

#### crutschow

Joined Mar 14, 2008
28,580
But error gets a greater number when it starts and approaches to zero when it tries to settle. I am confused with that.
That's what the feedback controls.
It adjusts the duty-cycle until the voltage error is zero and then maintains that duty-cycle, or adjusts it slightly if there's a change in the input voltage or load.
If you understood how PID loops work (do you know what PID stands for?), then you wouldn't be confused.
Do you know how to incorporate PID elements in the microprocessor software?

If you don't have to use PID, there's an alternate control loop design for processors called Fuzzy Logic.
I consider it easy to use and understand than PID.