Hello, im trying to make a electromagnetic levitator with an arduino nano, and i have a problem reading the hall sensor to determine the proximity of the magnet i want to levitate, becouse i use PWM to control the electromagnet power, its own magnetic field interfiere the hall sensor reading, so i want to only read the hall sensor when pwm pulses goes low and the electromagnet is powered down, i tried wiring pwm pin to an external interupt pin, and then read the hall sensor inside the interupt routine ,but in doesnt work well, also adding a second hall sensor on top of the magnet and subtracting its values frim the botom one is not a posibility becouse the electromagnet i use doesnt produce singnificant magnetic field on top, somehow i managet to levitate a magnet but the system is too inestable and it fall down in mater of seconds. So is there a way to to get it working using only one hall sensor and eliminate the electromagnet effect from the hall sensor radings ?
You will get better responses if you edit your original post and move it to a more appropriate forum like Project Guidance. Installation and Troubleshooting deals with getting the IDE up and running.
which guy ? All i manage to found is levitators based on analog circuits,or levitators using IR sensors, there one guy using STM32 and he told in the coments to mesure the hall sensor between pulses but didnt explain how to do it.
The current continues after that, until the magnetic field has collapsed, until the energy in the magnetic field is down to nothing.
Look for the project done!
I will try it, but i dont understand how this will work asi it will run on the same problem as i, becouse it reads the hall sensor without turning the electromagnet off first and then it will feed bad values to the pid controller.