The application relates to a PWM control analog quantity output method and device,
computer equipment and a storage medium. The method comprises the following steps: obtaining a target analog quantity output value V and converting the target analog quantity output value V into a target fixed-point quantization value D; selecting a time point at which an output analog quantity change rate is lower than a preset threshold value as a stable time point t1, collecting a steady-state
duty cycle P1, a steady-state quantization value D1 and a steady-state analog quantity output value V1 at the stable time point t1, and calculating an
RC time constant of a
capacitor at the stable time point t1 according to the steady-state
duty cycle P1, the steady-state quantization value D1 and the steady-state analog quantity output value V1; selecting a corresponding segmented
processing strategy according to the target fixed-point quantization value D and the steady-state quantization value D1 at the stable time point to generate a PWM output
duty cycle P; performing integral correction on the PWM output duty cycle P to obtain a corrected duty cycle P'; updating the corrected duty cycle P' after correction to a PWM register to obtain an actual output analog quantity, and the value of the actual output analog quantity is an actual analog quantity output value V'. The application has the effect of improving the real-time performance of PWM control analog quantity output.