The What Is Magnetic Levitation Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Apart from the science fiction, science knows various numbers of ways to levitate things. For example, a helicopter can be seen as a very remarkable levitation device that uses air flow to keep floating. The scientists also found many ways to levitate things without making noise or the need for gas or air, using electromagnetic fields. Levitating trains is the example of electromagnetic levitation. However, in all these plans, a source of energy (an engine or a battery at least) is still necessary to keep an object floating. Remove the battery and the levitation unavoidably stops.

What is magnetic levitation? Magnetic levitation, maglev, or magnetic suspension is a technique by which an object is suspended without additional support than the magnetic fields. The magnetic pressure is used to neutralize the effects of gravity and other accelerations. Essentially, this is the use of magnetic fields (or magnetic forces) to levitate a metal object. By manipulating the magnetic fields and control of their forces, an object can be levitated. Magnetic levitation systems are receiving increasing attention currently because of their practical applications in various fields, such as transportation systems, for example, maglev trains, moving metallic objects in steel industry using the so called magnetic floaters, possible military applications, for example, the so called rail gun.

Magnetic levitation systems are good examples of control systems. The load is levitated balancing the force of gravity on the load with the magnetic attraction from the control system. If the magnetic attraction is too small, then the force of gravity takes over and the load will fall on the ground. If the magnetic attraction is too strong, then it will overtake and the load will be attached to the control system. In the steady state, the magnetic force is equal in magnitude and opposite direction to the force of gravity and hence the load will be suspended, levitating as the resulting force is equal to zero.

Magnetic levitation systems have their advantages, for instance, they can be used in harsh environments (corrosive, vacuum, etc.) where traditional mechanical or hydraulic actuators might not survive. However, there also exist constraints that currently prevent maglev systems from widespread use.

Magnetic levitation is nonlinear, and this property puts significant demands on the control technologies used in maglev systems. In this thesis, a state-input feedback linearization approach is used to cancel the nonlinearity in the maglev model. Meanwhile, H-bridge Motor Drive is added to the nonlinear controller to make a magnet float in the air.

Magnetic levitation is the process of levitating an object by exploiting magnetic fields. In other words, it is overcoming the gravitational force on an object by applying a counteracting magnetic field. Either the magnetic force of repulsion or attraction can be used. In the case of magnetic attraction, the experiment is known as magnetic suspension. Using magnetic repulsion, it becomes magnetic levitation.

In the past, magnetic levitation was attempted by using permanent magnets. Attempts were made to find the correct arrangement of permanent magnets to levitate another smaller magnet, or to suspend a magnet or some other object made of a ferrous material. It was however, mathematically proven by Earnshaw that a static arrangement of permanent magnets or charges could not stably magnetically levitate an object.

Apart from permanent magnets, other ways to produce magnetic fields can also be used to perform levitation. One of these is an electrodynamics system, which exploits Lenz's law. When a magnet is moving relative to a conductor in close proximity, a current is induced within the conductor. This induced current will cause an opposing magnetic field. This opposing magnetic field can be used to levitate a magnet. This means of overcoming the restrictions identified by Earnshaw is referred to as oscillation.

Electrodynamics magnetic levitation also results from an effect observed in superconductors. This effect was observed by Meissner and is known as the Meissner effect. This is a special case of diamagnetism.

Magnetic fields are used to describe forces at a distance from electric currents. These currents are of two types: free, or Amperian, currents as drawn from a battery pack, power supply, or an electrical outlet and bound currents as in permanent magnet materials. The forces come in three variations: An electrical current feels a force from another current, a current feels a force from a permanent magnet, and a permanent magnet feels a force from another permanent magnet. This action at a distance is described by saying a magnetic field exists created by one of the bodies at the location of the other body. The magnetic field is the medium by which the force is transferred.

The magnetic fields due to free current distributions are used to calculate the forces felt by current-carrying conductors. Time-varying currents cause time-varying magnetic fields. These changing magnetic fields induce electric currents which, in turn, experience a force.

Maglev systems utilize the fundamental physics of electric currents experiencing forces at a distance. These systems are most often described in terms of the interaction of electrical current with magnetic fields. Because the masses of the vehicles are large, large forces are required for magnetic suspension. These large forces are provided by the high magnetic fields of either large superconducting currents or small air gaps in normal ferromagnetic circuits.

This thesis will mainly deal with electromagnetic levitation using feedback techniques to achieve stable levitation of a bar magnet.


The early beginnings of the magnetic levitation can be drawn back to John Mitchell (1750) where he noticed the repulsion of two magnets when the same poles were put together. The purpose of using magnets to achieve high speed transport with non-contact magnetic levitation vehicle is almost a century. In early 1900, Michelle Bachelet in France and Goddard in the United States discuss the possibility of using magnetically levitated vehicles for high speed transport. However, they did not offer a convenient way to achieve this goal.

On August 14, 1934, Hermann Kemper of Germany received a patent for magnetic levitation trains. Research continued after World War II. In the 1970s and 1980s, development, authorizing, testing and execution of various systems Maglev train continued in Germany by Thyssen Henschel. The Germans called their system maglev "Transrapid".

In 1966, in the United States, James Powell and Gordon Danby proposed the first practical system for magnetic levitation transportation, using superconducting magnets placed on moving vehicles to induce currents in normal aluminum loops on a guide way. Moving vehicles are automatically levitated and stabilized, both vertically and horizontally, as they move along the guide way. The vehicles are magnetically driven along the magnetic guide way by a small alternating current in the guide way.

In 1992, the Federal Government in Germany decides to include the 300 km long superspeed MagLev system route Berlin-Hamburg in the 1992 Federal Transportation Master Plan.

In June of 1998, the US congress passes the Transportation Equity Act for the 21st Century. The law includes a MagLev deployment program allocating public funds for preliminary activities with regard to several projects and, later on, further funds for the design, engineering and construction of a selected project. For the fiscal years 1999 - 2001, $55 million are provided for the MagLev deployment program. An additional $950 million are budgeted for the actual construction of the first project. In November of 1999, the Chinese Ministry of Science and Technology and Transrapid International sign a letter of intent to select a suitable Transrapid route in the People's Republic of China and evaluate its technical and economic feasibility.

In January of 2001, in the US, Transportation Secretary Rodney Slater selects the Pittsburgh and the Washington - Baltimore routes for detailed environmental and project planning. Later that month in China, a contract is concluded between the city of Shanghai and the industrial consortium consisting of Siemens, ThyssenKrupp, and Transrapid International to realize the Shanghai airport link. In March, the construction of the Shanghai project begins.

Currently, the original Powell-Danby MagLev inventions form the basis for the MagLev system in Japan, which is being demonstrated in Yamanashi Prefecture, Japan. Powell and Danby have subsequently developed new Maglev inventions that form the basis for their second generation M-2000 System. Other MagLev Train systems are in the planning and development stages in various cities in the US, including projects in Georgia, California and Pennsylvania.

In the future, Maglev promises to be the major new mode of transport for the 21st Century and beyond because of its energy efficiency, environmental benefits and time-saving high velocity transport. Because there is no mechanical contact between the vehicles and the guideway, speeds can be extremely high. Traveling in the atmosphere, air drag limits vehicles to speeds of about 300 - 350 mph traveling in low pressure tunnels, MagLev vehicles can operate at speeds of thousands of miles per hour.

The energy efficiency of Maglev transport, either in kilowatt-hours per passenger mile for personal transport, or kilowatt hours per ton-mile for freight, is much lower for MagLev than for autos, trucks, and airplanes. It is pollution free and can use renewable energy sources such as solar and wind power, and in contrast to oil and gas fueled transport, does not contribute to global warming. It is weather independent, and can carry enormous traffic loads - both people and goods - on environmentally friendly, narrow guide ways. The cost of moving people and goods by MagLev will be considerably less than by the present modes of auto, truck, rail, and air.

In addition to dramatically improving transport capabilities on Earth, Maglev has the potential to greatly reduce the cost of launching payloads into space. While it presently costs $10,000 per pound to orbit payloads using rockets, the energy cost to orbit that same pound would be only 50 cents per pound, if it were magnetically accelerated to orbital velocity. As ultra-high velocity magnetic launchers are developed, the cost of reaching space will come down to everyday, mass market standards.

1) The guideway is constructed where the vehicle wraps around a Tshaped guideway of steel or concrete beams constructed and erected to very tight tolerances


In the past, magnetic levitation was attempted by using permanent magnets. Earnshaw's theorem however, proves that this is mathematically impossible.

There exists no arrangement of static magnets of charges that can stably levitate an object. There are however means of bypassing this theorem by altering its basic assumptions. The following conditions are exceptions to Earnshaw's theorem:

· Diamagnetism: occurs in materials which have a relative permeability less than one. The result is that is eddy currents are induced in a diamagnetic material, it will repel magnetic flux.

· The Meissner Effect: occurs in superconductors. Superconductors have zero internal resistance. As such induced currents tend to persist, and as a result the magnetic field they cause will persist as well.

· Oscillation: when an A current is passed through an electromagnet, it behaves like a diamagnetic material.

· Rotation: employed by the Levitron, it uses gyroscopic motion to overcome levitation instability.

· Feedback: used in conjunction with electromagnets to dynamically adjust magnetic flux in order to maintain levitation.

Each of the above conditions provides solutions to the problem of magnetic levitation. The focus of this thesis is the feedback technique. Feedback with electromagnets can be divided into magnetic suspension and levitation. Magnetic suspension works via the force of attraction between an electromagnet and some object. If the object gets too close to the electromagnet, the current in the electromagnet must be reduced. If the object gets too far, the current to the electromagnet must be increased. Thus the information which must be sensed is the position of the levitating object. The position can then be used to determine how much current the electromagnet must receive. To prevent oscillations however, the rate of change of position must use as well. The position information can easily be differentiated to acquire the speed information required.

Electromagnetic levitation works via the magnetic force of repulsion. Using repulsion though makes a much more difficult control problem. The levitating object is now able to move in any direction, meaning that the control problem has shifted from one dimension to three. There is much interest in levitation due to its possible applications in high speed transport technology. These applications can be broadly referred to as MagLev, which stands for magnetic levitation. A system which more closely resembles the work done in this thesis project is the "MagLev cradle". The MagLev cradle is a system designed by Bill Beaty. It is able to levitate a small rod magnet for a few seconds at a time. This system suffers from serious instability. As such levitation can only be maintained for a few seconds. The system developed for this thesis uses the position sensing technique. Hall Effect sensor is placed on the electromagnet in the system. Electromagnet and its current control circuitry operates a system to levitate a bar magnet. The Hall Effect sensor is a device that senses magnetic flux. It is also capable of detecting the magnetic flux orientation. It is placed on an electromagnet to sense the presence of the bar magnet we wish to levitate.


The aim of this project was to investigate magnetic levitation and to design a working model capable of levitating an object from above. The system should be able to levitate an object from above, with a noticeable distance from electromagnet without any form of support. There shouldn't be any object, structure or device assisting in levitation, on the same level of elevation as the levitating object. The control and circuit complexities should be investigated and recommendations for improving the designed system should be made.

This project is basically the study of levitation and ways to achieve such results, simplifying the circuitry and studying the physics behind of the process; understanding the concept, improving and stabilizing the object which is being levitated from above.


Having the levitated object suspended depends on the initial conditions; furthermore, small disturbances cause the system to become unstable and the levitated object to either fall to the ground or to become attached to the electromagnet. During this project, student worked with several components, parameters and materials in order to improve the stability of the magnetic levitation system and if possible try and create a way for the levitating object to move in upward and downward direction.

2.0-Literature review

There are numbers of journals and books related to this topic, each one was useful in different area. To grasp the concept of levitation many research had to be done, one of the very valuable books that was studied for this project is "University Physics". This book has few chapters about electromagnetism, Gauss's Law, electric charges and the movement of them, the connection between movements of electrons and the magnetic field generated. Magnetism is a phenomenon that occurs when a moving charge exerts a force on other moving charges. The magnetic force caused by these moving charges sets up a field which in tum exerts a force on other moving charges (electromagnetic interactions result from the exchange of photons in between electrons). This magnetic field is found to be perpendicular to the velocity vector of the current. The force of the field reduces with distance from the charge.

The journals that had to be studied for this project were many but some were useful and some others were not due to commercializing their product and false references. A very useful thesis was prepared and written by Jinbo Liu (2004) "Design of a Magnetic Levitation System" Mcgill University. In it he had reviewed different methods and studies to achieve levitation, basics and the concepts had been explained and differences between methods and mechanisms had been discussed.

The other paper that has been studied during the process of this project was written by Kavin Craig, Thomas Kurfess and Mark Nagurka "Magnetic Levitation Tested for Controls Education" Georgia Tech. In it they explain the basic concept of a simple levitation system using physical modeling and block diagrams, this paper provided a different point of view to the process. The reason was, as this paper was prepared for control system topic all the material and the opinions in it are based on control system analysis, therefore it looks at a levitation process more in a physical manner hence it is more applicable. This paper was enlightenment because of its refreshing perspective that caused me to look at the process from a new point. The questions that it initiated at first were tricky but at the end they were all resolved.

For example since this paper was prepared for control system the students used physical representation and MATLAB to construct and test the circuit, hence for me to be able to test and construct the system would be illogical and due to the lack of equipment impossible, so the alternative was to create a system using available components in the market and testing the unit and comparing the result.

The other journal that was studied was prepared by Martin D.Simon "Spin stabilized magnetic levitation" UCLA Department of Physics. This journal like the others explains the physical, analytical and mechanical aspect of a levitation system. In this journal writer explains the Earnshaw's theorem about the magnetic levitation and compares it with the outcome of a levitation system in real life. This journal explains the importance of spinning for the levitated object, and mathematically explains how it could overcome and fix Earnshaw's theory.

But all the journals and books about levitation are theoretical; most of them are about the physics behind of it. So the only use for them was to understand the concept; the practical part of this project and finding ways to achieve the objectives based on what had been studied was not as easy as it seemed.

The concept was relatively simple; an electromagnet attracts and repulses the object based on the sensors feedback hence the levitation is achieved, but in real life it is not as simple as it sounds. For example the material which is used in this project for the electromagnet's core is an iron steel bar which is an alloy (20MnSi) of manganese and silicon, but based on the journals and the books which have been studied, the material for an electromagnet's core is very important due to its permeability. Let us look at different material classified based on their effect on the magnetic field.

(1) Ferromagnetic Materials

These are the metals that are strongly attracted to magnets. They include iron, nickel, cobalt and steel.

(2) Paramagnetic Materials

These are metals that are weakly attracted to magnets. They include aluminum, gold, and copper.

(3) Ferrimagnetic Materials

The main ferrimagnetic material is magnetite, a crystal which occurs naturally in rocks called lodestones, which were the first magnetic materials discovered by man.

(4) Diamagnetic Materials

These materials are everything else... plants, water, soil, wood, skin ... all other substances.

Now you might ask what permeability of a material is, the Magnetic permeability is relative increase or decrease in the magnetic field resulting in a material with respect to the magnetizing field in which the given material is located, or property of a material which is equal to the magnetic flux density B in the material prepared by a field divided by the magnetizing magnetic field intensity H of the magnetizing field.Magnetic permeability μ (Greek mu) is thus defined as μ = B/H. Magnetic flux density B is a measure of the actual magnetic field of a material considered a concentration of magnetic field lines, or the flux per unit cross-sectional area. The magnetic field intensity H is a measure of the magnetizing field produced by the flow of electric current in a coil of wire.Below is the permeability of some Ferromagnetic Materials.



Initial Relative


Maximum Relative





Remanent Flux



Iron, 99.8% pure






Iron, 99.95% pure

Annealed in hydrogen





78 Permalloy

Annealed, quenched






Annealed in hydrogen, controlled cooling





Cobalt, 99% pure






Nickel, 99% pure






Steel, 0.9% C






Steel, 30% Co






Alnico 5

Cooled in magnetic field











Iron, fine powder






Magnetic Properties of Ferromagnetic Materials

So based on the table we can conclude that the 20MnSi is not considered a high permeability material. The materials listed in the table above are not easy to find and they are costly therefore the iron steel bar (20MnSi) was used to construct the electromagnet.

2.1-Basic Types of Maglev

There are two basic types of Maglev according to the common knowledge of magnetism: levitation by attraction and levitation by repulsion. We know that the opposite magnetic poles attract each other. This basic principle is how a suspended type of Maglev train appears to float c10sely to the guideway. In order for the train to float, there must be two coils. The top coil is installed in the guideway and the bottom coil is placed in the train. Attraction is caused by having the currents within each of the circuits traveling in the same direction. We know that the similar magnetic poles repel each other. This basic principle is how this type of Maglev train floats on a cushion of air. There also needs two coils but with an arrangement opposite to the attraction case. This time the top coil is installed in the train while the bottom in the guideway. The current directions in the two coils are opposite in order to generate a repulsive force that counteracts the force of gravity.

Essentially, four basic methods of achieving the magnetic forces required for the suspension or support of a large vehic1e have been seriously considered namely:

(i) Permanent magnets arranged to produce a force of repulsion; The force of repulsion is generated continuously without the expenditure of any power, between the 'like' poles of permanent magnets. The associated magnetic fields, used in this way, can be regarded as an invisible but permanent spring, virtually free from internal friction.

(ii) Electromagnets producing a controlled attractive force;

Although a ferromagnetic body cannot be suspended in stable equilibrium in a static magnetic field, stability can indeed be achieved by using adequate methods of control. By regulating the field of an electromagnet to compensate for any movement of a suspended iron body, the latter can be maintained in a stable position. Systems based on such control of the forces of attraction has been developed in several countries, commercial example will soon be available In Shanghai, China.

(iii) A linear induction motor using AC power and providing both thrust and levitation;

Repulsion systems can be divided into two categories, namely those supplied with alternating current, of which the best known is the levitating linear induction motor, and those using direct current magnets to produce the so-called electrodynamic levitation.

(iv) Electrodynamic repulsion using DC superconducting magnets.

Superconductivity, or the state of near zero electrical resistance which certain metals and alloys exhibit when cooled to liquid helium temperatures, has revolutionized magnet design by enabling large currents to be carried in a relatively small conductors. This kind of technology has enabled a light weight source of intense magnetic field available.

2.2 Theoretical Background of Magnetic Levitation

The Law of Biot Savart is the foundation upon which most of the air core coil formulae are based. It states that the current element dl in a current filament contributes a magnetic field, dB, at point P in a direction normal to the plane formed by dl and the vector r from the current element to point P, as given by the equation:

This equation enables us to compute the magnetic field vector at any point in space.

In a typical magnetic levitation system, a magnetic solenoid controlled by current is used as the source of magnetic field. This kind of solenoid has a length several times its diameter. The magnetic field created inside the cylinder is quite uniform, especia1ly far from the ends of the solenoid. The larger the ratio of the length to the diameter, the more uniforms the field near the middle. Note that this solenoid has a thick shell, meaning that it has a non-negligible windings thickness given by r2-r1.

The following equation gives us the on-axis magnetic field of a solenoid in general case:


B is the magnetic field, in Tesla, at any point on the axis of the solenoid.

The direction of the field is parallel to the solenoid axis.

μo is the permeability constant (1.26xl0-6 Tm/A, for coils measured in meters).

I is the current in the wire, in Amperes.

N is the number of turns of wire per unit length in the solenoid.

r1 and r2 are the inner and outer radii of the solenoid respectively

x1 and x2 are the distances, on axis, from the ends of the solenoid to the magnetic field measurement point.

Note that the units of length may be meters, centimeters or inches (or furlong for that matter), as long as the correct value of the permeability constant is used.

At points that are off-axis, especially those points far from a magnet, solenoid or current loop one can approximate the field by modeling the coil (or magnet) as a magnetic dipole moment. There exists only about 2% of error when the distance between measurement point and the dipole is 5 times greater than the largest dimension of the coil (or magnet). Furthermore, the error will approach 0% as the distance goes to infinity.

B is the magnetic field, in Tesla, at any point in space that is not at the origin. It is equal to the sum of two field components.

Bx is the magnetic field component which is aligned with the X axis.

Br is the magnetic field component which is in a radial direction.

X is the distance, on X axis, from the dipole to the field measurement point, in meters.

L is the distance from the dipole to the field measurement point, in meters.

is the angle between the dipole axis and position vector of the measurement point.

M is the strength of the magnetic dipole moment, in ampere meters squared (Am2)

These formulae both on axis and off axis have been presented for the goal of giving you a way to get the small model by calculation when an experimental method is not applicable. In this thesis, we cannot use this formula directly due to its limitations. The above formulae only tell us how to calculate the field on magnetic axis and at the measurement point which a little bit far from the coil (or magnet). Due to the magnetic coil's current limitation, the permanent magnet will have to be put close the coil. Furthermore, the magnet we are going to use in the experiment is a little bit large; the magnetic field imposing on the magnet can neither be taken as a magnetic axis nor a point far from the coil. Therefore, the off-axis field cannot be accurately obtained by using those formulae. An experimental formula will be more precise to describe the relationship between the parameters, such as current and displacement.


The motivation of doing this project and levitation is to simulate the operation of a maglev train in the vertical direction. The mechanical design of our system involves the structural design of an open box used to hold up the magnetic coil and the Hall Effect sensor. To determine the extent of the box is really a tedious task, because it depends on the specifications of the solenoid and the sensor and other components to be selected.

For this project many criteria were necessary to be considered; the levitation can be achieved using various types of components and circuitry. As it was mentioned before for this project and to accomplish the goal the attraction and the repulsion technique was considered to be the beneficial way. It was selected due to its dependence to electronics and control system.

Now the first thing that was considered was the electromagnet's core and the size of the wire which is used for winding. Since the materials listed in the table above were not at hand and easy to find, an iron steel bar was used as a core because of its magnetization field potential. The length of the core selected was 7.5cm with diameter of 2.5cm.

For the winding the wire size was necessary to be well thought out, as there are different standards and categories for wires, such as AWG (American wire gauge), SWG (Standard wire gauge) and BWG (Birmingham Wire Gage). The SWG category is the available type of wire in the market; therefore the size of the wire chosen for this project was based on the SWG standard. Based on the requirement of this project, the final design has to be a prototype and it does not require levitating a heavy object, the wire No.22 was selected, based on its current carrying capacity, cost and availability.

The permeability of the core which was selected was not known and available to us, so to be in the safe side an electromagnet with wire No.22 around the iron steel core with 3000 turn was made. Due to the lack of data (permeability) the magnetic field of the electromagnet could not be calculated so it was tested using the Tesla meter available in the laboratory.

The Tesla meter indicated that the magnetic field of the electromagnet was 88mT, when current of 0.5Amp is passing through the winding. Based on the formula the permeability of a closed magnetic circuit (no air gap) such as the electromagnet created for this project can be calculated using:

Here is the table of the SWG category.



Diameters in Inches.

Area in Square Inches.

Current in Amperes.

Based on the magnetic field of the electromagnet we knew that the object which is supposed to be levitated have a little mass and it can't be heavy.

Once the electromagnet was prepared, the circuitry and the design of the system based on our knowledge of levitation and magnetism had to be done. We knew that the levitation occurs because of attraction and repulsion of the permanent magnet and the electromagnet, this phenomenon happens so fast and with very high speed that creates the illusion of levitation in human eyes.

So a system had to be designed which could create an attraction and repulsion force based on the position of the permanent magnet in the space. The first issue was to find a sensor that could detect the position of the permanent magnet (object) from the surface of the electromagnet. There were several ideas that could be used such as: photo detector, infrared, Hall Effect sensor and etc. but the one which was selected was the Hall Effect sensor.

The reason of selecting Hall Effect sensor as our position sensor in this project is not very complex. At first a comparison was made between the options in hand; firstly the infrared and the photo detector would make our design more complicated compare to the Hall Effect sensor; the reasons for this decision was since these sensors use the beam of light as the switch to trigger the application, they should be positioned exactly opposite one another so the placement would be harder compare to the Hall Effect sensor which could be mounted at the center of the electromagnet and secondly the purpose of the Hall Effect sensor is to measure the magnetic field around of it and generate output in relation to the position of the permanent magnet and itself, so this component was made for this exact purpose and it would be illogical to use another components.

Selecting a Hall Effect sensor for this project was not a difficult task since the electromagnet prepared has low field and can't lift heavy objects, a low output range and sensitivity sensor with a high output range and sensitivity sensor wouldn't make much difference to the outcome; of course the tolerance was taken to the account because even thou the range and sensitivity is not as important but the accuracy matters for this project.

A Hall Effect sensor is a transducer which changes its output voltage in response to a magnetic field. Hall Effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications. In its simplest form, the sensor operates as an analogue transducer, directly returning a voltage. With a known magnetic field, its distance from the Hall Effect sensor plate can be determined. Electricity carried through a conductor will produce a magnetic field that varies with current, and a Hall Effect sensor can be used to measure the current without interrupting the circuit. Typically, the sensor is integrated with a wound core or permanent magnet that surrounds the conductor to be measured. Frequently, a Hall Effect sensor is combined with circuitry that allows the device to act in a digital (on/off) mode, and may be called a switch in this configuration.

'SS495A1' was selected as the Hall Effect Sensor because of its ability to accurately detect the magnet and its sensitivity could be adjusted simply by using a potentiometer in parallel with it. The input voltage range of this Hall Effect Sensor is '4.5V-10.5V' and since we are using a '24V' regulated adaptor as our supply due to its use to supply the electromagnet power; a '5V' regulator 'LM7805' was required so the voltage could be regulated to a lower value to supply the sensor.

To do this task two electrolyte capacitors are used one at the input pin and the ground and the other at the output pin and the ground, with their positive leg toward the input pin and the supply and the negative leg (shorter leg) to the ground. These two capacitors are used to smoothen the input voltage to the regulator; in theory the first one at the input pin is used to filter the output of the rectifier, and based on the output of the adaptor tested by the oscilloscope we could never be sure to the supply, besides using battery seemed insufficient due to the current draw in the system (due to the electromagnet), we use the first capacitor; the second capacitor is used for the stabilization of the IC, by preventing it from oscillating and responding to quick changes in the load faster than it can; '470μF' electrolyte capacitor was selected for this task. The values of capacitors can vary in between '100μF to 1000μF'; the '470μF' was selected because of its availability in the market. Here is the regulator configuration design.

The 'LM7805" regulator regulates the 24V to 5V; the reason of choosing 5V was because conventionally most chips and ICs require 5V as their supply and since the rest of the design was not done and we might have needed other chips the 5V was used. Now we had to test the sensitivity and the accuracy of the sensor and check the output signal to see if it is the same as explained in the datasheet.

The 5V was supplied to the sensor and the output was tested. The output varies between '0V to 2.5V' and '2.5V to 5V' based on the polarity and the direction (each side) of the sensor, for example if the permanent magnet gets near to one side of the sensor the output would increase and once the other side of the sensor gets near the same pole of the same permanent magnet the output would drop retiometricly (as it is stated in the datasheet; retiometric describing any system in which an output is directly proportional to an input).

To use this data as our system input data we need to convert this information to a PWM (pulse width modulation) signal. A PWM is a commonly used technique for controlling power in electrical devices but in this circuit we are using it to get information about the position, direction and the distance of the object from the sensor, to do this 'MIC502' was used. Based on the datasheet 'MIC502' produces a low-frequency pulse width modulate output for driving an external motor drive transistor; which in our situation would switch the direction and control the power of our electromagnet.

There were many easier and cheaper ways to convert the output of the sensor to a PWM signal but the reason to choose 'MIC502' was because of simplicity and accuracy. The other way to create the PWM signal could be to use the comparator configuration of an operational amplifier (Op-Amp); the Op-Amp configuration was tested at first to see if it could be more useful and accurate than the 'MIC502' and at the end the 'MIC502' was chosen. After all the purpose of creating this chip was the same reason as we need it for so not using it seemed illogical.

The 'MIC502' IC has eight pins; pin number one is called 'VT1' which is short for thermistor number one, the reason that they use thermistor in its name is, due to its use in computers fan speed control and the typical sensor (thermistor) they use to trigger the PWM. For the chip to create PWM the 'VT1' input range should be in-between 30% to 70% of the VDD so the output duty cycle could be controlled by adjusting the gain of the input signal to 'VT1'.

The pin number two is called 'CF' and it is to create the PWM timing (frequency), the suggested values in the datasheet is 0.1μF to create a PWM signal with 30Hz frequency; after testing the device and working on the component and testing different capacitors to create faster or slower rate of frequency the connection was found. The connection between the value of the capacitor and the frequency of the PWM signal generated can be explained using this formula (); C is the value of the capacitor in μF (Micro Farad) and F is the frequency value in Hz (Hertz).

Pin number three is the 'VSLP' which controls the sleep mode of this chip, the voltage which is applied to this pin functions as a reference voltage which is always being compared to the input voltages of 'VT1' and 'VT2', once the two input values of 'VT1' and 'VT2' both drop below this reference voltage the chip will go to the sleep mode and till one of this two input voltages rises above this reference voltage the chip starts functioning again and so they say wakes up.

The pin number four is the ground of this chip which does not need explanation, pin number five is another input pin which is called 'VT2', the function of this pin is basically the same as 'VT1' with a little bit of difference and the difference is; the chip will always checks the 'VT1' input first to generate and control the output signal's duty cycle and unless the 'VT1' input voltage does not drop below the 'VT2' value the chip will never consider the value of 'VT2' to control the duty cycle of the signal. So we won't need this pin unless we had two input signal.

The pin number six of the 'MIC502' is the called 'OTF' that is shortened of 'Over Temperature Fault' which is an active low output pin and once the 'VT1' becomes greater that VOT (VOT is between 74% to 80% of VDD) will give us high. This pin basically has no use for this project because the output voltage of the sensor varies from 0V to 5V and the VDD is 5V so the range of the VT1would not be that high regularly, unless we use it as an indicator that once the object has achieved levitation would notify the user.

The pin number seven in this chip is the output pin, the pin that gives us the PWM output needed to control the electromagnet by switching and changing the polarity of the magnetic force. Pin number eight is the VDD and as the datasheet has mentioned it is between 4.5V to 13.2V so we use the 5V as I have explained before, conventionally most chips and ICs require 5V as their supply, connect to this pin. Here is the output signal of the 'MIC502' based on the datasheet.

As you can see the duty cycle of the output signal varies based on the position of the VT1 and VT2, reference voltages of 0.3VDD to 0.7VDD are the minimum and the maximum values for the VT1 and VT2 to reach, the duty cycle increases and decreases proportional to the values of VT1 and VT2, once the value of VT1 is lower than VT2 the chip controls the duty cycle using VT2.

Up to here we have the sensor and the PWM output based on the position and distance of the object which is being levitated, so the next task was to find a method to switch the current direction of the electromagnet based on the input data of the PWM signal. After doing some research and studying different methods of transistors configurations and the chips available to do this task 'LMD18201' was selected; 'LMD18201' is a H-Bridge designed to switch between the current and the voltage direction toward the load, mostly is used in robotics and mechatronics projects.

Other ways to use the PWM output to create levitation were tested and the results were satisfactory but the 'LMD18201' was selected because of its stability and speed in high voltage and current supply to the load. For example one way to use the PWM signal to control the levitating object is only to use a permanent magnet and an electromagnet with a ferromagnetic core and use the PWM to switch the voltage supplied to the load; hence basically by turning the electromagnet ON and OFF you repel and attract the object so fast enough to create an stable levitation but using 'LMD18201' seemed more logical as due to its stability in high voltages and currents.

The other reason to choose 'LMD18201' (this is basically the H-Bridge application) is the fast switching speed based on the PWM input from 'MIC502' in high voltages and currents. There are many H-Bridges are available in the market but this product generates a stable output in high voltages and currents. Due to its switching speed the levitation can be achieved easier and its stability creates levitation with no oscillation, so basically by adjusting the PWM frequency we could manipulate the stability of the levitated object.

The pin configuration and the shape of this chip is quite different from the other chips available in the market and it is due to its power, the supply voltage as it has been mentioned in the datasheet can vary from 12V to 55V and the maximum current drawn to it and its output could reach to 3A so it would be good for this project due to the high current necessity in the load (electromagnet). It consists of eleven pins which each role will be explained and a heat sink, the chip will get hot due to the current drawn in the system therefore the heat sink is placed (this chip can heat up till and still function).

Pin number one of this chip is called bootstrap, the function of this chip is basically explained in its name; the bootstrapping in electronics explains a method where the output of the system is applied to the input like a positive feedback system, so the impedance of the input for the system could be increased. There are two pins in this chip which are used for this purpose one is pin number one and the other pin number eleven. These pins are constructed and placed next to the output pins of this chip and the recommended value of the capacitors in datasheet is 10nF; to use this pins capacitors is supposed to connect the output pins to these pins.

Pin number two in this chip is the output pin like the pin number ten, this pins output will vary depending on the direction pin (pin number three) and the PWM pin (pin number five). The resultant output of the chip based on the input signal would be the voltage and current flow (depending on the load) in two different directions hence switching between the polarities of the electromagnet and creating a better illusion of levitation.

The pin number three is the direction pin and as mentioned before this pin is one of the pin to control the output signal of the H-Bridge. This pin's function is quite simple; it switches between the directions of current flow in between the pin number two and ten which are the output pins in this chip. It basically works as a logic bit in this chip, when the input of this pin is high the direction of the current flow is from pin two to pin ten and once the input of this pin indicates low the current flows from pin ten to pin two. Using this pin we could switch the polarity of electromagnet hence creating a levitation system with attraction and repulsion technique.

Pin number four of this chip is called break and is used as logic input to break a motor. The 'LMD18201' is a motor control H-Bridge therefor it is designed for this purpose and the break pin is the pin used mostly to control the motor function. If the motor requires a break at one point this pins input should become one and the system automatically breaks, in other words it turns off the output pins hence putting a stop to the motor.

The next pin, pin number five is called the PWM pin and the name basically explains the purpose of the pin, using this pin we can control the amount of voltage and current that we want to pass through the output pins. This technique has been one of the very useful techniques in transistor and circuit design development and industry, using this technique we can control the speed of transistors switching hence varying the amount of voltage and current which pass through them. The resultant output would be a different amount of voltage proportional to the duty cycle of the PWM signal. This pin would be always high for this project since we want the output current to be at maximum all the time.

Pin number six is the VS or Voltage Source which the supply will be connected to. One of the main reason to select 'LMD18201' is its high VS value, as it has been mentioned in the datasheet the supply voltage for this chip can go up to 55V and the current can go up to 3A. As it has been mentioned before in the theory; the magnetic field produced in an electromagnet has a direct relation to the amount of current flowing in the winding; so the high current flow in the chip will be useful for this design. Due to the resistivity of the wire used in winding the electromagnet the maximum voltage which could be supplied to this pin was 18V hence the current flow in the load would be 0.5A. This task was done using a 'LM7818' and two 470μF capacitor based on the explanations done before.

Pins number seven and eight are the ground pins, one is used for the grounding of the system and the VS supply, likewise the other one is used for the PWM signal grounding. This chip used the CMOS technology to switch the direction and to control the output pin voltage and current values; so the grounding is an important matter for control and safety measures of this project. These two pins will always be zero (grounded) in the design including the pin number four which is used for the break in this chip.

Pin number nine is called the thermal flag output, the thermal pins at explained before can be used as a warning pins in the system. This pin output signal becomes active low once the temperature rises to but the system will shut down at , based on the output signal of this pin a warning circuit could be designed for this system. The other two pins, pins ten and eleven which are output and bootstrap pins had been explained previously. Here is the output signal of 'LMD18201' based on the datasheet.

As you can see the direction of the output pin reverses once the logic input of pin number three switches from one to zero, the PWM signal as mentioned before are used to control the output voltage and current flow; and as it is shown in the figure and reversing the direction the voltage in the output equals to the negative value of the source voltage, which in this project is 18V.

So based on the tests that were done to understand the function of each pin the 'LMD18201' was selected for the final design dues to its capability to fund a stable output in high voltage and current flow in the load. The concept can be explained simply, once the input signal for the direction pins turn high the current flows from output1 to output2 and the PWM pin controls the amount of the voltage flow (in this project it stays always high so the maximum amount could pass); and once the input signal indicates low the current flows from output2 to output1, hence creating the different polarity in the electromagnet and forming the illusion of levitation. The bootstrap pins would not be used for this project like the the thermal flag out and break pins. Here is the photo of each component.

3.1-Schematic, PCB design

After selecting the right components and testing each the system had to be tested, for this task a schematic of the design explained in the previous section had to be done. Every connection had to be made specifically based on what has been explained before. The software which was used to run the simulation related for this project is called the Multisim one of the many products of National Instruments Company. The schematic was designed and the simulations were done based on the components availability in the software and the software ability. For example one of the main objectives of this project is designing an accurate feedback system to achieve a stable levitation, and there is no software available to simulate the output of a Hall Effect Sensor so other methods had to be tested to create the simulation.

The simulations were not as desirable as it was supposed to be due to the physical criteria of this project, so the design was done on a test circuit to check the output results. Once the connections were made at each point, it had to be tested to reconfirm the health of the components and check the output compatibility to the design. The PWM signal was tested and the result was satisfactory, once the permanent magnet got closer to the sensor the dusty cycle of the PWM signal created by the 'MIC502' would vary hence controlling the switching direction of the electromagnet.

The one small issue was the low PWM output frequency. The 'MIC502' could create frequency high frequency using an oscillator but the maximum value was 90Hz due to this issue some instability occurs in the system, this instability can be done using a comparator as the PWM generating system, since the amplifiers have simpler configuration the frequency would increase; but the use of 'MIC502' was better due to its better function to control the duty cycle and it's stability.

To fix this issue a compensate network was designed to bring stability in the system, at first a buffer (voltage follower) was designed and the output of the sensor was injected to it so the output of the buffer would always be equal to the input and sudden changes would not make major problems in the system. After the voltage follower the output of the amplifier is injected to the input of an inverting amplifier. The gain in this inverting amplifier is adjusted by a potentiometer so the increase or decrease in it would be proportional in the system.

The formula to calculate the gain in an inverting amplifier is , and since our Rf and Rin increase and decrease proportionally the gain increases or reduces proportionally as well. The output from this inverting amplifier is connected to a parallel resistor and capacitor; the reason to do so has been explained in the literature review. One of the ways to fix the oscillation in this levitation system is to lead or lag the phase of the PWM signal (control signal), due to the time difference in the real time and the current flow in the system.

A RC parallel circuit will create a phase lag in the system that would fix the oscillation concern hence stabilizing the position of levitating object. The angle of the phase lag will be adjusted by changing the value of the capacitor and resistor. The formula to calculate the phase lag angle is , the resultant would produce a stable output that would fix the oscillation issue due to the time lag of the circuit.

The resultant output will be the input of a voltage follower configuration so as explained before the amplifier would function as a buffer and the sudden changes in the input would not cause a major problem in the system. And at the end an inverting amplifier, the resistors and capacitors values which are shown in this configuration might change during the construction process if the change is required for the purpose of stability. Here is the design of the compensate network.

As you can see the input of the compensate network is connected to the output of the Hall Effect Sensor which varies once the magnetic object gets near to it, and after all the process that has been explained above the output would be connected to the input of the 'MIC502' to create the PWM signal needed to control the levitation and the electromagnet's polarity.

To construct this compensate network the 'LM324' has been used due to its four built in operational amplifier so the cost of constructing the system would reduce. Here is the schematic of this project, the Eagle Software was used to design the schematic and PCB because of its wide range of library.

As it is shown in the figure above each part of the design was done based on the explanations which were done in the previous section. Once the schematic was completed the design was done the circuit was tested on the bread board to reconfirm its functionality based on the desired output and the results were satisfactory. A potentiometer was placed in series with the VDD pin in 'MIC502' so the duty cycle of the PWM signal could be adjusted hence the stability of the system could be achieved at ease.

The object was able to levitate with no oscillation and the stability was satisfactory. The electromagnet attracts the object till the point which PWM duty cycle reaches to 50% and the object stays at the point zero. If the object gets closer to the electromagnet the repulsion will occur hence the object can't get nearer or further from the electromagnet.

Once the design was tested and the results were satisfactory it was time to work on the control system of this project and try to achieve vertical movement. The PCB layout of the design mentioned above was done in case if the future attempts are unsatisfactory the current design will be used. Here is the PCB layout of the current design.