Wednesday, May 16, 2012

Beginning design of the transponder

I'm currently working on the transponder for the radio stack.  I'm going to focus on parts for the new flightsim, a Beechcraft Baron.  For the radio stack, this includes the transponder and the nav/com radios.  Here are some renderings of the faceplate of the transponder.  the big square hole will house 4 7-seg digits with one rotary encoder under each to tune the digit.  the slightly larger hole to the left will house an LED to act as the IDENT light.  the hole under that will house a small tactile switch to send a ping (or whatever you call that).  All the way to the left is a big hole that will house a 5 position rotary switch to set the transponder between off, standby, ground, on and test.  X-Plane doesn't have a ground mode simulated the last time I checked, but just in case, I can add the feature later.  This will be loosely based on the Bendix King KT76A.



I still have to tweak the spacing so I can fit the rotary encoders under the digits and I need to make sure the board that will hold the digits/rotary encoders doesn't hit the board that will house the IDENT light and switch.   I would make them all fit on one board but that would make the pcb larger than the free version of my pcb software will allow so I'm cheating a bit.

Tuesday, March 15, 2011

CNC Tabletop Enhancements

One of the less obvious aspects of using a milling machine is holding down the workpiece.  There are plenty of different ways, each with their pros and cons.  For instance, you could use a vacuum top which literally sucks the workpiece to it, or just tape the piece down.  The method I use is a grid of threaded 1/4 holes.


When I first started milling, I put the workpiece right up against a bolt with a washer attached then tightened down the bolt which caused the washer to hold down the piece.  This works, but it tends to bow the piece a bit since it's clamping right on the edge and it forces you to use a workpiece of a set size to get it near the holes or you have to twist the piece which generally wastes space when you're cutting out square stuff.  I went exploring to my local Rockler store and purchased some hold down clamps which give you a greater radius from the threaded hole to hold the piece down and allows you to hold the piece away from the edge.  This has worked pretty well for quite some time but I recently ran into a limitation due to the way I created the grid of threaded holes.

To create the holes I used the CNC machine itself.  This means each hole is within the cutting area of the machine (the 3D volume where the machine can guide the tool).  This limits your hold down ability because there is quite a bit of space outside of the cutting area that you could otherwise use with a clamp.  This means I need to redesign the tabletop to enable clamping outside of the cutting area.  I could just fire some more holes into those untapped areas (pun!) but I've grown tired of the limitations of the threaded hole system.  The holes are tapped MDF which tends to deform with use and with changes in humidity so some holes are really tight, others hardly hold at all.  It's also takes a long time to reposition a clamp to a new hole.  Not a deal breaker, but annoying.  There's also the risk of using a screw that's too long which can extend too far past the bottom of the table and hit the gantry as it moves up and down the X-axis.  Thankfully there's a better alternative.

During the aforementioned trip to Rockler, I took a look at their CNC machine called the CNC Shark.  It's a pretty slick setup but what I most enjoyed was the hold down system.  Rockler makes a product called the Universal T-Track which is a metal track that you can secure hold downs.  It accepts a few standard bolt sizes as well as the bolts that came with my other hold down clamps.  The benefits are numerous.  No more fiddling with allen wrenches to adjust the hold downs, easy repositioning and no risk in hitting the gantry under the table.

My initial plan was to take off the top board of the table (it's currently 2*3/4" MDF boards) and replace it with another 3/4" MDF board with slots cut in it for the T-Tracks.  This would require me to buy a 3/4" routing bit and to remove the router from the CNC machine, neither of which I want to do.  I happened to read a post while searching for information about the T-Tracks where someone suggested mounting the track to a 3/4" MDF board and then putting 1/2" MDF boards between the tracks.  The end result would be the same and I'd be able to replace just the top boards if they get messed up for whatever reason.  This is ideal since it can be done with tools that I already have.

So I fired up my solid modeler of choice and came up with the following.


I've elicited the help of a coworker with a table saw to cut the top pieces precisely.  In the mean time I took apart the current table to get measurements and to show the construction.


Here we see the lower of the two slabs of MDF that make up the old table top.  You can see the heads of the 4 bolts that hold the table down to the machine's frame and the grid of threaded holes that are also in the top piece.  On the sides I attached some angled steel to keep the MDF straight.  This actually works really well as the MDF was ever so slightly bent before the addition.  In the next shot, we see the machine without a table.


This gives a great view of how the machine works.  Without the table you can see the rails for the X-axis and the anti-backlash nut that rides on the threaded rod which moves the X-axis.

Now I need to construct the bottom MDF piece of the new table so I'm ready to throw everything together when the top pieces arrive.

Wednesday, February 2, 2011

Rackmount under my desk

X-Plane does multi-monitor support differently than most computer games.  It doesn't support displaying the viewport on more than one monitor per machine which is certainly a weakness.  What it does support, however, is the ability to network multiple computers together, each with its own monitor.  the benefits are two fold.  First, you can custom build multiple machines of differing speeds to cater to what is being displayed.  side views can be a bit slower or less detailed if you like, while the main viewport is very fast and detailed due to a powerful machine.  Second, if a single computer is displaying on multiple monitors, it's usually through OpenGL or DirectX.  These technologies assume the monitors are in a single plane.  You can see more monitor if it's tilted toward you (think of being surrounded by monitors) but in most games the horizon would be slanted down on the sides.  X-Plane lets you configure exactly where a monitor is from a center point so no matter how the monitor is positioned, it still displays a view that makes sense (no funky horizon lines or anything).  You can customize offset angle left/right, up/down as well as the vertical and horizontal field of view.

I plan on having 3 monitors arranged like 3 sides of a hexagon in front of me.  This will provide a great field of view and will drastically increase the realism.  The problem to tackle is how to fit all 3 machines in my cluttered workspace.  The answer: Rackmount!

Back in the day I rackmounted my server in a little IKEA rolly-polly shelf so I have a rackmount case as well as a rackmount power conditioner/distributor.  The server has since been moved to a small nook next to a closet and was sitting on its side.  I basically had a rackmount case being used as a normal pedestal case.  I recently purchased a new main desktop and took the opportunity to take the server's guts out of its rackmount case and put it in the newly vacated desktop case.  I then installed the new desktop, which I'll use for X-Plane, in the rackmount case.

I purchased a pair of 16U rackmount rails from eBay and mounted one (with drywall screws since IKEA furniture is apparently mostly hollow) to one side of my Michael IKEA desk.  The other I installed on a piece of plywood that I cut to size (with my awesome new jigsaw, thanks dad) and painted black.  The plywood is not secured to anything but the units that are screwed into the rackmount so if I remove everything, it would just fall.  Since I'll probably have at least one thing in there at all times, this won't be an issue.

Here are some pics of the setup (pardon the mess).  The bottom 4U is my main desktop, the two 4U cases above it were purchased on sale and are empty right now but will eventually be filled with the hardware for the two side views.  The 1U above that is a shelf for holding a switch and a router that connects the machines to the rest of the network.  the next 2U are empty leaving the top 1U for my Furman power conditioner and power distributor.



Thursday, December 16, 2010

Tearing apart a brand new LCD monitor

The next component of the flight simulator I'm going to work on is the main gauges.  The gauges will be the largest part of the cockpit and will give me something to build off of. One way to do this is with hardware gauges from the likes of SimKits.  These look great and work wonderfully, but each one is very expensive and they all require a back plane to connect to.  I'm going the cheaper route that will maintain full functionality but reduce cost considerably.  I'll be using an LCD monitor with an MDF board over the front with 3" holes cut in it for the gauges.  The monitor will be driven by a low power, low cost computer that will just display the gauges.  I will also have rotary encoders embedded in the MDF to act as the adjustment dials on the instruments.  The result will look like a normal cockpit but with a bunch of little LCD screens for the gauges.  I've already done a proof of concept with X-Plane 9 and was able to very easily create a custom cockpit that displays only a black screen and the 6 gauges I chose.  This was running fairly well on the crappiest hardware money can buy (a netbook) using a plugin to disable drawing of anything but the cockpit.

I considered my desk size as well as the size the cockpit will eventually be and decided a 17" widescreen display would suite my needs.  I took the plunge and purchased two screens (one for dad, of course).  Upon their arrival I immediately set out to remove all of the extra crap on the screen. All I need is the panel itself so removing the bezel would let me place the screen as close as possible to the MDF front.  This is the first time I've ever taken apart a brand new toy without even plugging it in first.  It felt good.



The first step was the scariest.  This particular LCD screen had no external screws to take it apart.  This meant I had to pry the bezel off.  I first used a small screwdriver but that marred the plastic, so I used an even bigger screwdriver.  That worked.


Once the bezel was loose, I was able to take it most of the way off.  On the bottom right of the bezel the control buttons needed to be unscrewed.  The controls came off as one board.  I'll have to figure out a clever way to incorporate them into the design of the cockpit.


That's about it.  No drama.  The metal bezel around the screen is about 1mm thick, so I'll be able to put the screen right up against the MDF.  It should look nice.  I also uncovered some unused mounting holes on the four corners of the screen.  This will make it simple to mount to the front of the MDF instead of my original idea of mounting the screen via the VESA mount on the rear.

Tuesday, December 14, 2010

Finishing up the Annunciator

I let the paint on the lexan dry for a week and re-milled the front panel. This time, it came out looking much better. I also tweaked the location of the mounting holes slightly to make it easier to line them up with the PCB (my PCB cad software prefers .05" spacing). Here is the piece lit by two LEDs from the back.
My first test lighting used regular off-the-shelf 5mm LEDs, the kind you see in DIY electronics kits.  I was hoping these would work because they don't require too much current.  The goal was to be able to power this project from USB which limits current to 500mA at 5V.  Unfortunately, they weren't bright at all.  This became a major time sink since I not only had to source new LEDs, but also redesign the product for external power.  I ordered an assortment of high output LEDs of differing color and output angle and soldered them onto a test PCB.  This also happened to be my first foray into surface mount soldering.
I picked two of the LEDs from the batch, one red, one amber to use in the project.  They both pulled 100mA at 2V, so I'd need to provide 1.3A at 2V since I'm using 13 separate LEDs.  Not a trivial amount of power!  I first tried using a regular voltage regulator to bring my wall wart power down to 3.3V which the LEDs took with relatively small resistors, but there was so much excess voltage, the regulator became scalding hot within seconds.  That wasn't going to work.  Next up, why not try my hand at switching regulators.  The aforementioned linear voltage regulator drops voltage by converting it to heat, hence, the enormous amount of heat.  A switching regulator instead turns the power on when the voltage is below the desired voltage, then off when it goes above the required voltage.  This extremely fast switching is much more efficient and produces very little heat.  neat!

At this point, I had the circuit design finalized so I began making the PCBs.  I started with the board that would hold the LEDs.


This board is pretty simple.  It has LEDs (the little white things) and the accompanying resistors (little black things) that pull current through the circuit and light the LEDs.  On the rear of the board, I attached a ribbon cable and connector as well as two extra wires that were difficult to etch on the front.

I re-milled the light tunnel that separates each lit section out of 3/4" MDF.  MDF doesn't warp nearly as much as plywood and turned out to be a bit thicker so it lights more evenly.  Here's the light tunnel sandwiched between the LED board and the front panel.

I then milled and put together the main board, which wasn't terribly exciting, just a standard PCB with a few components on it.  The only thing that needed to be done after that was make a bracket to hold the LED board at a right angle with the main board and acquire the hardware to bold everything together.  Here's the final product.

The main board is pretty simple.  In the very back you see the USB connector, a power indication LED, the connector for the TEST/DIM switch, and the power connector (6-12VDC).  Above that we have the main chip, a PIC18F4550.  I chose this chip due to the easy to use package size and the native hardware USB interface.  To the upper left we have a series of resistors which lead to the little black transistors next to where the LED board plugs in.  These control the switching of the LEDs on and off.  In the upper right, we have the switching regulator components.  These components are way overkill for what I'm using them for, but it's what was recommended in the datasheet so I stuck with it.  It's rated for 3A and I'm only using about 1A.  The TIP120 chip controls the switching and only gets mildly warm.  I've since added a small heatsink just in case.

I'll add a video of the Annunciator in action when I get the chance.

Monday, September 27, 2010

Milling parts

To create the illuminated text of the annunciator, I've painted one side of a piece of lexan and then milled the text into the paint.  behind the lexan will be a piece of material to keep the individual LEDs from illuminating their neighboring indicators and then a PCB where the LEDs will be mounted.  behind that I'll somehow attach the rest of the circuit in a sensible way.

Here's the design of the front panel, LED locations and the light fence:

From that I created some toolpaths with Vectric's excellent Cut2D software.  Cut2D also lets you preview the piece being milled.  The side that is being milled is the side with the black paint on it, hence the backwards lettering.  The holes on the side will be used to attach the circuit board as well as attach the annunciator to the panel, once that's built.

Here's the light fence after milling into 1/4" pine:

After painting the lexan I let it dry overnight and milled it the next evening. I wasn't able to secure it to my table as well as I would have liked so mid way through the end mill got to close to the edge of the material and started freaking out. I need to head to rockler and buy some 1/4" tie down thing-a-majigs. In any case, it didn't turn out too bad. I can use this piece for testing.

As you can see, it didn't turn out that bad.  There is quite a bit of chipping from the paint as you can see in this closeup of the back

BUT, it's not that bad.  The paint can says you get full chip resistance after 7 days so I think I'll try again then.  I have an 8 x 6" sheet that I painted.  I may also try painting more layers on another sheet since a bit of light still shines through.  I'm pretty pleased by the initial results though.

Next up, I'll work on the PCB that the LEDs will mount to.

Sunday, September 26, 2010

Annunciator status update

When I first set out to make this annunciator, I wanted to make it look exactly like it does in X-Plane. During development I realized that the X-Plane annunciator does not look or function like the real thing at all. The sim version has 8 indicators: Generator, Battery, Fuel Quantity, Parking Brakes, Oil Pressure, Oil Temperature, Low vacuum and Autopilot disconnect. With the engine stopped and both alternator and battery switches on, only the generator indicator is on. I may not understand what the low vacuum or oil pressure indicators are supposed to mean, but it seems that with no engine running, there shouldn't be any vacuum or oil pressure. I decided to model my annunciator on the real thing. I found a bunch of pictures online of an actual cessna 172 cabin and found it only had a few indicators on it. Here's one such picture showing the bottom row of indicators illuminated: Oil Press, Left and Right Vaccum and Volts. Using this resource on cessna instruments, I was able to discern the top row that indicates low fuel level on both left and right tanks. Thankfully the real annunciator has 8 indicators as well since the left and right indicators just have an L and R light next to the name of the indicator. This means I can use the same hardware as the original design built to mimic the simulator's annunciator. The lights are as follows: L, Low Fuel, R, Oil Press, L, Vac, R, Volts.

My next hurdle after designing the firmware was to drive it correctly. X-Plane does offer some datarefs for the annunciators, but they don't always work correctly. I, instead, read the raw values that the indicator would be concerned about and if that is at a value that would illuminate the indicator, I light it up. I've made sure to check if there is actually bus voltage as well, so that no indicators will light if there isn't any electricity on the bus. Using my method, I can follow the cessna 172 startup checklist to a T! awesome.

Here's a picture of my prototype on a breadboard:


It's a very basic circuit consisting of a PIC18F4550 configured to work as a USB device, the connector for programming it, 2 input buttons that will be connected to a single switch with three modes( test, brt, dim), and output to 8 LEDs.  For the finished product I'll have more LEDs depending on how big the text I'm trying to illuminate is which means I may have to add some transistors.  Once I get the hardware more fleshed out I'll be able to do some tests with lighting.

Stay tuned for the results of my milling adventures to make the front glass and the light fence in back.