## 2 System Architecture  
In this system, a microcontroller sends a Pulse Width Modulation (PWM) signal to a driver circuit that converts it into a suitable signal to control the electromagnetic circuit. The position of the magnet and the current flowing in the electromagnet are obtained by using the 10 bit Analog-to-Digital Converter (ADC) of the microcontroller ATmega2560 to convert the signals sent by the sensors. The position and current sensors are linear Hall effect sensors, respectively the A1324 and ACS711 of Allegro Microsystems [25; 26]. The system is monitored via an USB serial connection through microcontroller using Simulink together with the Simulink Support Package for Arduino Hardware Add-on [27]. Figure 1 illustrates the block diagram of the general system architecture.  
The driver circuit is represented in Figure 2, and it contains the diode (D) for the currents generated by the inverse polarities due to the inductive nature of the system, a pull-down resistor (R\({}_{pd}\) = 4.7 k\(\Omega\)) to prevent the gate of the Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET) (Q) from floating, and a capacitor (C = 1.0 mF) to ensure that the 5 V supplied by the voltage regulator is stable. It is a simple driver that effectively supplies the electromagnetic system with the current required to leviate the magnetic disc.  
In Figure 2 the orange rectangle represents the electromagnet, where R\({}_{e}\) and L\({}_{e}\) are the electromagnet resistance and inductance, respectively. As shown in the Figure 3, the magnetic disc stays below the electromagnet and the position sensor stays directly under the electromagnet and as such it will suffer the influence of the magnetic field of both the magnetic disc and the electromagnet.  
Figure 1: General system architecture.  
Figure 2: Driver circuit.  
The parameters values of the system are listed on Table 1, where the weight, diameter, and thickness correspond to the disc.  
A photo of the experimental levitation system is presented in Figure 4. A passive heat-sink was used so the voltage regulator was able to supply the current needed to the electromagnet.  
This system used a Funduino Mega 2560 board, which is a copy of Arduino Mega 2560. The board has 8 bits ATmega2560 microcontroller from Microchip. This microcontroller was chosen due to the available Flash Memory and Static Random-Access Memory (SRAM),  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Component** & **Value** & **Units** \\ \hline Resistance (R\({}_{e}\)) & 3.0 & \(\Omega\) \\ \hline Inductance (L\({}_{e}\)) & 15.0 & mH \\ \hline Maximum current & 1.5 & A \\ \hline Weight (m) & 3.0 & g \\ \hline Diameter & 37.3 & mm \\ \hline Thickness & 28.5 & mm \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameters of the system [28].  
Figure 4: Experimental electromagnetic system.  
Figure 3: Position sensor and electromagnet arrangement.  
as shown in the specifications of Table 2. This is one of the most expensive parts of the control system, costing about 10 euros. With the Simulink Add-on, the code will be generated by Simulink model and deployed on the microcontroller. The sampling period for the controllers was set to T = 0.003 s, which was the maximum value found for obtaining a steady stable levitation using the root-locus method described in Section 4 for the design of the classical linear controllers. The same sampling interval was adopted in the design of the neural controllers of Section 5.