Finding right parameters Ki and Kp for PI Controller in a H bridge converter system

Hello everyone , i am aiming to find the right parameters Ki and Kp for a PI Voltage Controller in my system. I am modelling a H-bridge converter with unipolar modulation, and outside the H-bridge converter i put a LC filter and in parallel to the C there is the load represented by a resistor. The switching frequency fs of the bridge is 13kHz and the values are L = 220 e-6, C = 16.8e-6 while Rload = 4, the input voltage of the bridge is 80Volt..I obtained a resonance frequency around 2.6kHz ( i tried to choose it to be almost fs/10) and the damping factor is around 0.4. Now that i choose my LC parameters, basing on my system how can i find the right value of Ki and Kp of the PI voltage controller? The aim is to control my output voltage of the H bridge and i want to be able to follow a sinisouidal signal reference around 50Herz so i think i have to realize a PI Controller around 500Hz of bandwith? I wanna write the PI discrete controller as a Matlab function with the control variable represented i guess by the modulation m parameter? Am i right? so i evaluate the error and i find with the PI the modulation value or directly the duty cycle? i think I should find the modulation and then I do a comparison with a triangular carrier to find the pwm signalsand thats what i did... How can i realize a good discrete voltage PI controller with good Ki and Kp parameters basing on my system? can you help me during all the steps cause i am new with controls. thank you so much in advice

6 Kommentare

hello
well if you are new to controls you may need to take a bit of time to understand the concept of "plant" , open loop gain, stability margins and so forth...
if you are in a hurry , you can try use the available tools for PID tuning using matlab / simulink, like :
but you need first to measure your plant gain , so one method is the step response (and PID can be tuned based on the step response)
assuming you measure the load voltage vs PWM value , create a PWM step (at any given time value t > 0) and measure the load voltage change according to this step
you can follow this example (there are more than enough other examples on the web) : Control Tutorials for MATLAB and Simulink - Introduction: PID Controller Design
With these parameters, you should be able to identify a mathematical model of the H-bridge, preferably in the form of a Laplace-domain transfer function, typically represented as a 1st-order system.
If you understand the “physics” of the 1st-order transfer function, specifically its amplitude and time constant, you can determine the required Kp​ and Ki​ gains analytically. Otherwise, you can use a trial-and-error tuning approach with a loop-based search to "visually" identify the best combination of Kp​ and Ki​​ values that satisfies the performance requirements (or a loss/cost/objective function).
You can discretize the PI controller later, once a satisfactory result has been obtained.
Hi yes i have aknowledgments about plant, open loop and gain. I tried to write my transfer function of my system that includes the LC filter and the H bridge converter using the fact that in a full bridge with unipolar modulation Vout = m*Vin where m is equal to m= (2d-1) where d is the duty cycle. I tried to evaluate the TF between output (the voltage on the Rload) and the input representing by my modulation input like this( i also add some parassitic resistor for the inductance and capacitors named Rc and RL). My model is a H bridge converter + LC filter in output + Rload in parallel to the Cfilter.
Then i tried to use this transfer function in the PID Tuner tool you suggested to me. Am i doing right ? the G(s) i write is right for representing my system?
Best regards
As regard as my requirements, i had to follow a 50Hz sinusoidal wave so my control should be able to follow this signal since i had a resonance filter at 2.6kHz i am planning to realiza a PI controller around 300-500 Hz justo to be sure to follow my 50Hz reference.
Best regards
Using your TF, you can start with this example (check the gain at 50 Hz in your case) , then do a simulation at 50 Hz
%% PID Tuning for DC Motor Speed Control
%% Motor Parameters (example values)
R = 2; % Armature resistance (Ohms)
L = 0.5; % Armature inductance (H)
Kb = 0.1; % Back EMF constant (V*s/rad)
Kt = 0.1; % Torque constant (N*m/A)
J = 0.02; % Rotor inertia (kg*m^2)
B = 0.02; % Viscous friction coefficient (N*m*s)
%% Transfer Function of DC Motor
% Motor: ω(s)/Va(s) = Kt / [(J*s+B)*(L*s+R) + Kt*Kb]
num = Kt;
den = [(J*L) (J*R + L*B) (B*R + Kt*Kb)];
motor_tf = tf(num, den);
disp('DC Motor Transfer Function:');
DC Motor Transfer Function:
motor_tf
motor_tf = 0.1 ------------------------ 0.01 s^2 + 0.05 s + 0.05 Continuous-time transfer function.
%% Open-loop Step Response
figure;
step(motor_tf);
title('Open-loop Step Response of DC Motor');
grid on;
%% PID Controller Design using pidtune
% Target bandwidth and phase margin can be adjusted
targetBW = 10; % rad/s
[C_pid, info] = pidtune(motor_tf, 'PID', targetBW);
disp('Tuned PID Controller:');
Tuned PID Controller:
C_pid
C_pid = 1 Kp + Ki * --- + Kd * s s with Kp = 6.53, Ki = 11.1, Kd = 0.963 Continuous-time PID controller in parallel form.
%% Closed-loop System
cl_sys = feedback(C_pid * motor_tf, 1);
%% Step Response of Closed-loop System
figure;
step(cl_sys);
title('Closed-loop Step Response with Tuned PID');
grid on;
%% Performance Metrics
S = stepinfo(cl_sys);
disp('Closed-loop Step Response Info:');
Closed-loop Step Response Info:
disp(S);
RiseTime: 0.1666 TransientTime: 0.8885 SettlingTime: 0.8885 SettlingMin: 0.9019 SettlingMax: 1.0736 Overshoot: 7.3625 Undershoot: 0 Peak: 1.0736 PeakTime: 0.4191

Melden Sie sich an, um zu kommentieren.

Antworten (1)

I understand that you are looking for guidance on selecting suitable Kp and Ki values for a discrete PI controller in an H-bridge converter system.
A PI controller is a suitable starting point for this type of voltage-control application because it can help reduce steady-state tracking error. However, the exact values of Kp and Ki depend on the plant dynamics, including the averaged H-bridge model, LC filter parameters, load conditions, and the selected sampling time.
A recommended approach is to first derive or linearize the plant model, then tune the PI controller based on the desired closed-loop bandwidth or crossover frequency while maintaining sufficient stability margin. The gains can then be refined through simulation to verify tracking performance, settling time, overshoot, and robustness.
In MATLAB and Simulink, you can use Control System Toolbox workflows such as “PID Tuner” or “pidtune” to tune the PI controller from the plant model. These tools allow you to specify tuning goals such as response speed and robustness and then validate the controller behavior in simulation before implementation.
Therefore, rather than selecting fixed generic values for Kpand Ki, I recommend tuning the gains based on the specific converter model and validating them under the expected operating conditions.
For more information on tuning PI gains, please refer to the following MathWorks documentation:
  1. PID Tuner - Tune PID controllers - MATLAB
  2. PID Controller Design at the Command Line - MATLAB & Simulink
  3. Control DC Motor with PWM Voltage Source and H-Bridge Driver - MATLAB & Simulink
  4. Design PI Controller for DC-DC Converter - MATLAB & Simulink
  5. Tune PI Controllers Using Field Oriented Control Autotuner - MATLAB & Simulink Example

Produkte

Version

R2025a

Gefragt:

am 12 Mai 2026

Beantwortet:

am 12 Jun. 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by