A control algorithm of power converters in smart-grids for providing uninterruptible ancillary services