I've been banging my head on this project for a while and need some guidance. It is a magnetic levitation device that is used in control theory class. I've never taken the class so have been trying to learn it through online courses and books. I think I get some of the basics but not enough to figure this out.
The way the system is supposed to work is that an electromagnet pulses its output to keep an object (permanent-magnet in my case) levitated.
Brief description of the system: There is an electromagnet that is being controlled by a PWM signal from an Arduino. The Arduino knows, or is supposed to know, what duty cycle to provide based on the the current through the electromagnet and the hall effect sensor.
As the object gets closer to the hall sensor the value of the hall sensor increases. The whammy here is that as the current, which is controlled by the PWM, through the electromagnet changes the hall sensor reacts to this as well. To get rid of this effect, we measure the current through the electromagnet convert it to a "hall value" and subtract it out to normalize the hall sensor reading. This in effect gives a pure reading of the object's distance relative to the hall sensor.
Schematic
Now my issues is how to characterize and tune the system.
One of the techniques to characterize the system is to provide an impulse or a step and measure the response of the system. I tried using a step response, which is essentially providing power to the electromagnet. Now the question is how do I measure the response. If I give full power to the electromagnet the permanent magnet shoots up and gets stuck. I have an overshoot situation. If I provide less power nothing really happens. I am stuck in a binary situation: the permanent magnet either doesn't move or shoots up and gets stuck.
How can I characterize this system with this limitation?
I've also tried just using a PID controller and doing some guessing for tuning it, but kept getting to that same issues.
Thanks,