Analysis of Several Control Modes of Single Chip Microcomputer Controlling Switching Power Supply
One is that the single-chip microcomputer outputs a voltage (via DA chip or PWM mode), which is used as the reference voltage of the power supply. This method only replaces the original reference voltage with a single-chip microcomputer, and the output voltage value of the power supply can be input with buttons. The single-chip microcomputer does not join the feedback loop of the power supply, and the power supply circuit does not change much. This way is the easiest.
The second is to expand the AD of the single-chip microcomputer, continuously detect the output voltage of the power supply, adjust the output of the DA according to the difference between the output voltage of the power supply and the set value, control the PWM chip, and indirectly control the work of the power supply. In this way, the single-chip microcomputer has been added to the feedback loop of the power supply, replacing the original comparison and amplification link, and the program of the single-chip microcomputer needs to adopt a more complicated PID algorithm.
The third is to expand the AD of the single-chip microcomputer, continuously detect the output voltage of the power supply, and output PWM waves according to the difference between the output voltage of the power supply and the set value, and directly control the work of the power supply. In this way, the single-chip microcomputer intervenes in the power supply work the most.
The third way is the most thorough single-chip microcomputer control switching power supply, but it also has the highest requirements for the single-chip microcomputer. It is required that the operation speed of the single-chip microcomputer is fast, and it can output a PWM wave with a sufficiently high frequency. Such a microcontroller is obviously expensive.
The speed of DSP single-chip microcomputer is high enough, but the current price is also high. From the perspective of cost, it accounts for a large proportion of power supply cost, so it is not suitable for use.
Among the cheap single-chip microcomputers, the AVR series is the fastest and ha

s PWM output, which can be considered. However, the operating frequency of the AVR single-chip microcomputer is still not high enough, and it can only be barely used. Let's specifically calculate what level the AVR microcontroller can directly control the switching power supply.
In the AVR microcontroller, the clock frequency is up to 16MHz. If the PWM resolution is 10 bits, then the frequency of the PWM wave, that is, the operating frequency of the switching power supply is 16000000/1024=15625 (Hz), and it is obviously not enough for the switching power supply to work at this frequency (in the audio range). Then take the PWM resolution as 9 bits, and the operating frequency of the switching power supply this time is 16000000/512=32768 (Hz), which can be used outside the audio range, but there is still a certain distance from the operating frequency of modern switching power supplies.
However, it must be noted that the 9-bit resolution means that the turn-on-turn-off cycle of the power tube can be divided into 512 parts. As far as the turn-on is concerned, assuming that the duty cycle is 0.5, it can only be divided into 256 parts. Considering the non-linear relationship between the pulse width and the output of the power supply, it needs to be folded at least in half, that is to say, the output of the power supply can only be controlled to 1/128 at most, regardless of the change of the load or the change of the power supply voltage, the degree of control can only go so far until.
Also note that there is only one PWM wave as described above, which is single-ended work. If push-pull operation (including half-bridge) is required, two PWM waves are required, and the above-mentioned control accuracy will be halved, and can only be controlled to about 1/64. It can meet the usage requirements for low-demand power sources such as battery charging, but it is not enough for power sources that require high output accuracy.