To analyze the performance of the PID controller in a buck type converter implemented in real time, the start of design will be the continuous controller using the analytical method for calculating PIDs. PWM is then used and from this point you will find the bifurcation diagrams analytically and it will show some problems of switching and sampling time. Then the model of the converter is used and implements PID controller \cite{artPID} in a dSPACE. In the experimental case it shows in more detail the requirements of sampling frequency and switching speed. Finally it shows the performance of PID controller.