Text this: Control of a four-quadrant machine drive with improved power quality