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 MIX mode is there the line IErr1 = IErr0; (updating the historical error for the current-loop PID).
(The code for BUCK and BOOST modes, where at the comment “// 历史数据幅值” (“historical data magnitude”)) does not include IErr1 = IErr0;)
(Code for MIX mode, where at the comment “// 历史数据幅值” (“historical data magnitude”) includes IErr1 = IErr0;)
I don’t quite understand why the update of the current-loop PID’s historical error is performed only in MIX mode.

