Design of a controller for magnetic levitation