This document discusses slope compensation in digitally controlled power supplies. Slope compensation is needed to prevent sub-harmonic oscillations when operating in peak current mode control with duty cycles over 50%. The document proposes a new software-based method for dynamically adjusting slope compensation that maintains stability across all duty ratios without requiring extra hardware. Simulation results show the proposed method reduces current ripple deviation by over 10x compared to standard fixed-slope approaches.