Old Stuff

Home ] Old Stuff 1 ]

DIY Instrument Tutorials and Tiny Stepping Motors (6 May 2008)

I spent several days writing three introductory tutorials about do-it-yourself instruments. They are posted in the tutorial section of the MyCockpit forums. There is one each for air-core movements, stepping motors, and RC servos. You can read them here, here, and here.

By the way, If you're not familiar with MyCockpit, it's an excellent English language forum dedicated to flight sim cockpit building. Check it out.

As I was developing the tutorials, I was reminded of the challenges of simulating instruments incorporating drum style displays. Some altimeters have a drum display for setting barometric pressure. Some military altimeters use a drum display to indicate hundreds and thousands of feet. Then there are fuel flow indicators, chaff counters, and so on.

Drum displays are essentially the same as mechanical odometers found in older cars. Each digit has a wheel with  0 to 9 printed on the outer edge. Each wheel has gear teeth that allow it to be turned. It's actually a clever mechanical counter that is remarkably simple for what it does. They just never seem to be available in the correct size for simulating instruments, and then there's the whole issue of interfacing their little mechanical selves to the electronics of the rest of the sim.

One simulation approach is to use seven segment displays in place of the drum. Well, okay, yes that works, but it doesn't quite have the same feel, doesn't quite produce the same type of experience. If you're going to put that much effort into simulating, say, a military altimeter, you want it to look like the real thing, right?

Or, maybe this is just an intriguing problem calling out to be solved. 

In any case, I've been toying with various ideas for some time. Here's where I'm at now. The basic idea is to build an inside-out variable-reluctance stepping motor for each digit. Most stepping motors use a permanent magnet rotor to deliver high torque. In this application torque isn't the problem, it's size and construction simplicity. "Variable-reluctance" in motor-speak just means not having a magnet in the rotor. The inside-out construction is widely used in hard drives, so it's a proven approach.

The whole motor is about an inch across, and maybe a quarter inch thick. There's not a lot of room inside. Fortunately, there isn't much in there. There's a mild steel stator that supports eight windings that make up the four motor phase windings. There's (hopefully) room for a reflective optical sensor for detecting the index mark on the rotor. The stator can be cut down from a standard flat steel washer. The rotor is thin gauge mild steel with ten equally spaced tabs around the edge. The tabs are bend upward and epoxied to a thin brass ring. The rotor turns on a short length of brass tubing epoxied to its center.

 

While the variable-reluctance rotor is easier to make than a permanent magnet rotor, it does require a more complex stator. With a permanent magnet rotor each stator winding does double duty. Because a winding can both attract and repel a magnet by reversing the current through the winding, a permanent magnet motor can get by with only two windings. Because a winding in a variable-reluctance motor can only attract the non-magnetized steel in the rotor, the V-R stepping motor needs four windings.

It operates like this:

With current going through the phase 1 windings, the rotor has a set of tabs lined up with the phase 1 stator poles. The phase 2 stator poles are half-way lined up with the adjacent rotor tabs.

When the current though phase 1 is turned off and current through phase 2 is turned on, the rotor turns counter-clockwise to align those tabs with the phase 2 stator poles. The phase 3 poles are now half-way aligned with a set of rotor tabs.

Shifting the current from phase 2 to phase 3 results in another step counter-clockwise, and setting the stage for the next step by partially aligning the phase 4 poles with another set of tabs.

When current shifts from phase 3 to phase 4, the motor steps again. At this point the rotor is positioned so that the phase 1 stator poles are partially aligned with a tab.

Shifting the current from Phase 4 to phase 1 brings a tab back into alignment with the phase 1 stator pole. The motor has taken four 9-degree steps for a total rotation of 36 degrees, or just enough to position the rotor to display the next digit printed on the outer surface of the rotor.

 

Yet Even More Air-Core Movement Hand Waving (27 April 2008)

It seems to work.

I completed a prototype movement with 1,000 turns of 38 gauge wire on each of the two windings. The rotor responds very quickly to 50 milliamps. I'm not sure if I'm seeing any problem due to shield remanence. If it's there, it's small. I'll need to put a longer pointer on the shaft to tell for sure. If there is a problem, an easy fix is to increase the diameter of the shield.

The shield used in this prototype is a 1-1/2" length of nominal 1" diameter thin wall electrical conduit ("EMT"). I try to use commonly available materials in my projects. EMT is sold at most home building supply stores. Galvanized steel fence post offers a slightly larger shield possibility. The smaller fence post material has a nominal diameter of 1-5/8", and is also commonly available.

There's more information about air-core movements on the Air-Core page.

 

Yet More Air-Core Movement Hand Waving (24 April 2008)

One thing I noticed with the larger (10 mm) air-core rotor magnet is a larger degree of eddy-current damping. When a magnet moves next to a conductive material, it induces electrical currents into that material. The currents generate magnetic fields which oppose the field of the magnet. If you have a (diametrically magnetized) cylindrical magnet rotating in a conductive tube, the induced currents and resulting fields act to oppose the rotation. The faster the rotation, the larger the opposing force. 

This is a good thing.

If you have a gauge with low friction bearings and provide an abrupt change in the pointer position, the pointer will oscillate around the new position before settling down. This is annoying. To stop the bouncing, it's nice to have a force that opposes the motion and is larger as the motion is larger. Exactly what eddy-current damping does.

So, I decided to work more with the larger rotor magnets rather than with the smaller. The advantage of the smaller magnets is that the smaller fields would reduce the inaccuracy due to remanence problems with the shield. (see the 17 April section.) Since I'm using a large magnet, I'll use a larger shield to address the remanence issue.

The first shield was a short length of  1" nominal mild steel tubing. It actually turned out to have an innner diameter of 0.89". For the new shield, I'll use 1" thin wall electrical tubing. This has an ID of 1.05". I'm hoping that will make enough of a difference. If not, I'll just try something larger.

These new experiments use a metal on metal bushing rather than a metal on plastic bushing I started with. I'm trying a steel shaft rotating in a bit of brass tubing. I'm also only using one bushing in the new movements. The older movement had a plastic bushing at each end of the housing. The new movement does away with the rear bushing and simply lets the rounded end of the shaft rotate against the flat end of a brass plug.

I'm trying two types of material for the shaft. The first is 0.031" diameter stainless steel spring wire. The second is a #7 basting sewing needle. The needle is nickel plated steel about 0.027" in diameter. Its surface is smoother than the spring wire, plus, it's easier to find. I'd prefer a larger diameter, but the smoother surface results in slightly lower friction.

I'm also trying a different construction technique. The brass tubing that acts as the bushing is epoxied into the movement body. I made an alignment tool (the brass item at the bottom of the picture) that holds the bushing while the epoxy sets up. This makes a huge difference in the time required to build a movement.

Air-Core Movement Experimenting (21 April 2008)

The air-core movement pictured below produces quite a lot of torque, as far as air-core movements go. This is primarily due to a very strong rotor magnet, a neodymium cylinder 5 millimeters in diameter by 10 millimeters long. The downside is that this magnet is strong enough to slightly magnetize the shield. This leads to a small, but measurable positioning error.

For this version, the shield is a piece of nominal 1" diameter mild steel tubing which I annealed with a small propane torch. One possible way to reduce the magnetization is to use a thicker and/or larger diameter shield. Perhaps a short length of 1" or 1-1/4" pipe would work.

What I actually chose to do was to use a smaller magnet. 

I have some 4 mm diameter by 5 mm long cylindrical magnets, so I thought I'd give one of them a try. I'm also used a different construction technique. Rather than making plastic bushings and using stainless steel spring wire for the rotor shaft, I used brass tubing for the bushing and a polished chrome (nickel?) plated sewing needle for the shaft. I made a very rough prototype with only a single winding.

It works quite well. There is less torque due to the smaller magnet, but still enough to swing a balanced pointer. Because I was a little sloppy making this prototype, I need to rework it a bit before I can put the shield in place. So at this point I don't know how well using the smaller magnet reduced the shield magnetization.

Both approaches could do with a bit of refinement; however, I think either could form the basis of single-pointer, steam-gauge style sim instruments.

 

Book Progress and Air-Core Movement Experimenting (17 April 2008)

The joystick chapter has gone through a bit more editing and is sitting right at 34 pages. There are a few things wrong with it that I know of and undoubtedly several more that I don't, but I'm a little too close to it for further editing. I'll let it set for a while and come back later. 

I had expected to go into building mode and construct the third (and hopefully final) prototype of the chapter project (a floor mounted joystick). However, I've gotten several emails from different people about air-core movements. Because of their interest and because I have been collecting material to do so, I decided, instead, to  prototype an updated, new and improved, super deluxe, DIY air-core movement.

This air-core movement uses a cylindrical rare earth magnet for the rotor. Because this magnet has an axial hole, it's really easy to make the rotor. For the shaft, I used a length of stainless steel spring wire. It's not quite as smooth as some of the other material I've pressed into service, but it seems to work well, and it's a stock product. Here's what I ended up with just before beginning to add the windings:

After adding the test windings:

And after sliding it into a 1 inch diameter magnetic shield:

 

To be expedient, I only used 100 turns for each winding. On the finished product, I would expect to use somewhere around 1,000. As a result the sensitivity is only about a tenth of what it should be. That's okay. This is only a test prototype. I simply push ten times the current through the windings during testing. It's a heck of a lot easier to put 100 turns of relatively heavy wire on the assembly than 1,000 of really fragile, fine gauge wire.

The test performance is quite nice. Put current through the windings and the rotor zips to a new position. 

The next step is to test for repeatability. A problem with air-core movements is that the rotor magnet can magnetize the shield. It's not a huge amount of magnetization, but it can be enough to screw up the accuracy. You minimize this by making the shield diameter large enough that it doesn't see much rotor flux, by making the shield thick enough that what flux does reach it is "diluted" in that thickness, and by using a shield material with low remanence. 

Remanence is the tendency of a material to stay magnetized after being exposed to a magnetic field. Lots of materials have low or zero remanence, glass for example. Unfortunately, the vast majority of them suck at being a magnetic shield. The trick is finding a material that can shield without becoming magnetized itself. 

Actually, that's not quite right. The REAL trick is finding an affordable material that can shield without becoming magnetized. Iron alloys with high nickel content (Mu-Metal, etc.) do a pretty good job. The problem is one of availability to hobbyists at reasonable cost. 

So, the approach I've taken is to use annealed mild steel tubing with a relatively large diameter and medium thick wall. It has "low" remanence, and shields well enough, but I don't know how bad the remanence problem will be.  So I will have to test for it.

 

Book Progress (8 April 2008)

The Joysticks chapter is mostly complete. At 34~35 pages, it's about 10 pages longer than expected. I added more illustrations than I had anticipated. Next step is to build another project prototype using the directions from the draft. I'm sure this will lead to a number of tweaks.

Oh, I also scanned the book 2 page while thumbing through the manuscript. The book 2 page now accurately reflects progress to date on the book.

 

Book Progress and Air-Core Movement Thoughts (31March 2008)

I have a fairly rough pass though the project portion of the joystick chapter. I dumped a lot of words down and left placeholders for illustrations. Then I went into TurboCAD and started drawing. As the illustrations came together, the word dump began to look a bit, well, dumpy. So now it's time to go back into wordsmith mode and make things a bit less so. When I go through the text I'm sure I'll find places where the illustrations don't quite convey all that's needed, so I'll end up back in drawing mode. Hopefully the process will converge.

Since book 1, (Building Simulated Aircraft Instrumentation), came out, there has been a surge of retail sources for magnets of all shapes and sizes. Of particular interest are cylindrical magnets that are magnetized through the diameter rather than through the length. And of extra special interest are those cylindrical magnets that have an axial hole. Magnets of this sort lead to thoughts of rotors for air-core movements. I haven't had a chance to build a prototype, but I think you could make an air-core movement something like this:

 

The gold cylinder is a neodymium magnet from The Super Magnet Man.  I'm confident this will work, thought there is a question about the overall dimensions. The neodymium magnet is extremely powerful and may partially magnetize the shield, the outer gray cylinder. Magnetizing the shield leads to positioning error, so it needs to be minimized. You do this by making the shield thicker and larger in diameter, as well as, choosing the right material. Well, the best material costs too much, so the old standby, annealed mild steel will have to do. I'll make a SWAG of 1" OD mild steel tubing with 0.050" wall thickness as a starting point. 

A Bit of Book Progress (7 March 2008)

Believe it or not, this is actually the heart of a low-cost uber-quality floor-mounted joystick. It's the project for the first chapter. Most materials are sourced from Home Depot (a local big-box building supply store).

I'll be using a pair of the Bourns 6639 potentiometers for position sensors. The more I fondle it rigorously test the Bourns pot, the more I like it. It has tight mechanical specs and requires little torque. I expect the completed project to be very responsive.

 

The Ultimate Potentiometer? (6 March 2008)

When I build project prototypes I typically dig through piles of stuff in my garage looking for materials. Collected over years of attending California swap meets, this stuff will  eventually cause my executor great heartburn, though hopefully many years from now. The problem is that using this stuff occasionally causes me heartburn in the here and now. 

Once the prototype has proven the concept, I have to document the project. I can't make a parts list full of obsolete mil-spec parts from my garage. I have to list parts that you can actually buy without going broke. Sometimes this is hard to do.

As I am working though the Nth version of the project for the Joystick chapter, I have to come up with a suitable potentiometer part number. You're probably aware that most moderately priced pots are crap not up to the challenge of being used in a flight sim joystick. They wear out too soon.

I've written about pots in general to give readers the background needed to make an informed choice. (Here, for example.) However, when writing a book, and especially when describing a specific project, it's a really, really good idea to refer to a specific part number. So, I was very pleased to come across the Bourns model 6639 series of potentiometers. (Bourns 6539/6639 spec sheet.)

This has a no-load rotational lifetime spec of 10,000,000 rotations. "No load" means not putting significant lateral or end-loading forces on the shaft, just carefully turning it. For comparison, a standard, hobby-quality pot will have a lifetime of 30,000 to 50,000 rotations.

The Bourns pot isn't exactly cheap at US$11.40, but I think it hits a sweet spot: excellent performance at a price that only makes you wince rather than scream. Precision pots with good lifetime specs mostly start out with a US$20~30 price tag.

This pot is stocked by Mouser and Digikey.

 

Income Tax (7 Feb 2008)

Arrrrgggggh!

Joystick Chapter Progress (5 Feb 2008)

I have a pretty good draft of the text portion of the joystick chapter. Next step is to write the project directions and draw the project illustrations. I've already designed and built two prototypes of the project, but by the time I finish with the drawings I will have made changes. So I'll end up building a third prototype to verify the instructions in the chapter.

This is just a bit of doodling to illustrate the point that joysticks have evolved.

 

Playing with Illustrations (1 Feb 2008)

This is an intermediate step along the way to developing a drawing that shows the key principles of electric control loading. The final drawing for use in the book will a black & white line drawing, but it's fun to turn on the colors and 3D modeling along the way.

Writing and Drawing (30 Jan 2008)

Laid down a fair amount of text and started the illustrations for the Joystick chapter.  It's starting to come together. My original thought was that there wasn't really all that much to say. Joysticks are such an integral part of computer game play that there are many choices for off the shelf sticks. Why waste time building a joystick for your sim when you can just buy something and move on to projects that don't have a good purchase alternative? I thought the joystick chapter would be a soft introduction to the book and the home built flight sim hobby. I was wrong.

Turns out that how much effort you put into a joystick depends on what aircraft you want to simulate and the fidelity you're looking for. If you happen to be building an F-16 sim, the cougar's pretty much the stick of choice. But, even it can be improved. Out of the box, the cougar is a motion activated stick. The F-16 side stick controller is a force activated flight control. If you want a really good F-16 sim, start with the stock cougar. If you want an outstanding F-16 sim, finish up with a force sensing mod to a cougar. But, if you're not building an F-16 sim, life gets more interesting.

If you're looking for "okay" simming of A/C with sticks, there are fair choices on the market. Buy one and get on to building an instrument panel or a set of pedals. Moving beyond the just "okay" requires more effort. You need to do some research. What does the real stick do? Will your simulation application support those functions? Can you add the missing functionality? Is it worth it to you? What does the real stick feel like? What does it look like? And so on, and so on.

So the joystick chapter will contribute more than I originally expected. It's still an introduction to the book and to the hobby, but it's also a guide to boosting the flight sim experience by doing the joystick right.

 

Writing, for real (27 Jan 2008)

I've actually been able to spend some time putting together new words rather than editing old words in Book 2. I'm working on the first chapter which covers joysticks. I'm not sure this should be the topic for the first chapter, but certainly I need to cover joysticks somewhere. 

Maybe the first chapter should cover the overall approach to building a simulator. No, not enough material to justify a  complete chapter. If I turn it into a full chapter, it'll be too philosophical and no one will read it. The overview fits best in the Introduction. Oh, but, nobody reads the introduction either. Oh crap, I think I'll just go back to writing about joysticks.

 

Using Real Instruments chapter updates (22 January 2008)

I've updated the Using Real Instruments chapter that contains the DTS project. I'm sure there's room (and need) for a few red editorial marks, but for the time being, it's looking pretty good.

 

DTS v2.0 & Free Programming Resources (20 January 2008)

The revised version of the Digital-to-Synchro converter is together and is apparently working. (No smoke, anyway.) I'll do a little more testing, but I don't expect problems. 

Each version of each project suggests a follow on version. This project uses linear power amps to buffer the synchro output voltages. These amps require a bulky heatsink. So, this gets me thinking, what if I used switching ("class D") amps instead? Might be able to do without a heatsink, or maybe just a little one. Then I remember, I've got a few thousand other things I need to do too. Sigh! Gotta stop somewhere.

*****

Programming skills are extremely useful. Being able to write fairly simple programs and interface them with other sim applications can gain you admittance to the pantheon of sim greats. 

An overstatement?

No.

If you have no programming skills, you're at the mercy of those who do. You use applications as they are out of the box. If the applications do what you need them to do, that's great. If not, well... suck it up, buddy.

On the other hand, if you do have a bit of programming knowledge, people smile when you enter the room. They're polite. And, best of all, you can add to your sim setup so it does what you want it to do.

Surprisingly, you don't have to be a real wizard. You're not building life critical systems for international deployment on multiple hardware and software platforms. You're building a application or two to run on your computer for your own amusement. All you need to be is a moderately successful amateur.

Many tools and tutorials are free. Since I focus mostly on Microsoft Flight Simulator, I'm going to point to a couple of MS resources.

First of all, you can get a compiler and development environment for free from MS. You can go with Visual C++, Visual C# and/or Visual Basic. I recommend VC++ as it's easiest to use when interfacing with MSFSX. You can use C# and Basic as well, but you'll have a couple of additional hurdles to jump. You can download the express edition of MS Visual C++ here: http://www.microsoft.com/express/vc/ 

MS also offers several tutorials on using VC++. For starters, There's the "Introduction to Visual C++ 2008 Express Edition" here: http://msdn2.microsoft.com/en-us/beginner/bb964629.aspx 

There's actually an entire learning center here: http://msdn2.microsoft.com/en-us/beginner/default.aspx 

"Coding 4 Fun" is a Microsoft hosted blog (http://blogs.msdn.com/coding4fun ) where non-MS software types post tutorials. Of particular interest is the series, "Beginning Game Development" by Derek Pierson. It provides a nice introduction to DirectX. DirectX is the Microsoft API (application programming interface) for game development. Basically, it gives you the means to create complex dynamic imagery, to interface with the sound card, and to connect with the keyboard and mouse.

Finally, don't forget that SimConnect, the API into MSFSX, is documented in the SimConnect SDK which ships on the installation DVD of the deluxe edition of Flight Simulator X.

 

DTS v2.0 & An Interesting New Book (29 December 2007)

I'm well on the way to building a prototype of a revised Digital-To-Synchro converter. The parts cost has dropped by roughly $30, the resolution has increased slightly to 13 bits, and the data connectors have been added to the board. I've stayed with a single sided board layout even though it requires several jumpers. The single sided layout can be built easily with DIY printed circuit board kits. It's easy enough to use the single sided artwork as a starting point for a double sided board should some enterprising individual wish to employ the services of a commercial board house.

I still have a bit more soldering to complete the prototype. I'll leave off the power amps for the initial testing. Most of the testing is in verifying the computer to DTS communication and proper functioning of the micro controller code and associated scaling circuitry. Once that's working, the power amps are just a bit of icing on the cake. Of course, before I can do that, I have to revise the micro controller code as well as the host driver code.

 

I limit the number of technical books I buy these days. It's too easy to get sucked into long, dark side alleys for weeks at a time. Besides, after years and years of not limiting my purchases, room to put the damn things is at a premium.  Nonetheless, this one caught my eye, and somehow it magically appeared on my desk. 

I haven't taken the time to more than leaf though it, but I'm impressed with the progressive approach the author has taken in developing this tutorial. 

DTS Revisited (22 December 2007)

It's looking more and more like a DTS revision is a worthwhile idea even though it means a significant reworking of a "completed" chapter. I ordered a couple of LTC1590 12 bit MDACs directly from the manufacturer using their prototyping quantities ordering service. The parts came yesterday. On the plus side, one $7.50 part replaces two $17~22 parts, and a few circuit mods allow me to improve performance as well. On the down side this requires a new circuit board layout, new firmware, new host software, building another prototype, and new chapter text describing circuit operation.

(The DTS or "Digital To Synchro" project is a key system component needed to use some sorts of real aircraft instruments in a flight simulator.)

 

DTS Revisited (12 December 2007)

A trend in electronics is the continuing reduction in the size of parts. This trend means hours of audio can be stuffed into an MP3 player smaller than a box of matches. It also means that we older flight sim hobbyists with our somewhat less than perfect eye sight and maybe just a little bit oversized fingers face a real challenge when it comes to building DIY electronics. Those surface mount components are tiny!

I design the projects for the upcoming book 2 with ease of construction in mind. One problem is that electronics parts are increasingly available only in super teenie weenie surface mount packages. This restricts what I can choose for parts. So far I've been reasonably successful in selecting parts that can be seen with the naked eye. 

Unfortunately, one of the key parts used in the DTS (digital to synchro) project has seen its price almost triple since I prototyped it. I'm concerned this may mean the part is in short supply. I don't want to publish the book then find no one can build the project because the parts are too expensive or just plain not available.

I've found an alternate part which is a dual version of the original part. This is good as the DTS uses two of the original part. The alternate costs less, can be ordered directly from the manufacturer(!) in small quantities, and is available in a standard 16 pin plastic DIP package. Further more, it's also available in a surface mount package with the same pin out. This means that if the big package is discontinued, there is at least a possibility of using the surface mount package with an adapter on the PC board designed for the large package.

So, that's what I'm doing right now: revisiting the DTS project and deciding if a re-design should be done.

 

Back from FanCon (19 November 2007)

Well, I'm back from Seattle and the 2007 AVSIM FanCon flight simulation convention. Nice to put a faces to a few names. My presentation went reasonably well. Attendance was fair considering it was the first slot Sunday morning; the peak crowds come on Saturday. Anyhow, I had a nice little crowd of friendly listeners who posed some good questions.

I seem to vaguely remember I was writing a book on flight simulation. Guess I'll dig around on my desk and see if I can find anything resembling a manuscript.

AVSIM FanCon Presentation, Odds & Ends (17 October 2007)

At least a few of the house projects are done; we finished the rain gutters literally minutes before the rain began. College has cranked up again so the house is a bit quieter. I'm slowly getting back into the flight sim world.

Mostly, that means finalizing the presentation I'll be giving at AVSIM FanCon 2007. There are a few pictures that could be improved, but it's pretty much there. The handout is in draft form, need to add a bit more detail.

And then... back to the book.

Still Working on the House (31 August 2007)

For the most part I'm still in maintenance mode, cleaning up old house projects and tweaking the web site. Giving some thought as to where to begin when I can again focus on the book.

Not Much Sim-Wise (10 August 2007)

Well, the first major house project is just about complete. A few pieces of trim and some paint should wrap it up, then on to the next.

 

Go to Old Stuff 1 for previous rants.

 

It's possible that I'm not as smart as I think I am. (Occasionally, I have moments when I know this to be true. Fortunately the feeling passes quickly.) Although I have tried to make this information as accurate as I can, it is not only possible, but also quite likely, that errors lurk within. I cannot and do not warrant these pages to be error free and correct. Further I accept no liability for the use of this information (or misinformation). If, after reading this, you are still interested, please be aware that the contents of this site are protected by copyright (copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008 by John M. Powell). Nonetheless, you may copy this material subject to these three conditions: (1) the copyright notice is copied and presented along with the material, (2) the copy is used for non-commercial purposes, and (3) the source of the material is properly credited. And of course, you may link to this page.