Design and Control of a Bidirectional Active Front Converter Validated by Hardware-in-the-Loop