Automatic compensation by capacitors