A PWM (Pulse Width Modulation) controller includes a current detector, a current emulator, a voltage-to-current converter, and a current adder. The current detector detects a first current, and generates a second current according to the first current. The current detector receives an input voltage and outputs an output voltage. The current emulator obtains the relative information of a lower-gate current. The voltage-to-current converter draws a third current from the current emulator according to the input voltage and the output voltage. The current emulator generates a fourth current according to the relative information and the third current. The current adder adds the fourth current to the second current, so as to generate a sum current.