There has been somedays when a new project with same Magnetic Levitation was done at our arduino forum (look out for it in exhibitions) the guy had a really nice working PID for magnetic levitation , IM attaching that programme.
MagneticLevitation.ino (7.38 KB)