Magnetic Levitation

by: Arturo Falck and Albert Schulz

3/18/95

Levitation aparatus.

FIGURE 1

I. INTRODUCTION

This Lab investigates magnetic levitation with a digital controller. The controller will compensate the system shown in Figure 1 to levitate the metal ball beneath the electromagnet. A signal proportional to the ball's vertical position is generated sing an infrared LED and phototransistor. The position signal is then compensated by the controller and fed into a pulse-width-modulator (PWM) chip, which varies the duty cycle of its output depending on the input voltage. The output of the PWM chip is then applied to the terminals of the electromagnet. The strength of the magnet is controlled by the varying duty cycle. See Figure 4 for the block diagram of the system.

II. THEORETICAL ANALYSIS AND RESULTS

1.- We measured the resistance of the electromagnet to be R = 5W.

2.- We used the circuit in Figure 2 to find the value of the inductance. This was done by comparing the frequency response of the circuit to the theoretical response as given by the following transfer function:

FIGURE 2

NOTE: Later in our research we found that this is a poor model for the electromagnet. A better model includes a zero at 90 Hz (565 rad/s) this lead to a different transfer function:

Appendix I includes a plot of the frequency response and the mathematical model (as described by the first transfer function above) for a value of :

L= 0.29 H

3.- We built the analog compensator and the PWM (pulse width modulator) responsible for controlling the magnet as described in our lab manual:

Figure 3 shows the analog compensator we used to stabilize the system.

FIGURE 3

4.- Starting with approximate values of 270kW and 20kW for R1 and R2 respectively, we adjusted the resistors until we achieved a stable system (i.e., levitated the steel ball). The system was stabilized with the following values for the resistors: R1 = 770 kW R2 = 15.72 kW

5.- We found the transfer function of the analog compensator. The lab manual included its own block diagram of the system, so we manipulated our results to fit same form as in the manual.

NOTE: Appendix II includes the derivation of the transfer functions of our analog compensator. Appendix III shows the root locus of the uncompensated system. Appendix IV shows the root locus of the compensated system.

FIGURE 4

NOTE: The zero in the transfer function of the magnet was added to the model later in the lab for reasons explained in part 6 of this report.

The values of the different variables shown above are:

m = 0.00558 kg K = 5.1 kW / R2 = 0.3244 w1 = 1634 w3 = 2p . 90 = 565

Unknowns:

fi . Ks , fx

6.- In order to design a digital compensator, we had to model the plant (find the unknowns above). To do this we produced a frequency response graph and fitted a curve to it.

NOTE: Appendix V shows the frequency response of the whole system and the theoretical response of the transfer function.

To produce the theoretical frequency response we used Matlab to manipulate the different components of the transfer function on a point-by-point basis. We wrote a short program that allowed us to produce a Bode plot of the dynamics of the plant (assuming that the model for the compensator, the magnet and the gain were all correct).

This was based on the following manipulations:

therefore:

where T is a point-by-point representation of the actual data in the frequency domain.

Then we used another short program to express fi . Ks in terms of fx which allowed us to vary one of the parameters until we could fit the curves (Bode magnitude and phase plots).

This relationship between fi . Ks and fx was given by analyzing the dc-gain case (where all s go to zero).

It proved impossible to fit a curve given the assumption that our transfer function for the magnet was correct so we assumed that the resistance of the coil (electromagnet) decreased when the coil heated up. We also added a zero to the transfer function that models the magnet. (Modifications to our model were suggested by the lab instructor, Greg Zvonar)

fi . Ks = 700 fx = -294 The new model for the magnet produced: R = 0.36 W

7.- The analog circuit was replaced by a digital compensator using two different techniques:

7.1.- The first technique was to find the digital equivalent of the analog compensator. This was done with program CC using the forward rectangular transform at 1000 Hz. (Other transformation schemes were examined but they didn't lead to a stable syste , given by the appropriate root locus).

NOTE: The plant was translated to the z domain by using the zero order hold transformation.

where K = 4.5 This system produced the Root Locus and time response to a unit step input shown in Appendix VI.

R2 = 5.1k / K = 1.133k W

NOTE: In order to realize this system, one of the OP-Amps was replaced be the digital computer. In addition, the feedback capacitor across the second Op-Amp was removed.

7.2.- The second technique to produce the digital compensator was to design it using Root Locus manipulations. This was done by plotting the Root Locus of the uncompensated system (shown in Appendix VII) which is the zero order hold equivalent of the pl nt sampled at 500 Hz:

Because the computer used in lab is unable to produce a compensator with a feed-through term, our compensator had to have one more pole than zeros. To simplify our design process, we added the extra pole on the plant (see Appendix VIII for plant with ze o).

Our firs attempt to compensate the system was to cancel one of the poles, then add a zero close to the unit circle and two poles close to the origin:

The gain was chosen so that the closed loop poles lay as far inside the unit circle as possible. This minimizes the oscillatory nature of the time response.

Appendix IX shows the root locus of the compensated system and Appendix X shows the time response of the same system.

Our second attempt to compensate the system was to move the two poles from the previous attempt away from the real-z axis so that the root locus spends more time inside the unit circle. This allows for the two closed loop poles that lie to the right of he unit circle at lower gains to enter the circle. This should also reduce the overshoot.

Appendix XI shows the root locus of the compensated system and Appendix XII shows the time response of the same system. Appendix XIII shows the stabilized system.

K = 3.4

NOTE: In order to realize this system, the first OP-Amps was replaced be the computer.

III. CONCLUSIONS AND RESULTS

It is possible to design a digital controller to replace an analog one by simply finding the digital equivalent of the system and the controller. However, by using root locus design techniques directly on the digital system, it is possible to produce a etter controller.

The sample time can be reduced and the stability improved using the second design technique mentioned above.

Our second design of the digital compensator produced the desired results, in that the system was stable with a sample rate of 500 Hz and produced a time response with no overshoot (see Appendix XII) and a reasonable settling time (about 25 samples or 50 ms).

It is important to mention that digital controllers in general are easier to modify than analog controllers, making them a better tool in controlling complex, or changing systems.

The stability of our system with a digital compensator was much greater than that of the system with an analog compensator.

In retrospect, it seems that it might have been easier to include the feed forward pole (analog) in the digital compensator. This would have put the whole compensator in the feed back loop and removed the need for the extra pole.

It would have also been beneficial to have a sturdier stand for the magnet, since during the six weeks that the lab lasted, our plant changed because of movements of the setup.



Arturo Falck 
Send Comments to: arturo@falcks.com Last updated: April 23, 1995