This document summarizes an online nonlinearity compensation technique for PWM inverter drives. Inverter nonlinearity arises from voltage distortions due to dead time, voltage drop across switches, and turn on/off delays. This nonlinearity deteriorates drive performance and causes torque ripple. The proposed method uses trapezoidal voltage compensation based on average value theory with voltage drop compensation. A compensation voltage is added to the reference voltage to account for inverter nonlinearity. The technique is validated through simulation of an induction machine drive. Adjusting the trapezoidal compensation voltage angle can modulate low-order harmonics to adapt to varying operating conditions.