Implementation of control and protection logics for a bidirectional DC/DC converter