Finding right parameters Ki and Kp for PI Controller in a H bridge converter system
Ältere Kommentare anzeigen
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
Mathieu NOE
am 12 Mai 2026
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
Sam Chak
am 12 Mai 2026
Hi @Gianluca
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.
Gianluca
am 12 Mai 2026
Gianluca
am 12 Mai 2026
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:');
motor_tf
%% 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:');
C_pid
%% 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:');
disp(S);
Mathieu NOE
am 27 Mai 2026
hello again @Gianluca
problem solved ?
Antworten (1)
Ritika Thusoo
am 12 Jun. 2026
0 Stimmen
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:
- PID Tuner - Tune PID controllers - MATLAB
- PID Controller Design at the Command Line - MATLAB & Simulink
- Control DC Motor with PWM Voltage Source and H-Bridge Driver - MATLAB & Simulink
- Design PI Controller for DC-DC Converter - MATLAB & Simulink
- Tune PI Controllers Using Field Oriented Control Autotuner - MATLAB & Simulink Example
Kategorien
Mehr zu PID Controller Tuning finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

