https://oshwhub.com/zeruns/ji-yu-stm32-de-buck-boost-xing-shu-zi-dian-yuan I’m currently replicating and studying this project. In the code’s PID section, there are three modes: BUCK, BOOST, and MIX. However, I noticed that only in the MIX mode is there the line IErr1 = IErr0; (update of the current loop PID’s historical error).
(Code snippets for BUCK and BOOST modes—note that at the comment “// 历史数据幅值” (historical data magnitude), the line IErr1 = IErr0; is missing.)
(Code snippet for MIX mode—here, at the comment “// 历史数据幅值”, the line IErr1 = IErr0; is present.) I don’t quite understand why the update of the current loop’s historical error is performed only in MIX mode.

