The following section will detail the sensor and PD controller of my Magnetic Levitator Project
The sensor designed for this magnetic levitation system is an inductive proximity sensor that operates using a custom coil arrangement and sophisticated analog signal processing to precisely detect the position of a levitated ferromagnetic object. The sensor consists of two air-core coils wound on a 3D print: a primary coil (L1) and a secondary coil (L2). The primary coil is excited by a signal generator, producing an alternating magnetic field at approximately 75 kHz. My initial design was to build a robust oscillator, so no signal generator was needed for L1; however, I later modified my design as time constraints forced me to use the signal generator. The secondary coils pick up induced voltages from this field. When the object approaches L2, the magnetic coupling increases, leading to a significant rise in the induced voltage at L2. A photo of the sensor with my custom coil arrangements is shown on the right.
Signal Conditioning
To process the sensor’s output, the system employs a demodulation stage based on the Analog Devices AD630 balanced modulator/demodulator and Lock-In-Amplifier integrated circuit shown below. The voltage from L2, which contains both the position-dependent signal (at the carrier frequency) and any environmental noise, is fed into the AD630. The AD630 is configured for synchronous demodulation. In other words, it multiplies the incoming signal by a reference derived from the oscillator’s phase, effectively shifting the position-dependent information down to DC while moving noise and carrier components to higher frequencies. This process is mathematically equivalent to multiplying the sensor signal by a synchronized carrier, resulting in a demodulated output that contains a DC component proportional to the amplitude of the original signal (and thus the object’s position), as well as higher-frequency terms that can be easily filtered out.
Output Results
The following video on the right shows the oscilloscope readings from the output of the sensor. The output signal in the input to the PD controller
PD Controller
Based on the known instability of the magnetic levitation process and the transfer function behavior established, I pursued the design of an analog Proportional-Derivative (PD) controller. The goal was to introduce sufficient proportional gain to stabilize the open-loop system and derivative action to improve the damping ratio and dynamic response. Given the time-sensitive nature of the control task and the desire to minimize latency, an analog solution was chosen over a digital implementation. The controller was constructed using TL074 quad op-amps powered by ±12V supply rails, allowing full analog processing of the sensor signal without the need for discrete sampling. The overall circuit architecture consisted of three distinct stages: a sensor gain inverter, an error amplifier, and the PD controller stage itself. The first stage, the sensor gain inverter, utilized a standard inverting amplifier configuration to adjust the raw sensor signal both in amplitude and polarity. This inversion was necessary to ensure that increases in object distance would correspond to appropriate corrective action by the controller, given the magnetic levitator’s physical response. The second stage, the error amplifier, subtracted a manually adjustable setpoint voltage from the processed sensor signal, producing an error signal that indicated how far the levitated object deviated from the desired position. The third stage implemented the PD control action, where the proportional gain was set by the feedback resistor Rf and the input resistor Rp, and the derivative action was introduced through a capacitor Cd connected at the inverting input.