hall sensor in magnetic levitation.

Hello
I was watching magnetic levitation and have a question.
this is magnetic levitation

And my question is, It is using magnetic sensor called hall sensor and, when solenoid's current was changed by pwm, the magnetic field will be changed.
And then, how does hall sensor can detect parmanent magnet's distance?

The hall sensor cannot detect a distance, but it seems to be possible to hover the magnet at a certain strength of the magnetic field. It's up to you to determine the right coil polarity and sensor value, depending on your coil and magnet.