BU



Barry's Magnetic Levitation

These coilguns with control circuits are great! Now... How can you use them for magnetic levitation?

This is slightly off-topic from coilguns, but magnetic levitation has many common design principles and is a little easier to build!

How Levitation Works

If you hold two permanent magnets close together, you see that one of them will jump strongly toward (or away) from the other. In 1842, Samuel Earnshaw expressed the perversity of inanimate magnetic objects in his theorem. It explains this frustrating behavior will always prevent you from suspending one permanent magnet above or below another, no matter how one arranges the two magnets. However, an active control circuit can get around this problem by rapidly adjusting the magnet's strength.

The general principle is straight forward: An electromagnet pulls a ball upward while a light beam measures the exact position of the ball's top edge. The magnet's lifting force is adjusted according to position.

As less light is detected, the circuit reduces the electromagnet's current. With less current, the lifting effect is weaker and the ball can move downward until the light beam is less blocked. Voila! The ball stays centered on the detector! It is a small distance across the photodetector, perhaps a millimeter or two, but this is sufficient to measure small changes in position. Of course, if the ball is removed the coil runs at full power. And conversely, if the light beam is blocked the coil is turned completely off.

This device uses two photodetectors: the "signal" detector looks for an interruption in the light beam, and the "reference" detector measures the background light. The circuit subtracts one signal from the other to determine the ball's position. The use of two detectors is my small contribution to advance the art of levitation. This design automatically compensates for changes in ambient light, and eliminates a manually adjusted potentiometer.

Barry's Maglev Demonstrator

Here's why I built one:

• A nice entry for a science fair.

• There are other fun levitation systems

• There are some great wacko sales pitches for it!

How does it work?

• Schematic diagram

• Parts list

• Buying the Parts

• Close-up photographs

So how was it all designed?

• Circuit design for Infrared Emitter circuit

• Circuit design for Photodetector circuit

• Circuit design for Reference voltage circuit

• Circuit design for Difference amplifier circuit

• Concepts of Feedback loop control systems

• Concepts of Feedback loop equations

• Concepts of Bode plots to represent transfer functions

• Concepts of Phase lead network circuit

• Circuit design for Output amplifier circuit

• Circuit design for Coil driver circuit

• Circuit design for PWM coil driver circuit

• Coil design of the Lifting coil

• Levitator Simulation using PSPICE

How do you get it working?

• How long does it take to build?

• Constructing the wooden base

• Connecting the power supplies

• Using a printed circuit board

• Setup and Adjustment overview

• Testing the power supplies

• Testing the infrared LED emitter

• Testing the signal detector

• Testing the reference detector

• Adjusting the sensing resistor for the reference detector

• Testing the difference amplifier

• Testing the non-inverting amplifier

• Testing the output transistor

• Adjust, connect and test the lifting coil

• Results and Further Work

Other Fun Levitation Systems

There are many ways to levitate objects. Here are some fun methods that I've seen.

|The simplest! |Guy Marsden's Levitation Kit is built on a single fan controller chip! |

|The best! |The Visual Levitation kit (read my review) |

|Completely free! |Float your own Magnet over a hard drive (free!) |

|Fun toy! |The Levitron antigravity spinning top |

|Levitation and culture! |How levitation and meditation are tied together |

|Fun for life! |Meditation can cause levitation |

|Cheap and cheesy |Go to Edmund Scientific and search for "levitator" |

Comments? Send me your suggestions and circuit improvements! Send your levitator e-mail to Barry Hansen and put "levitator" in the subject line. Please note: I am not interested in antigravity theories, overunity devices, gravitic shielding or other types of fringe science. Thank you in advance for not asking.

Why Build a Magnetic Levitation Device?

Wacko Sales Pitch

Want to amaze and impress your friends?

Can something be held in mid-air with nothing touching it?

Do flying saucers use electrogravitics?

How does a maglev vehicle work?

Need a super accurate force/weight measurement?

Want to measure small changes in gravity?

Who says gravity cannot be beaten?

Want to see a simple coil levitate a steel ball in a magnetic field?

As long as you're building a coilgun, and have: magnet wire, power supply, breadboard, voltmeter, resistors and capacitors, switches, hookup wire, and other miscellaneous parts, why not?!

Maglev for Science Fair

I started this project with my 2nd grade son for a science project. The science fair was on March 16th, 1999, at an elementary school in Washington state. This was a fair, not a competition, where the emphasis is on having fun. Most sane parents would not design a closed-loop feedback control system with a second-grader, but as it turned out we didn't enter the project in the fair after all. It didn't work quite well enough, and the coil would overheat after a few minutes.

The benefits of doing this project were many, but not where I expected. I somehow expected to relate some ideas about electronic design. In reality the benefits were probably of more lasting effect. I worked together with my 7-year old and we had a great time. This was a chance for him to cut boards with a saw, drill holes, handle a screwdriver, measure and mark with a square, cut wires, and plug in chips and resistors. We handled parts, learned their names and looked at their symbols in schematics.

Some other things we accomplished were:

- To play with a cool gadget that we made ourselves.

- To experiment with magnetism, and see and feel how it works.

- To be challenged by designing a closed-loop control system.

- To use what I learned from my first coilgun, and learn more that might help with my next one.

- To refresh my knowledge of op-amps and analog circuits.

- To use up part of a mile of 24ga magnet wire.

- To buy new tools, in this case a dual-tracking 30v 5a lab bench power supply bought cheap at an auction.

- To learn how IR emitters and phototransistors work.

- To help fill my garage with electromagnet toys.

Okay, enough yackity marketing material, let's get on with the technical details you really want.

Maglev Over Hard Drive

What should you do with the rest of a hard drive after you've swiped the magnet? Here is a cool idea from Mike's Electric Stuff!

Construction

The concept is that a permanent magnet is repelled by a rapidly spinning disc of conductive metal. The procedure is to open an old hard drive cover, exposing the platters inside but leaving the controller card connected.

Take a scrap 5.25-inch hard disk, but one which still spins when you power it up (This may work with 3.5-inch drives, but the magnet tends to be attracted towards the motor shaft, so 5.25-inch drives allow the magnet to be further away).

Plug it into a PC power supply -- no computer or anything else! Just the power supply and the hard drive. The drive will spin, at least for a few minutes.

You may find that it spins down after a few seconds as it can't read any data from the disk (well you'd have trouble reading too if someone had ripped your head off!).

Optional, but something to improve flying height: Remove the platters and spacers from the motor shaft, and re-assemble them so that all the platters are at the top of the shaft, with all the spacers at the bottom, giving a nice thick stack of aluminium.

Tape a neodyminum magnet to the end of a strip of plastic or paper. The reson for using a strip, rather than, say, a string, is that the magnet tends to pull towards the centre and also tumble over - the strip constrains the magnet's movement to upwards only. Fix the strip to one of the side holes of the drive chassis, so the magnet rests on the disc surface, near the outer edge, as shown below.

Operation

When the drive is powered up, the magnet levitates to about half an inch above the disc surface. Pressing the magnet down slows the disc rotation substantially. It might even cause your controller to detect a speed fault and stop the drive.

The principle is that the magnet induces eddy currents in the platter. Most driver platters are polished aluminum. Some new drives use ceramic platter, and they don't repel magnets much at all, since they are not conductive. The eddy currents carry their own magnetic field, which is in opposition to the permanent magnet. These two fields repel each other, hence the levitation effect.

It is really fun to see - you've got to build one!

Magnetic Levitation Schematic

[pic]

Note: Click on a component to visit its circuit description.

'TP' indicates a test point, a convenient spot to connect your voltmeter.

Magnetic Levitation Parts List

A detailed list of electronic components is shown below. For parts availability and places to buy them, you can read about buying the parts.

Resistors

Resistors listed in order by value are 1/4-watt, 5% unless otherwise indicated.

|300 ohms |R11 |

|500 ohms |R2 |

|1,000 ohms |R1, R12, R13, R14  |

|1,500 ohms |R10 |

|10,000 ohms |R4 |

|11,000 ohms |R6 |

|22,000 ohms |R8 |

|56,000 ohms |R3 |

|100,000 ohms |R5 |

|150,000 ohms |R7 |

|370,000 ohms |R9 |

|50K linear taper |VR1 (and VR2 opt.) |

Capacitors

|C1,C2  |47 uF electrolytic |

|C3 |0.1 uF ceramic or tantalum (must not be electrolytic) |

Semiconductors

|Q1,Q2 |OP505A infrared photo detector, or equivalent |

|Q3 |2N3055 NPN power transistor |

|LED1,2,4  |Red light-emitting diode |

|LED 3 |Infrared LED emitter |

|IC1-4 |LM741 op amp, Radio Shack 276-007 |

|D1 |1N4001 (or 1N4004) silicon diode, 50v (or more) peak inverse voltage |

Miscellaneous

+/- 15 vdc power supply, 1 amp

9 vdc power supply, 1 amp

Breadboard wiring pad (or printed circuit board by Amadeus)

18-ga stranded wire for power

Solid hook-up wire

24-ga (or thicker) magnet wire for lifting coil

6-terminal barrier strip (2 ea.)

Wood for base and frame

Alternatives for the LM741 Op-Amp

I chose the LM741 op-amp out of nostalgia and convenience. It was an extremely successful and common op-amp about twenty years ago.

There are lots of modern choices for dual- and quad-package op-amps. By using a package with multiple op-amps, you can reduce the number of parts and lower the cost. For example, you could use a single quad-package op-amp instead of four separate 741s. This would allow a very small printed circuit board to contain all the electronics!

Different packages also provide improved parameters such as noise immunity, speed, power, etc. Here are several good choices recommended by David at . All these are better in every parameter than the trustworthy but ancient LM741.

These parts are commonly available on-line suppliers such as Digikey or Future-Active.

|  |National Semiconductor |Maxim Integrated Circuits |Analog Devices |

|Duals |LF353, LF412 |MAX412 |OP270, OP271, OP249 |

|Quads |LF347 |MAX414 |OP470, OP471 |

|Instrumentation amp |  |  |AD620, AMP02 |

Buying the Levitator Parts

How much does it cost? Where do you buy the parts? Is there a printed circuit board?

Total Cost

First the disclaimer: Your mileage will vary! The individual parts aren't very expensive, but if you also have to buy tools (voltmeter, bench power supply, soldering iron, wire stripper, needle-nose pliers, etc) then it quickly adds up to a lot more than I show here. If you have a good parts bin, your price could be a lot less. Substitutions are common (e.g. a different potentiometer, or a fixed resistor instead of a pot), so I encourage you to make your own shopping list starting from this one.

The price is probably under $100, depending on what parts you've got in your scrap box. If you know exactly what you want then buying the few parts you need is as little as $20 total. There are many choices and tradeoffs; it is a little like sewing project where the quality of material and a good-looking visual presentation can run up the prices.

It's a good idea to buy spares. Especially the op-amps, because if they fail then they're certain to die late at night when the stores are closed. :-) It's real hard to get that blue smoke back into the chip; you'll have to buy new parts that contain fresh smoke.

Price List

I don't know if this is a good idea to list prices, but let's see how it works... Although I dislike the prices at Radio Shock, here is the closest part number and price for the parts in my levitator. (Note: This list is current as of December 1999, but will not be kept up to date!) This is merely intended to give you a feeling for the overall cost, and to clearly identify the parts.

|Price |Part No. |Description |

|US$  |Resistors |(total = $7.30) 1/4-watt, 5% tolerance carbon-film |

|0.49 |RSU 11344744 |300-ohm resistor, pkg of 5 |

|0.49 |RSU 11344793 |510-ohm resistor, pkg of 5 (need at least 2) |

|0.49 |271-1321 |1,000-ohm resistor, pkg of 5 |

|0.49 |RSU 11344892 |1,500-ohm resistor, pkg of 5 |

|0.49 |RSU 11345071 |11,000-ohm resistor, pkg of 5 |

|0.49 |271-1339 |22,000-ohm resistor, pkg of 5 |

|0.49 |RSU 11345204 |56,000-ohm resistor, pkg of 5 |

|0.49 |271-1347 |100,000-ohm resistor, pkg of 5 |

|0.49 |RSU 11345360 |390,000-ohm resistor, pkg of 5 |

|2.89 |271-1716 |50K ohm potentiometer, linear taper |

|  |Capacitors |(total = $2.17) |

|0.79 |272-1053 |0.1 uF, 50 volts, mylar film |

|1.38 |272-1027 |47 uF, 35 volts, electrolytic, 2@ 0.69 |

|  |Semiconductors |(total = $11.91) |

|1.69 |276-0143 |Infrared LED emitter |

|1.98 |276-0145 |Infrared photodetector, 2pkg@ 0.99 |

| | |(A matched set of emitter/detector is also a good choice as part number 276-142) |

|2.29 |276-1622 |Assorted LEDs, pkg of 20 |

|3.16 |276-007 |LM741 op-amp, 4@ .79 |

|1.99 |276-2041 |2N3055 NPN power transistor |

|0.49 |276-1101 |1N4001 diode, 50v peak inverse voltage, pkg of 2 |

|  |Miscellaneous |(total = $94.08) |

|25.98 |273-1773 |110vac to 12vdc adapter, 500mA, for +/- to control electronics |

|13.99 |273-1770 |110vac to 9vdc adapter, 800mA, for coil driver |

| | |Note: It is preferred to use a 15v supply, but this is the closest Radio Shark component and will be satisfactory for most |

| | |people. |

|21.99 |276-169 |Solderless breadboard mounted on 4x7" base with non-slip rubber feet. 3 binding posts. 640 plug-in tie-points on 0.1" centers.|

|9.99 |22-402 |Dual-scale bench voltmeter, 0-15 or 0-30 vdc |

|4.49 |278-1226 |Stranded hook-up wire, 45 feet of 18ga, three spool set in various colors |

|3.99 |278-1215 |Solid hook-up wire, 100 feet of 22ga for breadboard jumpers |

|7.98 |278-1345 |Magnet wire set, 40' of 22ga, 75' of 26ga, 200' of 30ga (levitator uses about two spools of only 22ga), 2pkg@ 3.99ea |

|1.49 |278-1720 |Nylon wire ties, 5-1/4" in various colors, pkg of 20 |

|2.19 |278-1638 |Spiral wrap, 10 feet, to cover wires to a.c. adapters |

|1.99 |274-659 |Barrier strip, 6 terminal, dual row |

|n/a |n/a |Wood for base and frame, screws, bolts, washers |

|  |Total |$115.46 |

The parts are non-critical and substitutions can save you money, especially for the power supplies.

Where Did I Buy My Parts?

The cheapest place to shop is a surplus electronics store. I used Radar Electric in Seattle, and Vetco Electronics in Bellevue. Of course, Radio Snack will be the quickest/easiest, but also costs the top $. If it doesn't matter to you if the whole project adds up to $50 vs $100, then you can save a huge amount of time at Radon Shack!

If you know how to build a printed circuit board then skip ahead to PCB plans by Amadeus!

On-line Part Suppliers

There are some large and established parts suppliers on-line:

• Digi-Key, , Thief River Falls, Minnesota (1-800-DIGI-KEY)

• Mouser Electronics, , Mansfield, Texas (1-800-346-6873)

• Jameco Electronics, , Belmont, California, (1-800-237-6948)

• Ramsey Electronics, , Victor, New York (1-800-446-2295)

• Surplus Sales of Nebraska, , Omaha, Nebraska (800-244-4567 or 402-346-4750)

• All Electronics Corp., , Van Nuys, California

• Radio Shack, , Everywhere, USA

All these sites are difficult to navigate and hard to find a particular part, but my personal favorite is Digi-Key. Their on-line catalog is in a very nice Acrobat format, and their printed catalog is especially useful with hints and usage notes.

If you have a little experience and know what you want, shopping on-line is excellent. The major drawback of on-line shopping is that the selection is so vast it's hard to decide among all the choices.

Buying a Levitation Kit

Oh yes, you can buy a very nice little kit for $49 US. The kit is from a great article in the February 1996 issue of "Electronics Now". I built their kit and you can read my review. Their contact information is:

   LNS Technologies    

   PO Box 501

   Vacaville, CA 95687

They updated the kit in May 2006 and lowered the price, so I know they are still in business and eager to sell you the LEV-KIT.

Woodworking Plans

What kind of stand can hold up a levitation coil? What dimensions are appropriate?

The "right" size is whatever it takes to hold the parts. The framework is not critical and almost anything will work. You could also use an aluminum channel frame, and some people use an open construction without the shadow box. See this page for more ideas from other people.

If you completely lack any imagination whatsoever, here is something to get you started..

Woodworking Plans

The wooden bottom is cut from 8" x 3/4" pine shelving. Please note the bizarre American dimensional lumber system will actually measure somewhat smaller. The precise measurements show the wooden base is 1/2" thick pine shelving of 7-1/4" width, cut to a length of 16".

The levitation box is cut from 6" x 3/4" pine shelving. (It actually measures 5-1/2" wide and 1/2" thick.) From this cut two sides that are 9" long, and a top that is 6" long.

The back is made of 1/8" fiber board to keep out light. It is probably optional, but it does help brace the box against side loads.

Material List

8" x 3/4" pine shelving - 16 inches long

6" x 3/4" pine shelving - 24 inches long

1.5" wood screws - 8 ea.

1" brads to attach back - 12ea.

Misc. hardware to attach breadboard, heat sink, etc.

Suggested Improvements

My stand is very simple and relatively easy to build. However, it is a bit crude and there are many changes that would improve its appearance.

• The box should be made of 1/2" thick wood, not 3/4" which just looks a bit too much for the puny parts inside it. Also it would be easier to mount the small LEDs and optodetectors in 1/2" thick wood.

• The height of 9" is a bit tall. If it were only 6" high then it would look as good and the ball wouldn't make so much noise when it hits the bottom.

• Most of the base can be eliminated if you mount the breadboard vertically on one side of the box, instead of horizontally on the wide base. This makes it much easier to pack and carry.

• Other People's Projects

• The woodworking page is a simple approach, but many other arrangements work equally well (and most of them look better than mine!).

• Other People's Projects

• Here are some photos I've received from other people that built a levitator. I hope this will give you some creative ideas.

• Send me a picture of your own project! I'll add it here, and I'm willing to link to any site you want. Thanks :-)

|Plexiglass is attractive and professional, and the |Thin plywood is easy to work with. |Enclosed electronics make a clean display. |

|schematic helps you debug and makes a wonderful | | |

|visual aid. (Daniel Adolf) | | |

|[pic] |[pic] |[pic] |

|The box is not needed if you mount the emitter and |A simple metal frame works just fine. |  |

|detector close together. | | |

|[pic] |[pic] | |

Levitator Photographs

What does it look like? How are the parts arranged on the breadboard? Are you actually going to build one of these? You are going to need close-up photos.

Breadboard Layout

The electronics are mounted in a push-down breadboard. These breadboards are available from Radio Shack ($22) and from most other stores that sell electronic components. Prices range from $5 and up, depending on size and whether it has those nice little binding posts.

Each component is labelled in the image at left. (Click on the image for the full size picture.) The stages are laid but left-to-right in the same order as the schematic. This is a top view; the front of levitator is at the bottom of the photo.

The connectors are also shown in the photo. At the top right is a two-terminal strip which is only used to connect the leads to the little voltmeter permanently mounted on the levitator. At the top middle is a six-terminal strip for connections to the coil and opto-detectors and 2N3055 transistor driver. At the bottom left are three binding posts for the +/- 15vdc power connections.

Below are a variety of images to provide slightly different views of the parts layout. Hopefully you can make out anything that might not be clear in the labelled image above.

[pic][pic][pic][pic][pic][pic][pic]

Lifting Coil Area

Some important parts are mounted in the area around the lifting coil. The 2N3055 power output transistor is on the left, mounted in a spiky heat sink. An inexpensive voltmeter is held in place with tie-wraps, just above the power transistor. The infrared emitter is on the right, and the two opto-detectors are on the left of the coil behind the voltmeter.

[pic][pic][pic][pic][pic]

The lifting coil has two wires coming out. You can see a thin magnet wire and a thicker orange wire. The orange wire is nothing special. I had a little ooopsie when I built the coil, because one of the magnet wires broke off when I took the coil from my coil-winding form. So I soldered that big orange stranded hookup wire to it and covered the solder joint with heat-shriek tubing.

Inside the box in the back left you can see the wires to the power transistor. To help tell them apart, I used different colors for each connection. Green is for emitter, Black is for base, and Red is for collector. The red wire (collector) is soldered to a lug under a mounting screw, because the entire case around this transistor is connected to its collector. The green and black wires disappear into holes in the wood, because the transistor's pins are not as long as the wood is thick. Suggestion: Use thinner wood than I did!

Infrared Emitter and Detectors

These photos show the high-tech and expensive mounting brackets for the emitter and two detectors. Through a (not very) complicated design process, I found the size of hole needed to loosely hold the parts in wood. The parts are pressed into place, and the leads soldered to two-conductor wire. This wire is just a handy 24-gauge zip wire, like a lamp cord wire only smaller. Any kind of wire will work, but two-conductor wire makes a neater presentation. The wires are anchored in place with a single-dimensional bonding element (transparent tape).

The reference detector is in the single hole on the left. The signal detector is in the middle of a column of holes on the right. The column of holes makes it possible to adjust the vertical position of the detector, to choose the height that works best. Also, the coil itself can be adjusted up or down by screwing it into or out of its

Designing the Infrared Emitter Circuit

The infrared LED emitter produces a light beam across the bottom of the coil.

We chose IR (infrared) because there's less noise and ambient light than at normal optical wavelengths. Later, I found plenty of ambient light sources that interfered with the light beam, most noticeably indirect sunshine from a nearby window made a big difference to the optodetector. It would probably work fine to use a visible LED instead, such as high-intensity red. It would even work with a flashlight bulb, which also make it much easier to see everytthing working inside the levitator's box.

Mount the whole assembly in a five-sided box type of frame, to eliminate ambient light from most directions. We want the LED to be the brightest light seen by the optodetectors. You will probably see an improvement if you put black paper around the emitter side of the box to reduce reflected light.

Choose a bias resistor for the LED to produce a healthy signal. I used 500 ohms, which yields a 30 mA current through the LED. That is, current is voltage divided by resistance, or approximately 15 volts divided by 500 ohms will yield about 30 mA.

Caution: With these values, the resistor will get hot! To avoid the chance of fire or injury, use a 2-watt or 3-watt resistor. Or, use several 1/4-watt resistors in parallel for an equivalent net resistance.

You want the LED bright enough to be well above "noise" sources. You don't want it too bright, or it will drive the optodetector into "on" saturation. (Though that's not likely to be a problem with a couple inches of separation to the detector.) You also don't want it too bright or it wastes power and produces heat, which may shorten its lifetime. Check the specifications for your own infrared LED and run it fairly hot, but don't overdrive it. Note the photodetectors from Radio Shack are quite sensitive, and you can probably use a 1K-ohm resistor successfully in place of the 500-ohm.

LED Characteristics

Light Emitting Diodes are silicon devices that produce light. The light is produced only when current passes through in the forward direction. To produce light, the forward voltage must be higher than the diode's internal barrier voltage. This point is labelled +Vf ("voltage forward") on the graph.

Like any other diode, LEDs pass current in the forward direction, but block current in the reverse direction. This means the LED will only light up if connected with its cathode on the negative side of the circuit, and its anode on the positive side. Too much reverse voltage will destroy LEDs and diodes.

It is important to note that once the voltage across the LED reaches +Vf, the diode conducts current extremely well. This is shown by the sharp rise in the forward current (+I) indicated by the near vertical line. The LED can be easily destroyed by an excess of current.

To protect the LED, a series current limiting resistor is added, as shown in this figure.

The cathode side is usually marked with a flag spot on the flage that rings the body of the diode. The cathode wire is also shorter than the anode wire. This figure compares an LED with its schematic symbol.

Designing With LED's

You could connect the LED to a 1K resistor, and it always works. However, the higher the voltage, the brighter the LED. How do you calculate the resistor in advance?

An LED has a nearly constant forward voltage. Regardless of the current, the LED will show about the same voltage across its terminals. (Try it with a voltmeter!)

What is "forward voltage"? It is the voltage from anode to cathode when the diode is in conduction.

How much forward voltage does an LED have? It depends on the LED, and typically ranges from 0.6v to 2.0v. Read your LED's specifications. For example, look at a typical LED from Radio Shack such as catalog number 276-143. What?! Their spec sheet does not show forward voltage or has nearly 2v forward voltage.

An LED is a diode. An LED is not a resistor, and the voltage does not divide proportional to resistance.

Designing the Photodetector Circuit

This optodetector measures the position of the ball by the amount of light transmitted by the infrared LED. This is a linear signal across the small area of the detector -- it is not just "on" and "off".

About the Detector Circuit

This circuit uses the optodetector as a light-controlled current source, operating in its linear range. Receiving additional light is the same as increasing its base current. Thus the amount of light falling on the detector will directly control the collector-emitter current. The current is converted to a voltage by the 56K ohm resistor connected from its collector to the positive supply voltage.

The op-amp is wired as a voltage follower to isolate the photodetector circuit from the next stage. Although not strictly necessary, the voltage follower ensures the detector's results are not affected by a VOM or voltmeter, or by the input resistance to the next stage.

Value of Sensor Resistor

The best value (for me) was a 56K resistor. This gives a two-volt signal on top of five volts of ambient noise. You want a large enough resistor so your voltage (that represents position) has a comfortable distance between either rail. Say, halfway between 15v and 0v, or around 7.5 volts.

The tiny current and high-impedance detector means you must use high impedance equipment.

• Do not try to measure the collector voltage with a VOM; its internal resistance is lower than 100K and it will not give accurate readings. Use a VTVM or a decent digital multimeter instead.

• Do not connect the detector to anything but an op-amp's input. It really needs to see a high-impedance input or its voltage output will be affected.

• Using an op-amp for a voltage follower makes a simple and convenient buffer. You can use any old voltmeter to measure the output voltage, and the optodetector is unaffected by other circuit changes.

Note that it might be a good idea to move the detection resistor to the ground side instead of the voltage side of the optodetector. (I didn't.) This would help isolate the signal voltage from power supply fluctuations. If you do, however, it has the side effect of inverting the signal and so you would need to add another signal inversion later in the overall circuit to compensate.

Distance Between Detector and Emitter

I started with 9 inches between the emitter and detector, but this turned out to be too far. I found that 100K collector resistor resulted in merely a one-volt signal difference between a "on" and "off" infrared LED. That is pretty small! That's only 10 microamps difference between the light getting through versus being blocked. Another good reason to eliminate stray sources of illumination on the optodetector.

I moved the emitter and detector closer together, so they're only 4.5 inches apart. I also moved the coil (and the light beam under it) to be two inches back from the front of the box. This gave me a four-volt signal, on top of ten volts of ambient light. The ambient light signal gets stronger at lesser distance because the detector could "see" the opposite side of the box more closely. Worse yet, when ambient levels went up (the sun came out, rare but possible in Seattle) the reflected light was enough to saturate the transistor, and the signal voltage stayed near zero volts whether or not the emitter's light beam was blocked.

I added black construction paper to one side of the box's interior, and the ambient noise was cut in half again without reducing the signal.

Adjusting the Photodetectors

You will probably need to adjust the photodetector's position. You want it exactly in the light beam that passes just under the coil. One method is to drill an assortment of holes in the wooden frame, and lightly press the photodetector into the hole that works best.

Click on the image at right for a closeup of a variety of holes I drilled. The vertical holes are for the optodetector; the horizontal row of holes are for the reference detector. You can see brown wires leading downward from the two optodetectors. The top holes were for my first coil, which was screwed in from above the wood frame. My second coil was screwed in upward from below, and so needed a lower set of holes

Designing the Reference Detector

This optodetector measures the relative brightness of the infrared LED, along with the total ambient light. It provides a reference voltage to the op-amp.

This reference voltage is self-adjusting for small changes in operating conditions. It automatically helps adjust for changes in temperature, ambient light, supply voltage, LED brightness, aging of components, and so forth. Since this reference detector is affected in the same manner as the ball's optodetector, the op-amp will subtract its signal from the ball's to accurately sense the ball's position.

The op-amp is wired as a voltage follower to isolate the photodetector circuit from the next stage. It's not strictly necessary, but it does make design and testing a little easier. Note that you could replace the two 741 op-amps with a single package 324 dual op-amp.

This reference detector eliminates a potentiometer elsewhere in the circuit. One less adjustment to fiddle with! If you're lucky (like me) you won't have any potentiometer in the final device!

Mounting the Reference Detector

To make this work, mount the reference detector near the ball's optodetector. But not too near! The light path to the reference detector must not ever be obstructed by the ball. In this way the reference detector is affected equally by anything that happens to the ball's optodetector.

I mounted my detectors at the same height and about an inch apart horizontally. This gave good results, although I had to be careful about where my fingers went when I put the ball into the field of play. If anything blocks the light beam to the reference detector then the coil will not turn on.

Choosing the Sensing Resistor

You need to adjust the sensing resistor (nominally 56K) to provide a reference voltage in the midpoint of the other detector's operating range. This can be done once and then seldom if ever needs adjustment. I used a fixed resistor, but you might find it easier to use a 56K resistor plus a 20K potentiometer.

I also discovered that rotating the reference detector in its hole would adjust the reference voltage by up to a half-volt. Once the proper position was found I taped the detector into place. You should experiment with its rotation, too, before fiddling with resistance.

How do you choose this resistor? First measure the "clear" and "blocked" voltages on the other detector. (Use a high-impedance meter for measurements!) The "clear" voltage is when the path between emitter and detector is open and unblocked. The "blocked" voltage is when you cover the emitter (not the detector!) and measure the voltage due to ambient light. The signal detector will operate in this range. So the reference detector should be about halfway between these values, so the op-amp can properly amplify the difference.

Note: When the resistor goes up, its output voltage goes down.

Here's an example. One sunny day, I measured the signal detector's voltages to range from 7.0v to 9.0v. So I wanted to set the reference detector's voltage to 8.0v. Suppose I measured an initial reference voltage of 8.5v with a 56K resistor. This means I need to adjust the resistance to subtract 0.5v. This means increasing the resistance to get a lower voltage.

How much should the resistance change? Remember the current is constant; it only depends on the light and not the resistor. So we will find the current first, and use that to find the change in resistance.

The current in the resistor is voltage divided by its resistance:

I = (15.0v - 8.5v) / 56K = 0.116 mA

So to change the voltage by 0.5 volts, we can calculate the change in resistance by voltage divided by current:

R = (0.5v) / (0.116 mA) = 4.3K

So in this example, I would have to add a 4.7K resistor to get the desired reference voltage.

Note the above is only an example; in my levitator I found that a 56K resistor already produced the desired reference voltage.

Operating Range

Here is a graph to illustrate what needs to be accomplished. The reference voltage establishes a midpoint position for the ball. The operating range is the range of voltages for which the detection circuit is linear. The signal voltage represents the maximum range of detectable ball positions. The reference voltage needs to be set near the midpoint of the operating range.

Your job is to establish a useful operating range, and then adjust the reference voltage to be in the midpoint of that range. If you're lucky, both detectors will be affected the same amount by changes in the ambient light level. If you get it right, then adjusting room lighting will move change voltages by the same amount. Good luck!

A Word About Resistor Tolerances

Notice the size of adjustments needed; the changes are around the same size as the common resistor's tolerance range! If you use garden-variety 10% tolerance resistors, then two identical-looking 100K resistors may be different by 20K. So don't count on buying "matched" resistors to make this work.

Designing the Difference Amplifier

This circuit creates a control signal from the two optodetectors. It finds the difference between the two input voltages and amplifies it to get the ball's position. This stage is often called a comparator.

Difference Amplifier

The op-amp has a 100K feedback resistor Rf in combination with an 11K input resistor Ri.

This is a standard inverting amplifier with a gain of:

Gain = Rf / Ri = 100K / 11K = 9.

So the output voltage on pin 6 is nine times the difference between the two input signals. Why choose a gain of nine? Because my measurements found the maximum difference between the two signals was a little under two volts, and we want to increase that signal up to about the power supply range of 15 vdc. A larger signal is better; it keeps the rest of the circuit in a comfortable operating region. If the signal were very tiny then it will be harder to work with. A gain of nine is what it takes to increase my "almost two volts" up to about fifteen volts.

If you're following along in your own laboratory, how do you check to see if this circuit is operating properly? Look at my testing pages here.

Feedback Loop Control Systems

What is a feedback loop control system anyway? And why do we care? What makes them unstable?

It is appropriate to review some general concepts of feedback loop control systems. This page explains what they are and why they are so great, and introduces terminology for subsequent pages on feedback loop stability.

Feedback Loop Control System

There are four elements in any feedback loop control system.

1. Sensor of the position to be controlled

2. Reference input that specifies the value the controlled variable should have

3. Comparator that compares the actual sensed position, or feedback signal, with the desired position or reference signal. The output of the comparator is usually called an error signal, whose polarity determines which way a correction needs to be made.

4. Control mechanism which is activated by the error signal and results in a correction of the position. This is often called an actuator.

In our levitator, the sensor is the optical device that measures the position (or lack) of the suspended object. The reference input is establish by another optical device to measure the ambient light. The comparator is an electrical device that subtracts and amplifies the two inputs. The control mechanism is the electromagnetic lifting coil.

Since the four elements just mentioned are all essential to closed loop systems, it follows that any scheme to control something that lacks one or more of these items is not a feedback control system. Thus, it is easy to examine many legislative programs and obvious why so many of them fail. It also follows, from looking at things in a general way, that nothing can be controlled by feedback unless it can be measured.

Benefits of Feedback

The desired position of the suspended object is the only intentional input to the system. But several other factors such as weight and gravity, power supplies, and air currents can affect the position. Such inputs, being unwanted, are often called disturbances. Since they are subject to nonlinear effects and unknown change with time, they are responsible for the impossibility of merely balancing the coil strength with the weight of the object. The main reason for feedback control is to measure and compensate for the effect of disturbances.

In other types of systems, feedback allows the apparent response speed of a component such as a motor can be increased by overdriving it when rapid response is needed. Still another reason to use feedback is to provide a stiff output, which means an output that is not susceptible to being changed by disturbances. And in other instances, it is desirable to have the output exactly proportional to the input, but the amplifiers and other components may not be perfectly linear. The use of feedback can greatly reduce nonlinearities in all other system components except the sensor used to provide the feedback signal. Finally, when systems are being mass-produced with inexpensive components that may have a considerable variation in values, feedback can greatly reduce the effect of differences between one unit and another.

Problems of Feedback

If all these benefits sound almost too good to be true, it is time for a reality check. Actually, they are true enough, but there is always the Dark side of the Force. There are two main costs:

1. There is an increase in system complexity, which may increase component count. Sometimes this may be offset by the possibility of using cheaper components.

2. Feedback introduces a stability problem, and this is much more serious. This problem is sufficiently troublesome that 90% of the pages on books about feedback are devoted to it.

By stability problem we mean a tendency to overcontrol, or overshoot, when the input or a disturbance is felt. Alternatively, when looking at the frequency response, the gain may rise near the upper end of the passband, which is usually undesireable. In an extreme case the gain can become high enough to cause oscillation, that is, a sustained cyclic response without any input. This effect generally renders the system useless or even destructive.

Causes of Instability

The stability problem is inevitable. It results from the fact that the feedback, which is connected so as to be negative at low frequencies, usually becomes positive at high frequencies. Good stability is usually possible provided the loop gain is low enough.

The main reason the feedback ultimately becomes positive as the frequency increases is that both the control system and the load it is driving contain components that can store energy. Capacitance and inductance are electrical energy storage elements, and mass and springs and raising an object against gravity are mechanical energy storage elements.

Since the drive to physical devices is not infinite, the response must dwindle toward zero as the frequency approaches infinity, with an associated phase shift approaching 90o. Several phase shifts can add up so that the total around the loop equals 360o, which is positive feedback. Only 180o of additional shift from the energy storage elements is needed to cause positive feedback, since the connection at the comparator introduces 180o to make the feedback negative at low frequencies.

Historical Perspective

Historically, the stability problem was first clearly recognized when centrifugal fly-ball governors were applied to early steam engines shortly after their invention around the middle of the eighteenth century. It was approximately another century before the first mathematical analysis of this problem was carried out by the eminent scientist James Clerk Maxwell. (He is far more widely known for his electromagnetic theory of light, which became known as "Maxwell's Equations".)

It was not until well into the twentieth century that Nyquist, Bode, and many others laid the foundations of modern control theory.

Additional Reading

Much of this information is better explained in "Feedback Loop Stability Analysis" by Walter Friauf, McGraw Hill, ©1998, ISBN 0-07-022844.

Feedback Loop Equations

How does a feedback loop control system really work? Since it appears that every signal depends on every other stage in the loop, how do you compute the overall gain?

We'll continue this discussion of feedback loop stability. First we'll look at the loop equations that describe any such system, and then talk about transfer functions.

This information is really much better explained in "Feedback Loop Stability Analysis" by Walter Friauf, McGraw Hill, (c) 1998, ISBN 0-07-022844.

Loop Equations

This diagram shows the basic model for any feedback control system. It shows the four elements in an abstract manner.

Signal flow is clockwise around the loop. Arrows indicating direction are shown, although they are usually used only at the summing junction, or comparator, which is the circle with the X in it. The inputs (two in this case but there can be any number) have + or - signs to indicate whether each input is added or subtracted. With two inputs and the polarities shown, the summing junction is simply subtracting one signal from the other, in effect performing the comparison that is one of the functions needed for every feedback loop.

The input is labeled R for reference which, in this design, is the ambient light measured by a photodetector in units of volts. The output is C for controlled variable, which is the position measured in millimeters from the center position of the photodetector. The output of the summing junction is E for error signal. Photodetector B converts position into voltage, and the letter B also represents the sensitivity of the detector in units of volts/mm. Block A represents all the stages that process the error signal and drive the lifting coil.

From the equations in the diagram above, we eliminate E, since it is an internal parameter. Solving for the overall gain of the system, we get:

[pic]

[pic]

The second form, with 1/B factored out, looks a bit more complicated but is actually more convenient for most purposes, since C/R will be almost exactly 1/B for all useful feedback loops. The reason is that AB will usually be much greater than one, making the other factor in the second form almost unity.

Loop Gain

The overall gain, C/R, is called the closed loop gain since it is the gain from input to output with the loop closed and operating. It is the only gain of any final interest. This gain represents how much the input (reference) signal is amplified at the output.

The real loop gain is the product of all the gains around the loop, AB, and is referred to as the open loop gain. This gain could be measured (theoretically!) by opening the loop anywhere, inserting a small test signal, measuring the signal that appears on the other end of the break, and calculating the ratio.

Despite the simplicity of this equation, it completely describes the behavior of all feedback loop control systems in the world. The transfer functions A and B are arbitrary. These two blocks represent all the signal processing in the forward and reverse directions, and may be fantastically complicated. They may (and usually do!) have frequency-dependent elements and even nonlinear parts. This equation covers them all. The designer's big challenge is to characterize their particular circuit design into these two transfer functions.

Transfer Functions

The characteristics of loop components can be described either by mathematical expressions, called transfer functions, or by graphs. Transfer function is a fancy name for gain.

In the simplest situation the gain of a network or component is just a number that the input is multiplied by to give the output. For example, a two-resistor voltage divider network. Since a voltage divider attentuates a signal, instead of amplifying it, the gain is less than unity, which means that if it is given in decibels, it is negative. This transfer function is Vout/Vin = R2 / (R1 + R2).

If several components are connected in series, the individual gains are multiplied together to give the overall gain. For example, if two such resistor networks are cascaded together, with buffering to prevent loading effects, the overall gain (attentuation) would be the product of the individual network gains.

For a voltage divider, multiplying the input by the gain will give the output, regardless of the nature of the input. Whether the input is a dc value, sine wave, square wave, or a transient, the output is always the same fraction of the input at every instant. The reason for this simplicity in the case of a voltage divider is that no energy can be stored, so there is no time dependency between the input and output.

When energy storage elements are present, the output at any instant depends on the current value of the input, and also to some degree on previous values. Further, the way previous values affect the output depends on the waveform of the input. For example, the position of the object being lifted depends on its position an instant earlier, along with its previous speed and forces of gravity versus the lifting coil.

Feedback Loop and Bode Plot

How does a Bode plot graphically represent a transfer function? How does a common RC network look in a Bode plot?

Bode Plot

A graphical approach is usually the easiest way to analyze and design feedback loops. So we will review how to represent the transfer function graphically. There are several ways to do so, but the method suggested by H. W. Bode in the 1930s is particularly useful.

Bode's method consists of plotting two curves, the log of gain, and phase, as functions of the log of frequency.

Usually the gain in decibels, abbreviated dB, and the phase are plotted linearly along the y axis on graph paper that has several cycles of a log scale on the x axis. Each cycle represents a factor of ten in frequency. This special paper is known as semilog graph paper, and it or a computer program with log-log graphing are essential for making Bode plots.

Definition of Decibel

The decibel is a logarithmic measure of a voltage ratio, or gain. It is defined as

[pic]

Or by the equivalent exponential form as

[pic]

The calculation can be done mentally with the aid of a small table of values. Memorization is practical because reciprocal values of gain convert to the same value of decibel, except for sign.

|Voltage ratio |dB |

|1/100 |-40 |

|1/10 |-20 |

|½ |-6 |

|1/SQRT(2) |-3 |

|1 |0 |

|SQRT(2) |3 |

|2 |6 |

|3.16 |10 |

|5 |14 |

|10 |20 |

|100 |40 |

Cascading Networks

Because of the properties of logarithms, when networks are cascaded so their gains multiply, the overall gain in decibels is obtained by adding the decibels of the networks.

Therefore, three cascaded networks with gains of 2, 2, and 10 would have a total gain of 2 x 2 x 10 = 40, or example, and the gains in decibels would combine as 6 + 6 +20 = 32dB. The same idea makes it easy to convert to and from decibels by breaking down a total into its components.

Another example going the other way is 34 dB, which is 14 + 14 + 6 dB, so the gain is 5 x 5 x 2 = 50.

Phase Lag Network

Whew. Having covered all this background, we are ready to make a Bode plot. Let's start with a "phase lag network" as shown in this schematic, also known as a low-pass filter.

The sole parameter characterizing this network is its time constant T , and we will arbitrarily take this to be 1 ms for this exercise. The break frequency is thenf = 1/(2 pi T) = 160 Hz.

[pic]

At low frequencies the gain is flat and unity, or 0 dB. At high frequencies the gain rolls off inversely with frequency, decreasing by a factor of 2 (or 6 dB) for every frequency doubling. This is an increase of one octave wherever it occurs.

Alternatively, the roll-off rate can be expressed as 20 dB per decade (a factor of 10 in frequency), which results in a straight line on semilog graph paper with a slope of -6 dB per/octave. It intersects the low-frequency curve at the break frequency.

The straight line segments show an asymptotic representation of the lag characteristic, which is not quite exact near the break frequency. There the gain is actually 1/SQRT(2) = 0.707, or -3 dB. Calculating more points enables us to draw the curve as accurately as desired, but the single 3 dB down point and the two asymptotes suffice to get the picture. Even that extra graphing is seldom done, however, since the process entails extra effort. The asymptotic form is generally more useful, since it shows the break frequency explicitly.

Although the x axis is a log frequency scale, the values of frequency are indicated directly for convenience. So, as far as the numbers are concerned, it is a frequency scale, but the markings are not spaced uniformly.

Looking at the phase plot, we see it is 0 degrees well below cutoff, -90 degrees well above, and -45 degrees at the break frequency. We see the transition is more gradual than that of the gain plot. A good approximation to the curve is a straight-line asymptote: 0 degrees at one-tenth of the break frequency and -90 degrees at ten times the break. On a Bode plot the line will be exact at the break frequency, showing a phase of -45 degrees.

For this lag network and for many others that constitute a subset known as minimum phase networks (MPNs), the phase characteristic contains no information in addition to that carried by the gain plot. Therefore, the phase curve is often not plotted at all.

Phase Lead Network

The magnetic levitator is not stable with only position information. (Believe me, I've been there!) The problem is this: suppose the ball is a little higher than the reference point. The circuit reduces the coil strength to allow the ball to go down. But! It doesn't turn on the coil again until the ball is past the reference spot. The ball has picked up some speed, and now it's too late for the coil to overcome both the speed and weight of the ball at the additional distance. Remember that a coil's strength drops off rapidly over distance. So the ball drops out. We fix this problem by detecting the ball's speed even before it moves past the reference point, and adjusting the coil strength to anticipate the new position.

This circuit uses a capacitor to get both speed and position information. It is connected in an arrangement commonly known as a "phase lead network". Let's look at the Bode plot of these networks, and then study our levitator's network more closely.

Bode Plot of Phase Lead Network

A general purpose phase advance schematic is shown. This network becomes a voltage divider at very low frequencies. It has unity gain at very high frequencies. In between, the transition is very much like the phase lag seen on the previous page.

The time constant of the lower break frequency is R1C, and the ratio of break frequencies is the reciprocal of the gain (attentuation), resulting in the Bode plots shown below.

[pic]

The sample Bode plot above is only meant to illustrate how a phase lead network can modify the gain and phase characteristics of a transfer function. Properly chosen values can move the two break points to a wide variety of possible frequencies.

The Levitator's Phase Lead Network

First, a little disclaimer, and a plea for help. I don't know why, but adding this circuit made my levitator stable. Do you know why? Can you tell me how to analyze the transfer functions of the remaining parts of the levitator?

Look at the output from pin 6, slightly redrawn at left. Let's ignore the capacitor for a moment. The 150K and 22K resistors form a divider circuit. It reduces the voltage by the ratio of the two resistors. The "gain" will multiply the position signal by:

Gain = 22K / (22K + 150K) = 0.128

In other words it reduces the signal by a factor of eight. How come? Didn't we just amplify it by a factor of 9? Are we crazy or what?

The idea here is the signal through the capacitor bypasses the 150K resistor. This signal is the speed, ie, the derivative of the position signal. This speed signal goes through at full strength, and only the position signal is reduced. This results in the proper ratio of speed-to-position to stabilize the ball under the coil.

The lower breakpoint frequency is f1 = 1/(2 pi R1C) = 10.6 Hz.

The upper breakpoint requency is f2 = f1/Gain = 82.9 Hz.

If you still find the suspended object is unstable, and knocks around a couple times a second, then you probably want to change f1 to an even lower frequency. For example, suppose you want to cut f1 in half. Do this by:

1. Swap out the 150K resistor, and put in a 75K resistor, i.e. about half the original value.

2. This also lowered the upper breakpoint by four, because (a) the attenuation was cut in half and (b) the lower breakpoint was cut in half. So swap out the 22K resistor, and put in a 5.5K resistor, i.e. about one fourth the original value.

Other combinations are possible, but this is one way to get started in experimenting with values. Good luck! Kindly let me know what works for you!

Designing the Output Amplifier

This circuit amplifies the control signal in preparation for the power output transistor. Why do we need this stage at all? Because we reduced the whole signal by one-ninth in the speed-plus-position circuit.

• This op-amp amplifies the control signal to provide plenty of "punch" to the power transistor and coil.

• And it isolates the rather large load of the power transistor from the capacitor's time constant and from the resistor divider bridge.

This 741 op-amp is wired as a standard non-inverting amplifier. The gain is computed from the feedback and input resistors:

Gain = (Rf + Ri) / Ri = (370K + 1.5K) / 1.5K = 247

That's a lot of gain! Do we really need that much? I'm not sure, but it worked for me! Actually, with this much gain it acts more like a binary on-off switch than a linear amplifier. It will pretty much ensure the coil is either fully "on" or completely "off". Which is a good idea for reducing power dissipation in the final output transistor. So you probably don't need a very big heat sink for your power output transistor. You might experiment with lower values of gain to see what h

Designing the Levitator Coil Driver

This circuit controls the current in the electromagnetic levitation coil L1. It is driven by a 741 op-amp, which is spec'd to source up to 40 mA of current. For any 2N3055 transistor with a beta = 50 or higher, it is sufficient for loads up to 2 amperes with no additional circuitry.

The base resistor provides some protection. It limits the output current demand on the op-amp. What is the actual limit? At worst case, the op-amp is at 15v and the base terminal is at 0.7v. So the maximum base current will be Ib = (15 - 0.7) / 300 = 48 mA.

Diode D1 protects the transistor. It is arranged to block the +12v from pin C. Normally D1 is non-conducting and all the current (if any) will flow through the coil L1 and the transistor. But at the instant the transistor turns off, the current circulating in the coil has to be safely dissipated somewhere. So the diode D1 turns on for a millisecond and allows the current to safely be discharged as heat in the coil.

How did I really choose the base resistor? I tried gradually increasing values of resistors while measuring the coil current. At some value, the coil current began to be reduced, so I went back to the next smaller resistor.

The actual maximum value of base resistor you can use depends on the maximum collector current required, and the gain (beta) of the particualr power transistor in the circuit. The value is not really critical, as long as the power transistor can run enough current through the coil. Indeed, you could probably leave out this resistor and connect the base directly to the op-amp output pin. You can experiment here, or just choose a safe value around 220 or 300 ohms.

Designing a PWM Driver

The switched controller that I used is nice, but a PWM (pulse width modulation) circuit is better. It provides cool-running operation and linear operation. It can be implemented with a small number of components.

I did not build this, but am including the concept for my next levitator.

[pic]

• At power-up, C1 is discharged and starts to charge via R6.

• The + input to Cp1 is held at approximately 1/3 Vcc by R1 and R2.

• C1 charges up to this level and the comparator switches on, pulling its output low.

• C1 now discharges through D1 and D2 holds the junction of R1 and R2 at one Vd above zero volts.

• When C1 is sufficiently discharged the current through D1 is limited by R6 whilst the current through D2 is limited by R2, so will be 10 times as high as that through D1.

• Because of this current ratio, it can be guaranteed that there will be less voltage dropped across D1 than across D2, so the negative input will always fall below the positive input and the oscillator will always reset.

The circuit has several advantages

• It has a defined lower limit (trough) on the waveform - so needs no level-shifting

• Peak of waveform is easily adjusted without affecting the trough.

• It has a low component count.

• It has very good linearity.

• For even better linearity, you can replace resistor R6 with a current source.

To offset these advantages, the oscillator gives a sawtooth rather than a triangular waveform but there are very few occasions when this has any practical significance.

Designing the Lifting Coil

How do you design a coil for lifting a steel ball? There's no clear design rules, but I can offer tips and suggestions!

Do you have suggestions of your own? Please e-mail your ideas to me. I'll update this page with whatever I get. Thanks!

Hints for a Lifting Coil

You need to produce a magnetic field which primarily extends downward from the lifting coil. So consider these ideas.

• Short and fat coils are better than long and skinny. They reduce the leakage flux that would otherwise escape outward from the sides.

• An iron hat (such as a flatwasher) on the top is a good idea. It helps hold windings in place, and helps magnetic flux spread out from the top.

• A nylon washer on the bottom (or other non-ferrous washer) is a good idea. It helps hold the windings onto a fat coil, without shielding any magnetic flux from going downwards.

• An iron core will greatly increase the coil's strength.

• Put the coil itself as low as possible. Closer to the ball is better.

• You need to be able to adjust the coil's position. (Or the detector's position.) The usable magnetic effect extends for only about a centimeter or so, so adjustability is important.

• Don't make the coil windings more than two inches thick. It won't have enough surface area to remain cool, and will overheat.

• A coil resistance of 5 - 50 ohms driven with up to 2 amps has worked well. A couple of published designs operate in this range, so this would be a good target to shoot for.

• Wind some tape around the bolt before winding the coil. This keeps the threads from cutting the insulation.

Coil Core

You can wind a coil on a carriage bolt. (Use one layer of tape first to protect the wire.) The threads can provide adjustability by screwing it in (or out) of your wooden frame.

The size of the carriage bolt is not critical. I used a common carriage bolt 4 inches long and 3/8 inches thick, chosen merely for convenience. Click on the photo at left to see two examples.

The bottom of your steel core (coil form) should taper to a point. This gives a point source of flux going downward. I found a flat-bottomed steel core gave too many places for the ball to attach itself to, and allowed too much side-to-side motion.

File off any roughness to ensure the bottom of your steel core is pointy and smooth.

A Coil That Works

Here's the coil I used. Click on the picture at left for a full size image. It shows a closeup of how it is screwed into the wooden frame above it. The whole bolt/coil assembly can be turned to raise and lower it. You can see a nut which fastens the top washer in place. This also helps eliminate vibration and hum.

I used 24-ga magnet wire, in 1341 turns on 24 layers wound on a carriage bolt. There is a nylon flatwasher on the bottom (the head end) and a common galvanized steel flatwasher on the top. The coil length is twice the width of Scotch magic transparent tape, which secures the layers of windings. The coil dimensions are:

• 7 mm inside diameter (same as bolt diameter)

• 33 mm outside diameter

• 40 mm winding length along bolt

• 0.54 mm wire diameter (i.e. 24-gauge wire)

This coil has 7.0 ohms of resistance. Driven by a 15v source, it carries about 2 amps of current. Unfortunately it tends to get pretty warm, if left full on for ten minutes. However, testing has found it works fine left on overnight holding up a small bolt. But I am still concerned about how hot it may get if left on without an object under it.

The coil is energized by a 2N3055 pnp power transistor on a heat sink. The heat sink doesn't seem to be required, but keep an eye on it! Some other people have reported they just put it into the breadboard without any heat sink. But two people said the transistor ran boiling hot, even with a heat sink (but they had a transistor bias problem).

Levitator Simulation Using PSPICE

What if you wanted to analyze this circuit using engineering CAD (computer aided design) tools?

Many engineering students and some working engineers have access to PSPICE and other commercial tools. You can gather a great deal of insight into this circuit, and easily experiment with changes.

I am using Allegro Design Entry CIS v10.3.0.p001, produced by Cadence Design Systems. This tool integrates schematic capture with PSPICE simulation and other tools. I provide all my files, in the hope you can use them to do your own analysis.

Levitator Package Download

Download levitator package here

Although my package was produced by Allegro tools, the netlist and PSPICE files are text-based industry standard format. You can import selected files into many other implementations of PSPICE.

Please note the inputs to U3 are swapped, so it becomes a non-inverting amplifier. This makes the graphs more natural and a bit easier to read since they're right-side-up. It is not a problem during analysis because the Signal and Reference points are symmetric. However, it is a departure from the real-world schematic and, if you closed the loop in PSPICE, it would not function properly.

DC Operating Point

All stages are dc-coupled. This is required for any controller that must govern the absolute position of an object in space. So it is useful to know the default operating point of every node. This analysis also tells you the maximum coil current and power dissipation in various components. The result of the bias point calculation from Allegro is:

[pic]

• The "input signal" is chosen to fully turn on the coil driver.

• We simplify some parts for convenience. The op amps use an "ideal model" rather than LM741.

• The optical detectors are a non-standard part, so we use a simple resistor with the equivalent current.

• Since the tools assume ideal inductors have zero resistance, a 7-ohm resistor is added in series.

• For purposes of dc bias, inductors are shorts and capacitors are open.

• The power supply delivers 2.1A at 15v, or almost 32 watts.

Let's look at the stages one by one, calculate the gain, and compare them to the original design.

DC Sweep: Gain of Difference Amplifier

If we connect a small dc voltage source to the input signal's resistor divider, then we can examine the circuit behavior over the entire operating range. This is called a dc sweep.

The results from Allegro to compare the difference amplifier (U3) to input voltage (Vx):

[pic]

From the linear data points above (and using the waveform cursor), we can calculate the first stage gain:

Gain = [12.591 - (-12.636)] / (3.5 - 1.0) = 10.0976

This is a bit higher than calculated gain of 9, but it seems reasonable.

DC Sweep: Gain of Phase Lead Network

Now let's see the gain (attentuation) introduced by the phase lead network. We can use the same Vx input voltage, and study the signal strength at the junction of R7 and R8:

[pic]

The total gain after the phase lead network is Gain = 3.2267 / 2.5 = 1.291. We can isolate the gain (attentuation) of the phase lead network by dividing by the first stage's gain, which yields:

Gain (phase lead) = 0.1278

This is a good match with the calculated gain of 0.128.

DC Sweep: Gain of Output Amplifier

In a similar fashion, we can use the "dc sweep" function for the output stage gain alone:

Gain (output amp) = 232.38

This is a good match with the calculated gain of 247.

DC Sweep: Coil Current versus Sensor Voltage

Now that we've seen all the individual stages, let's see how the coil current depends on the sensor voltage. This is an excellent "paper test" of the overall dc-coupled design. This also provides the end-to-end gain figure, which might be useful for analyzing the closed-loop control circuit.

The results from Allegro for coil current versus input sensor voltage:

[pic]

• The coil current switches from 'off' to 'on' over a narrow range of input signal.

• The 'operating range' is from 2.25v to 2.2905v, or about 40mv.

• Your actual operating range will vary according to the reference voltage.

• The maximum coil current is 2.1 amps (same as the bias point computation).

• Gain = 56.72 amps / volt

AC Frequency Response

We will set up the AC sweep for the levitator, to get the phase and magnitude of sinusoidal waveforms over a range of frequencies. This will tell us the coil current's frequency response.

We do this by replacing Vx (dc power) with VAC for a small-signal sweep. The tools calculate the bias point, and the AC sweep is performed on a linearized model. This approach can only be used to find the small-signal gain and frequency response. Items such as voltage swing, clipping, and saturation must be obtained from the transient simulation, or by using the operating point information.

The Bode plot of small signal gain is:

[pic]

How Long Does It Take To Build?

How long? Your mileage will vary! All I can give you is my wild guess...

Build Time

An educated person working in their spare time (i.e. they have a job or go to school) under good conditions will take a week to get all the parts, a weekend to build the wooden frame and wind the coil, a weekend to wire the breadboard, then one more week to get things working and make adjustments. So call it a month just in their spare time. It could be done quicker if they spend an hour or two every day, or if they're very experienced with electronics. It can be done much slower if any step runs into problems.

It took me almost sixteen weeks, but most of it was a month of late nights trying out different circuits that didn't work. How long will it take a beginner? I'm sure you can easily finish it by the end of your junior year of electrical engineering in college. :-)

I've heard from a few electrical engineering graduates. They can generally build this in a few weeks. One very experienced engineer built it in three (very) long days! However, it is very unusual to have enough various spare parts on hand to do this.

I've heard from a few high school students. More often than not, this is too difficult to get completely working. The typical problem is to have it almost working -- it can hold an object for a few seconds before it flies off. I'm not sure what the causes may be, and it is almost impossible to debug this situation via e-mail.

Printed Circuit Boards

There is a generous volunteer in England that has built a PCB for this levitator. He's checked it out and it works great! This can save you time building the levitator, and minimize the chance for errors.

E-mail Amadeus if you're interested, or jump ahead to my Printed Circuit Board page.

Maglev Printed Circuit Board

Want to save time? Want to eliminate wiring errors? If you're experienced in fabricating a printed circuit board, here are some good plans!

This PCB was designed, built and tested by Amadeus and he's done a great job! It makes a tidy and permanent assembly, used instead of a hand-wired breadboard.

PCB Solder Mask

[pic]

PCB Component Layout

[pic]

Important Notes

These full size images are shown at 200% scale. You should reduce it to actual size before printing it to a photo-resist material. The part numbers refer to the schematic.

The PCB allows you to jumper the +12v and +15v power lines together. This can save you the expense of the third power supply, but it can also introduce the high-power switching noise into your delicate control circuits. So I don't recommend connecting them. Your mileage may vary, so first make it work with an independent +12v supply, and then see if it still works after connecting the jumper and using just +/- 15v supplies.

Power Supplies

What kind of power supplies will work? How many does it need? How do you get both positive and negative voltages out of two identical power packs?

Power Requirements

This levitator works well with small d.c. wall adapters. These power packs are common and inexpensive, and they ensure no dangerous voltages are exposed. You can find them at Radio Shack for under $15, and other places for somewhat less.

You need three power packs. The voltages and minimum current requirements are:

• +12 vdc at 0.5 amp (for the +15v supply)

• +12 vdc at 0.1 amp (for the -15v supply)

• + 9 vdc at 0.8 amp (for the coil supply)

You can use any power pack that has these voltages and AT LEAST this much current rating. It is fine to use supplies with higher current (at same voltage) ratings. The higher current capability might allow it to last longer or run cooler.

It is probably easiest (and the same price) to just get two identical 12vdc supplies and one 9v supply.

Coil Driver Supply

The power to the coil deserves a bit more discussion. Why use a separate supply? Why not save money by sharing the +12v supply for the electronics?

The reason we use 9v on the coil is that it reduces the coil's heat build-up. It's possible to use a 12v supply on the coil but it doesn't seem to work any better and just makes the coil hotter sooner.

A separate power supply also provides isolation. My assumption is that power comes from a cheap wall wart, and the coil's high current demands from a shared and poorly regulated supply would cause problems. If you have a good quality regulated bench supply then you can probably share the power and have no problems. But you'll want to run a separate and heavier power wire from the supply terminals to the coil driver. Otherwise the ohmic drop in the power wire can insert spurious signals into the electronics.

A separate power supply is also more flexible. You may want to change the voltage to the coil driver because different size/shape/gauge coils may need more or less current. A separate supply is an easy way to make changes without affecting the op-amps.

You're have the greatest chance of success by not sharing the +12v power supply. The hardest thing of all to debug is to detect that the power supply is forming a sneak feedback path. You're better off first making it work with three power packs, and later on checking to see if you can share one pack with the coil driver. Now don't say I didn't warn you!

Connecting Power Packs for Plus and Minus Voltages

Suppose you ran out and obediently bought some power packs, and now you're wondering how to take two +12vdc packs and get both positive and negative voltages out of them. Do you just take one and plug it in backwards? No! You connect the positive wire of one pack to the negative wire of the other.

These power packs are good isolation transformers, as well as providing d.c. voltages. They will happily provide their 12vdc at different offset voltages from ground.

A third power pack will give us +9v for the lifting coil.

The reason we use 12v power packs (when the specs call for 15v supplies) is that the voltage is not critical. The '714 op-amps run happily anywhere from 9v to almost 20v, I think. Also, these little power packs are stamped "12vdc" but the output is unregulated has a higher voltage when lightly loaded, and only at full rated current does their voltage droop down to 12v. The control electronics don't demand very much current so if you measure the power rails you will probably see 14v or 15v or maybe even 16v coming out. Cool!

There! Now you probably know more than you wanted about power supplies!

Setup and Adjustment

Let me suggest what order to make your adjustments. The next several web pages work methodically from beginning to end through the electronics, to give you detailed instructions for troubleshooting and adjustment.

Just click [pic]at the top right, and follow the bouncing ball!

How Do You Make It Work?

It's easiest to start at the left of the schematic and work your way toward the right.

This information was distilled from many e-mails exchanged with people building the levitator. Thanks for writing to me about all your problems. In this way, your difficulties are very helpful to the next person!

Read this: Important! Don't be in a hurry. You need to get each part working correctly before moving to the next stage. There is no point in connecting the lifting coil until you have proved that every single stage is doing its job.

Is this for you? This troubleshooting section is written for people with some experience with electronics. If you are a high-school student building this, then you will need a local mentor to help. Although I'm happy to answer questions, I have not been very successful at fixing a levitator via e-mail. I'm just a hobbyist doing this in my spare time; I'm not able to write about introductory electronics and how to read schematics and how to take measurements.

Checklist for Testing

Note: Disconnect the lifting coil from the power supply for safety as you follow these steps. The next several pages provide details about every stage,

If you are extremely fortunate, after these steps your Antigravity Relay will work! Or you can skip ahead and read about my results.

Do you still have problems? Or have you solved problems that I forgot to mention? Send me your questions and comments, along with detailed information about the symptoms and what you've tried, and I'll update these pages to help the next person.

Testing the Power Supplies

What can possibly go wrong with power supplies? How do you check that it's working? To review the power requirements and wiring go here.

Before Connecting Power to Circuit

To avoid damaging the sensitive semiconductors, you'll want to check these things.

• Are you sure you have a DC supply? The "wall wart" style of power packs come in both AC and DC flavors. Read its engraved specifications carefully. If it says "12vac 800mA" then it is an AC supply. It must say DC as in "12vdc 800mA" or it will fry all the LEDs and op-amps.

| |   | |

• If it has no engraved specifications, you can test it with your voltmeter. Connect the probes and set your voltmeter for a 20-volt AC scale. Turn on the power pack. If the meter moves from zero, then you have an AC power pack and must not use it.

• Does it have adequate voltage and current? The 741 op-amp will run on a range of voltages from +/- 12 to +/- 17 volts DC. Please note that a power pack rated for 15vdc will normally provide a little more voltage, perhaps around 17v. This will drop a volt or two as the current demand increases. Anything from 17v below will work fine, the precise value is not critical to the trusty old 741 op-amp.

• Do you have the proper polarity? Use your voltmeter to verify the positive and negative wires from the power pack. Set the voltmeter to a 20v DC scale; when the meter indicates positive voltage the red probe is connected to the positive wire.

• Does it matter if you use a 110vac to 12vdc adapter, 1000mA instead of a 800mA adapter? It really doesn't matter what current rating is on the 12vdc adapter, as long as it's at least 800mA. A higher rated adapter may run cooler and last longer than a barely-capable one.

• Do you have adequate ground connections everywhere? There are many ways of wiring connections to ground, but I recommend using 'star' wiring instead of 'daisy chain' wiring. It just works better. Try to avoid a lot of point-to-point-to-point ground wires through the circuit board. These are equivalent to tiny series resistors, but it works better if they are more like little parallel resistors to ground.

• Are you ready for the first power applied? You should temporarily remove all the op-amps before applying power the first time. This allows you to measure the power rails before plugging in the little smoke generators.

After Connecting Power to the Circuit

Temporarily unplug and remove the 741 op-amps. Plug in the power and turn it on. Here's what to look for in the smoke test.

• Check the quantity and quality of smoke

• Do the pilot lights turn on? If the power is reversed, then the LEDs will remain dark. Also, if the LEDs are connected backwards they will not light up. These LEDs are a convenient visual indicator that your power supplies are turned on and working. You can blow them up with too much current (i.e. a dead short across the power supply) but not by plugging them in backwards.

• Are the pilot lights bright enough? This is merely a subjective matter. If they're too dim, reduce the value of the series resistor by 10 - 20%. If too bright, increase the resistor's value.

• Does the circuit bring power to the proper pins? Use your voltmeter to measure the positive and negative power connection to the op-amps, before they are plugged in. Pin 7 on all the 741s should be +15vdc. Pin 4 should all be -15vdc.

• Now you can plug in the op-amp chips. Pay attention to orientation! If it is plugged in backwards then it will puff its little heart out into smoke.

• There are two ways to identify the pins. There may be a circle stamped next to pin 1 as shown at left. Or there may be a U-shaped mark at the top of case, as shown at right. Sometimes there are both.

|[pic] |   |[pic] |

Testing the Infrared Emitter

The infrared LED generates invisible light, so how can you tell if it's working? To read about the design of this little circuit go here.

See If Emitter Is Working

Follow these steps to take voltage and current measurements to check the LED operation.

• Measure the voltage on the LED pins. Since this is a forward-biased diode, it should be a little under 1 volt.

• If the measurement is the same as the power supply, you have a problem. It is most likely connected backwards. This doesn't damage the LED, so just reverse its connection and try again.

• If the measurement is zero volts, then you have a wiring problem. There is most likely an open connection somewhere.

• Is the 500-ohm resistor warm? Careful! This resistor can burn you! It is normal in this circuit for the resistor to run fairly warm.

• Is the 500-ohm resistor very hot? It should be warm, but not too hot to touch. If so replace it with a higher-wattage resistor, or use two 1-kilohm resistors in parallel.

• The physical position and focusing (if any) should cause equal amounts of light to fall on the optodetectors. This makes a better comparison between their two electrical signals. If you have a visible-light LED then adjust it for good coverage. If it is infrared, then take your best guess.

• Secure the LED in place so it cannot move. The detectors are very sensitive and will fall out of adjustment if the LED is bumped or replaced.

Note: The 500-ohm resistor might be replaced in a later step during checkout. But you won't know if your LED is bright enough until after you test the optodetectors.

Testing the Signal Detector

The signal detector circuit looks at the tip of the lifting coil. It detects whether an object is there or not. Obviously, if if this fails then nothing will work. How do you verify it's working?

To review the signal detector circuit go here.

By the way, the signal detector circuit is identical to the reference detector cicuit. The main difference is the physical location of the optodetectors. So almost everything mentioned here applies equally well to both circuits.

Note you can't accurately measure the voltage on the 56k sensing resistor because the internal resistance of most voltmeters is less than 56k. That's why the first two 741 voltage followers are there in the first place.

Fairly Obvious Things to Check

Here are some things to look at before getting too serious with the voltmeter.

• Is the op-amp the right way around? The 'dip' in a corner is important! It is a marker to indicate pin 1. Looking at the top, say after it's plugged into the breadboard, the pins are numbered 1 - 8 in a counter-clockwise fashion. They use two different ways to indicate the end with pin 1. Usually it's a small circular depression on the top, next to pin 1 itself. Or, it's a notch on the top at the end with pin 1.

• Did you connect both op-amp power pins? Make sure pin 7 goes to +15v and pin 4 has -15v. My big schematic implies the connection but doesn't show it.

• Is the phototransistor connected with the right polarity? If you always measure 0 volts across the sensing resistor, then it may be in backwards. Like most BJT devices (bipolar junction transistor) it can only conduct one direction. Just swap the wires and try again; it will not be damaged if you put it in backwards.

• Does the optodetector match the LED emitter? It would be nice to get a matched pair, just so you know the detector is looking at the same frequency that the emitter puts out. This does not seem to be critical (I think) because I heard they're fairly broadband. The easiest way to ensure compatibility is to visit Radio Shack. They sell a package containing both. Buy two packages because you need two detectors, then save the extra emitter as a spare.

• Try to adjust the LED emitter so an equal amount of light falls on both detectors.

• Secure the optodetector firmly in place. Small movements will affect its sensitivity.

Testing Voltage Levels

Use these voltage and current measurements to check the signal detector's operation.

• Does the output pin 6 show a negative voltage? This should not happen, because the op-amp is a voltage follower, and its input must be between 0 and +15 volts. Here are things to look for.

• Cover the phototransistor lens with something (such as your thumb) and measuring the voltage on its 56k resistor.

o One lead of 56k resistor should measure +15v, and the other should measure at least +5v or above. You might measure as much as +15v on both leads.

o The 56k resistor goes to pin 3 on the op-amp, so measure the voltage there also. It should be the same, somewhere between +5 and +15v while the phototransistor is covered up.

o Measure the power pins on the op amp. Pin 7 should be +15v, and pin 4 should be -15v.

o Measure the voltage on pin 2 and pin 6 of the op-amp, they should be the same. (This is testing the jumper wire connection from pin 2 to pin 6.)

o If all these measurements check out okay, and pin 6 is still negative, then maybe the op-amp died. Try swapping it with another op-amp on the breadboard and pray to the silicon gods and test these things again. If all this finds a problem, and you fix some error somewhere, then pin 6 should start registering a positive voltage. When the phototransistor is covered, it should be near +15v. When the phototransistor is uncovered, it should become a lower voltage.

• Make mechanical adjustments (rotating or tilting slightly the emitter and detector) to get the lowest voltage on pin 6 in both of the first two stages. The 'lowest voltage' corresponds to the most optical signal falling on the phototransistors.

• A dark phototransistor should result in pin 6 of its op amp being about the +power supply voltage.

• Conversely, a brightly lit phototransistor should result in pin 6 of its op amp going to a lower voltage, maybe down to 6 or 9 volts or something. It depends on brightness of the LED, the sensitivity of the detector, and the distance between the two.

• Use the hand-waving to create the bright and dark situations. Measure the voltage on pin 6 of the op amps. Record the highest and lowest voltages you get on pin 6.

• Is the highest voltage more than two volts above the lowest voltage? Is so, this is great, it's working!

• About the mechanical adjustments... The idea is to get the phototransistor pointed toward the emitter correctly. I hope you can use the voltage on pin 6 of those two voltage followers to check the success of the alignment. (Hint: higher voltage means more dark, lower voltage means more bright.)

• Still doesn't work right? The phototransistors may still be wired backwards. This can happen if the data sheet diagram is a top view, and you thought it was a bottom view. Or versa vice. (That's 'vice versa' vice versa.)

Testing the Reference Detector

The reference detector measures the LED brightness, along with the ambient light level. This provides a voltage that will be subtracted from the signal detector, so we can tell if there is an object under the coil.

To review the reference detector circuit go here.

The reference detector circuit is electrically identical to the signal detector. The only difference is the physical placement of the sensor.

See if it's Working

Please repeat the check-out procedure you used when testing the signal detector.

If I think of anything new or special or different, I'll add it! So fa

Adjusting the Sensing Resistor

The sensing resistor is perhaps the single critical component in the levitator. If the value is a bit too high, the coil is always on. If too low the coil stays off.

How do you get just the right value?

Measurements and Adjustments

Read this for help on arriving at the best value for the sensing resistor.

• This graph shows the relation between opto signal (red) and the opto reference (blue). Note that your own voltages will vary from mine.

• Does the difference amp's output (pin 6) go mildly positive, but not nearly to +15 volts? What can happen is that with an object there, the two voltages are practically equal. Here are a few example voltages to see what happens...

o if they're exactly equal then the comparator puts out zero volts, and the coil stays off.

o if the reference is 0.01v LOWER than the signal, then the comparator subtracts the signal from the reference and multiplies by 8, and puts out a negative voltage. This turns off the coil.

o if the reference is 0.01v higher than the signal, then the comparator subtracts the signal from the reference and multiplies by 8, and puts out 0.08 volts. Not enough to turn on the coil much at all. The goal is to have the reference voltage be halfway between the two signal voltages: in your case it should be 12.0 volts.

• Does your levitator work one day, and fail utterly the next? What can happen is one of the sensors shifted. This would move the operating point out of the working range. Do you have the emitter and both detectors firmly secured in place? Either need to shift the sensors slightly to achieve this, or secure them so they can't budge and adjust the 56K resistor to get the right voltage.

• The LED emitter should be adjusted so an equal amount of light falls on both detectors. With an infrared LED you can only guess at this positioning, but if you used a red LED then you can see what to do.

• Measure the voltage on pin 6 of these two op-amps, and fill out this table:



|  |Signal |Reference |

| |Detector |Detector |

| |(volts) |(volts) |

|Open |________ |________ |

|Blocked |________ |________ |



The "open" measurements are taken with nothing under the lifting coil. The "blocked" values are measured with something blocking the light beam, in a position just under the coil.

• If they're already secured, then here's how to adjust the resistor. The goal is to raise the voltage on the sensor by 0.5v. So the resistor needs to be slightly smaller. How much?

- The voltage across the resistor is 15v - 11.5v which is 3.5v.

- We want to make that 0.5v less, or change this to 3.0v.

- Using ratios the new resistance is calculated by R = 56k * (3.0v / 3.5v) = 48K So see if you can come up with a 48K resistor instead of a 56K resistor for the reference detector circuit. That's what will raise the voltage by 0.5v. Please note this will only work if both opto detectors cannot shift around to screw things up again.

• Is this too complicated? Insert a 20K potentiometer in series with the 56K resistor. Twist until it works. You may need to swap it from the signal circuit to the reference circuit, depending on your particular setup. But then again you can't tell if it will ever work without taking the measurements.

If you can get the right value here, then you are well on the way to success! The remaining parts are less critical.

Testing the Difference Amplifier

The difference amplifier compares the signals from the two optodetectors, and amplifies the difference between them. How can you tell it's working? To read about the difference amplifier go here.

See if it's Working

There's not a large number of things to go wrong, but here are some things to check.

• We can't really get the third op amp to do much until the first two are detecting light changes successfully. So you've already checked out both opto-detectors and they're working, right?

• Measure the unblocked signal at pin 6 of this op-amp.

This means you put both opto-detectors have been checked out and working. Turn on the power. Don't put any object in the light path, we're measuring the unblocked signal. Pin 6 should be 12 to 15 volts above ground.

• Measure the blocked signal at pin 6 of this op-amp.

This means you carefully place something like your fingertip in the light beam, exactly where the suspended object should be. Be careful that you don't block the light path to the reference detector. Pin 6 should be between -5 and -15 volts.

With the above behavior, you have a sensitive comparator that detects whether the light beam is blocked or not.

Now the hardest parts are done! All that remains is a final stage of amplification, and the power control transistor.

Testing the Non-Inverting Amplifier

The non-inverting amplifier is an output stage the multiplies its input voltage by a factor of 247 or so. This converts the signal to either all the way on, or completely off. It turns the small sensed signals into a square wave for the coil. How do you tell if it's working?

To review the non-inverting amplifier design, go here.

See if it's Working

Are your optodetectors working yet? Good, you need touse them to exercise this stage. Assuming that everything is plugged in and working so far...

• First, leave the light beam unblocked. The voltage at this input (pin 3) should be at least a little above zero volts. Measure the output (pin 6) and it should be nearly the same as your positive power supply.

• Now block the light beam with the tip of your finger. Use just enough to block the signal detector, but not enough to block the reference detector. Measure the output here (pin 6) and it should be about the same as your negative power supply.

• If it didn't work, then make sure the chip is not backwards. And make sure that +15v is on pin 7 and -15v is on pin 4.

Testing the Output Transistor

The output transistor controls the high current flowing through the coil. To read about the levitator's coil driver design look here.

See If It's Working

Here are some tips to check out.

• Do you have the right transistor? To help identify it, this photo shows the package from Radio Shack. It also lists the maximum ratings. A lower-rated transistor would probably also work well.

• Are the transistor's pins connected properly? The 2n3055 is an NPN silicon power transistor. Here is a cheesy ASCII chart. Here some pin diagrams as viewed from the bottom.

• _

• /O\ mounting hole = collector tied to case

• / \

• base---/-o o-\---emitter

• / \

• \ /

• \ /

• \ O / mounting hole (also the collector)

\_/

It's easiest to just solder the wires to the two terminals, and then put a solder lug terminal on the screw through one of the mounting holes.

• Do you really need the heat sink? Probably not. I mounted the transistor on a heat sink because I didn't know when I started if it was necessary. But it never gets any noticeable temperature rise. There is not much heat dissipated in there anyway because it runs either full-on or shut off, switching back and forth at a couple of kHz at whatever pulse width is needed to suspend the object. This is a natural consequence of having a large gain; the final drive stage isn't running in a linear mode, it's really in switching mode.

Overheating

Is the transistor too hot? That is a sign that it's not fully turned on. If it's too hot to touch, you have a problem. It may soon melt its internal solder joints and quit working.

Either one of two things will help. Replacing it with an identical power transistor, or reducing the 300 ohm base resistor value.

The reason that swapping the transistor can help is that some transistors have higher gain than others, even from the same manufacturing batch. A higher gain transistor will conduct more current when given the same base (input) current. The gain is measured in 'beta' which is a simple ratio between output current (collector) and input current (base). Typical values can easily range from 50 to over 100 for these power transistors.

Here's why this transistor should run cool... The output transistor is meant to turn completely fully ON when the coil should be on. This is also known as operating in saturation. This means maximum current, but a fully-on transistor a very small voltage between emitter to collector. Since power and therefore heat production is the product of current and voltage, it will run cool because its voltage drop is so low. Sample numbers are: a fully-on transistor has 0.2v between emitter and collector, and suppose the coil takes 1.5 amps. The power dissipation is 0.2v * 1.5 = 300 mW. That will let the power transistor stay very cool.

So how can you verify this is really your problem? Setup the levitator so the coil should stay fully on. Measure the voltage between the emitter and collector. If it's greater 0.5v then the transistor is not being turned on completely, and it will overheat unless something is changed.

The other item was the 300 ohm base resistor. Replace it with a 200 ohm or so resistor, or put another 300 ohm base resistor in parallel with it, to effectively get a 150 ohm resistor. The actual value is not critical, as long as you get that sucker fully turned on.

Testing the Lifting Coil

The lifting coil, umm, well, keeps the object aloft. To read about the lifting coil design and construction, go here.

Things To Check Before You Connect The Coil

Disconnect either wire to the coil, so you can take these measurements.

• Use your VOM or multimeter to check the resistance of the lifting coil. If it is very high (e.g. >20-kilohms) then you probably have an open connection or broken wire and it needs to be fixed or replaced. A resistance more than 100-ohm is probably too much to allow sufficient current to flow.

• A resistance in the range of 5 - 10 ohms driven with 1 - 2 amps has worked well in a few published designs.

• Does your coil have a solid ground connection? It carries a decent current (up to 1 amp) so you should have a heavier wire than most from the 2N3055 emitter all the way to the power supply ground connection. This ensures the extra current won't introduce noise into the sensitive electronics.

• Is your coil protection diode connected correctly? The diode is in parallel with the coil itself, and protects the electronics each time the output transistor turns off. It is screwed into a terminal strip, visible and labelled D1 in the figure. (See a close-up photo here. You need the diode because you wouldn't want the inductive kickback to blow up the output transistor or the op-amps.

• Did you file the bolt head smooth? The raised lettering may be causing an asymmetric field, which could lead to instability. Gotta be careful with filing though, you would hate to file off one of the windings!

• I had some trouble suspending long skinny things for more than a few minutes. I think the broad head of the bolt on the bottom of the electromagnet might work better in this regard if it were more pointy or a smaller diameter.

• Are you really sure you wired it correctly? Have a friend check all the wiring. In particular, make sure the capacitor in the phase lead network is hooked up right. It will be unstable if you didn't do it right.

Checking the Parts Alignment

• Is your lifting coil aligned in the box above the emitter/detector pair? You probably need to build the coil first and mount it in the box. Then make a horizontal line about 1/4-inch below the tip of the coil, and that will be the height of the emitters and the detector. Drill holes. Try shining a flashlight into one hole and see where it hits the other hole. That helps get them close to the right height. You will need some adjustability of the coil height; that's why the threaded bolt is the core of the coil. I threaded it into the top plank, but you could do something else, as long as it's adjustable. For example, you could use two nuts above/below the top plank to make adjustments. That would probably be easier than my method, because I can't turn mine very much before the coil's wires get rather tangled.

• Another word about alignment... Both the emitter and detector are wide-angle devices. They will emit and detect primarily across a 45-degree beam, but some light will go all the way out to 90-degrees from their axis. For the emitter you can shine almost any which way in there and it will work. However, a focusing bezel will improve the signal falling on the detectors.

• For the detector, you may need to pay a little attention to reducing the ambient light that gets in there. That's why you need a five-sided box (although a 6-sided box would work a lot better! ha). I pasted black paper on the side opposite the detectors.

Testing The Coil

You can test the output stage without any other electronics. Here's how.

• Can your coil lift things? Follow these steps to check out the lifting power of the final stage + coil alone.

• Disconnect the 300-ohm resistor from pin 6 of the non-inverting amplifier.

• Temporarily connect it to +15v.

• This will fully turn on the 2N3055 output transistor.

• The coil should firmly hold any iron objects that come close. It can probably hold up a big screwdriver or pair of pliers.

• If not, use your voltmeter to measure the voltage between the base and emitter of the 2N3055. If it is more than 1 volt, or less than 0.65 volts, then you have a problem that must be fixed.

• Does your coil overheat? Leave its power turned on this way, and check the coil temperature. See how quickly it gets warm, and use this information to know how long you can use the levitator before it needs to cool off.

• Return the 300-ohm resistor back to pin 6 of the non-inverting amplifier.

Your levitator should be working now! Try it out. Have fun!

Results and Further Work

This "antigravity relay" works great! It holds the heavy steel ball in place about 0.2 inches below the coil. The power supply draws about 500 mA to suport the ball, and you can see the current fluctuate slightly if the ball is swinging a little bit. There is a slight high-pitched whine from the coil, which is reduced if the "derivative" capacitor is increased.

The ball can spin for a loooo-o-ng time, a great example of a magnetic bearing system. We painted lines on the (otherwise shiny) ball to make the rotation more visible.

The lifting range is about half an inch. Don't expect it to pick up the ball from the bottom of the frame! The electromagnet can only reach out a few short centimeters, and anything further might as well be at infinity. Or in Colfax, Washington, same thing. You have to start by positioning the ball by hand each time. It takes a little practice to put it in place without your fingers interfering with the light beams.

The lifting weight is almost an ounce (1/16 pound). Here is a photo of some objects I've suspended.

The ball may swing a little from side to side. A bolt or iron bar may oscillate a little about its midpoint, and after some time (ten minutes or more) the oscillation can build up to where the bolt is dropped. This seems to be caused by the shape of our carriage bolt. The bolt's rounded head is pointing downwards, producing a wide field. A narrower field would hold the ball more steadily in one place. Next time (hah!?) I will put a more pointy end on the bottom of the electromagnet.

What Comes Next

What changes would make this work better? How can I improve this design?

A reduced chip count can be achived by replacing the trusty but ancient 741 with a modern device. The modern parts have better specifications in all regards, and can be found in dual and quad packages. Alternatively, the first three op-amps can be replaced with an instrumentation amplifier, such as the Burr-Brown INA118 or Analog Devices AD620 or AMP02.

Fewer power packs would make it smaller and cheaper. This can be done by using modern op-amps and eliminating the "ground" connection. This requires a redesign of several stages, but it would be easier to build.

A small, dedicated power supply would make this project more portable. I'm using a industrial-strength lab bench supply that weighs forty pounds or more. Complete overkill. A simple circuit based on a few small three-terminal regulators should be adequate. Or, three plug-in battery eliminators have been found to work extremely well, with the advantage that no 110vac wiring is exposed.

The sensor stages were designed backwards. It is counter-intuitive that the voltage will down as more light hits the sensor. It works just fine, but it doesn't make the most sense. It would be more understandable if the voltage goes up with more light. Then all you need is another level of voltage inversion somewhere, perhaps by changing the last amplifier from non-inverting to inverting design.

You can make a linear output stage with a PWM chopper circuit. This allows linear analysis techniques to analyze the circuit performance. That is, if you compare the desired control signal with a sawtooth waveform, then the pulse width is proportional to the desired coil current.

The article in Electronics Now (Feb 1996) shows the schematic of a safety cut-off circuit. It removes the coil's power if the ball is absent, or if the light beam is completely blocked. The idea (a very good one, too!) is to use the output from the difference amplifier. Since this signal is linear with respect to position, you can add low-voltage and high-voltage threshholds. If it exceeds either threshhold then the coil could be disabled with a smaller pass transistor.

The only problem is the coil does get warm in a few minutes. It will be hot to the touch in half an hour. Sooner if no object is being held. I wouldn't want to leave it unattended! Note that a hollow steel ball would take much less power to levitate than the solid half-inch bearing that I used. Using a lighter ball would reduce average and maximum coil current requirements, which would greatly reduce the heat dissipation. However, this levitator is not stable with very lightweight objects and can't hold, for example, a thin-walled ball.

My optodetectors are very wide-angle devices. They pick up a considerable amount of ambient light, even from inside a five-sided box. It would be helpful to use something to narrow their visible angle, such as an LED panel bezel mount. And it would be good to mount them as close together as possible.

The output transistor (2N3055) runs with no noticeable heat generation. You can eliminate the heat sink, and the big 2N3055 could be replaced with a smaller TIP29 device. Or it could be replaced by a JFET device such as an IRF510. The smaller device can be mounted on the circuit board, which would simplify the mounting and wiring requirements.

I used three-quarter inch thick pine wood (for shelving) to build the base and box. It would be lighter and easier to use thinner wood for construction.

Conclusion

This is a great project that generates a lot of interest. Levitators are fun and yet rarely seen -- they just don't seem to exist on the retail market! This project would make a highly unusual science fair display, and illustrates the potential for maglev devices.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download