Group project in the System Dynamics class in Fall, 2020.
Our goal was to make a magnetic levitation device that could hold a steel ball mid-air.
At first, we designed a device as shown on the right. A coil was the main component in this system, providing upward supporting force for the magnet. At the bottom, A Hall effect sensor was used to infer the position of the magnet for control purposes. The LEDs and optical sensors were set to provide additional information about the exact location of the magnet.
However, things did not go as planned. We noticed that the coil did not produce enough force to levitate the steel ball, and therefore we added a magnet onto the ball.
To model the system, we opted to linearize the force from the magnet with respect to current and distance.
The exact slopes of the above curves can be determined by experiments. First, the relationship between force and distance is investigated with the setup below.
Modelling the system
The system can be divided into two parts: the electromagnet (coil) and the ball in the magnetic field.
(modelling using MATLAB)
Without control, the system is unstable.
The initial thought was to utilize PID control. However, the traditional transfer function view cannot achieve the optimal dynamics, because the time constant for the mechanical system is much larger than that of the electromagnetic system.
Bode plot (original system)
Bode plot (with PID control)
State-space representation could avoid this problem, and the system can be modeled as below:
The system is both observable and controllable, and therefore state-feedback control can be employed.
State feedback control would always yield a steady-state error.
Adding a integrator to the system
The integrator could help get rid of the steady-state error, and there is no overshoot as with PID control.
By tweaking the eigenvalue of the system, the response could be improved, as shown below.
λ = -100
λ = -1
With the hardware and circuit layout on the right, we managed to set up a testing unit for our theory.
Arduino MEGA board was used to carry out the control. A SIMULINK model was presented below for the digital control of the system.