

▲ 1 r/Magnets
help magnetic levitatio
🎯 Project Aim
To design and build a dual-coil magnetic levitation system using an ESP32 microcontroller. The goal is to make a small metal object hover stably in mid-air at a fixed height using two electromagnets (one above, one below) and a feedback control loop.
- Control Type: PID (Proportional-Integral-Derivative) control loop
- Control Logic: The top coil pulls the ball up, the bottom coil pulls it down. The sensor reads the ball's position, and the ESP32 adjusts the PWM duty cycle of both coils to keep the ball at the setpoint.
- Features: Soft-start ramp, low-pass ADC filtering, derivative filtering, anti-windup on the integral term, and real-time serial tuning (Kp, Kd, Ki, setpoint).
- Testing: We have also tried Bang-Bang (ON/OFF) control and Proportional + Feedforward control.
🤔 What We Need Help With
- Is it even possible to levitate a steel ball with a Hall sensor?
- Should we switch to a Neodymium Magnet Ball (which has its own field)?
- Should we switch to an Optical Sensor (like VL53L0X) that measures physical distance instead of magnetic fields?
- What is the single most important change we need to make to get a stable hover?
u/Alternative_Dig_1647 — 7 days ago