Friday, February 13, 2009

Audio over HDMI

Noted here mostly so I can find it later.

I have a Gigabyte motherboard, the GA-G33M-S2H, that I use for a HTPC (home theater pc). It lives under the couch, driving the LCD TV, diskless, quiet, and is generally pretty happy.

I bought it principally because it has on-board video that does HDMI with an intel chipset. The intel graphics chips are pretty well documented and Intel fund development of linux drivers so it was a fairly easy choice at the time.

When I first turned it on about a year ago, the video of HDMI turned up right away. Very easy. 1080P @ 50Hz is very nice.

Alas, the audio didn't work. At the time, there were bugs in the ALSA drivers that prevented the properly detecting the (seperate ATI) chip that handles audio encoding for the HDMI data stream. After mucking around with it for too long, I gave up and ran a DVI cable and an audio cable to the TV instead. Which had it's own mucking around to get 1080P working on a single DVI channel...

Coming back to the present, I had occasion to revisit my MythTV setup, due to the "urgent need" to repaint the wall. This mean the TV cable down briefly, and stirred me to investigate if the audio HDMI is fixed.

Yay! It is, as of ALSA 1.0.17. Which is in Fedora 9 which I upgraded to a while back, so the kernel already knew about the HDMI audio and was ready to use it. Sweeet.

But. There's always a but. Pulseaudio, the apparent audio hub of choice didn't know about it. After poking, peering and prying at the config, it was clear that HAL did know about it, but pulseaudio refused to use more than the first device on any given soundcard.

As the HDMI appears on this motherboard as hw:0,3 (3rd device on card 0), pulseaudio via HAL refused to have any truck with it. This turns out to be a known, very long standing bug in pulseaudio.

My hack solution: Boot the HAL module in pulseaudio out the door, and just hardcode the detection for the device. Which said that it worked, but didn't produce any sound. After even more trawling, it turns out that I needed to unmute the "IEC958" in the ALSA mixer.

And now it all works! HDMI, 1080P and audio over a single cable.

Saturday, February 7, 2009

Tapping ACME nut.

 
 
 


The short story is: I re-tapped the acetal nut for the X axis to an ACME thread.

The longer story involves much pain. :-)

To re-tap the nut to ACME thread involved making an ACME tap. (off-the-shelf ACME taps cost ~ $400 which is a bit much for a one-off). Making an ACME tap seemed very simple: Just cut a piece of thread rod, grind a taper onto it, and then grind an edge. No worries, right?

So being a doofus, I actually did grind the taper, but in a way that involves destroying my finger tips along the way. I made a simple jig with bearings that allow me to rotate the rod against the grinder. The idea was to let the rod spin against the grinder, ensuring that it would be ground evenly and giving an accurate taper.

In practise, the rod spun much too fast, and in reaching out to slow the spinning rod, I found out that rolled ACME thread has fine burs along the thread edges. Some of them relatively large. As I can measure by the many fine cuts in my finger tips....

I started grinding an edge on the rod as well, but I really need a diamond cup grinder to do the postive rake. After mulling it over, I slapped myself upside the head, and just milled the edge onto it. The ACME rod I have isn't ground, nor hardened, so milling it is fine. I just used a carbide boring tool to cut the postive rake.

Once I'd actually managed to wake to using the mill, it all went fairly fast; Just cut the edge, polish it up a bit with the diamond lap, then bung it on the lathe and it's done.

Well, almost. The amount of plastic being removed is fairly large and the taper on the acme isn't as shallow as it should be, so machine tapping it mostly out. I used lathe power to get the tap started, but then using a spanner to turn the nut by hand to cut the thread.

The end result is fairly good. It's a relatively loose fit, so I'll need to add an anti-backlash nut at some point, but the tap itself worked well.

Thursday, February 5, 2009

Bearing mounts





Last night I made the two new bearing mounts. These are brackets that hold the angular contact bearings for the ACME rod. The task was to bore a 16mm hole for the rod, and then a blind 30mm hole for the bearing. The 16mm through hole had no real accuracy considerations, but the 30mm needed to be 29.99mm so as to ensure that the 30.00mm bearing were a press fit.

I had originally planned to do this using the boring bar, but on reflection realized that that would make it difficult to do the accurate flat base required to support the bearing.

So I got out the rotary table. Now normally the rotary table is a pain in the butt to use. Partly because it's difficult to clamp things on my relatively small table, but mostly because I'm terribly slow at indicating the part to be aligned with the table center. I'm just awful; it normally takes me more than an hour to get terrible accuracy. And thus I avoid it like the plague.

My brain wave was to use the lathe to made a trivial jig; The table has a 17.50mm hole in the center, and my part already had a milled 16mm hole in the center. So I made a piece of delrin (plastic) that was just a short section of 17.5mm dia, stepping down to 16mm dia.

A few taps with the mallet inserted it into the table, and then the blanks were a press fit onto the 16mm section. Instant alignment. Yay!

Even better, this made clamping much easier as I just needed to clamp at one point. Much win all around.

Actually milling the blind 30mm hole was then pretty simple. Just offset a 12mm end mill 8.950mm from the center, mill 5mm into the blank, and run the table around a full 360 degrees. Easy.

The slow bit was getting the hole to be a solid press fit for the bearings, and 29.950mm is much too small. So I increased the hole size in 10 micron increment thru to 29.990. At which point the bearings went in with about 200 newtons of force. Perfect!

I think this is some of the more accurate milling I've done. I'm pretty happy with how it turned out.

Sunday, February 1, 2009

Bearing jig



Dichro milled this up from a scrap piece of aluminium bar. 10x50mm flat bar, drilled with 16mm hole, then added 4 x 7mm holes on a 25x25mm square. M6 bolts, some washers, some skate bearing.

Ta-dah!

Worked extremely well. Should have done it sooner :)

Maching ACME threaded rod


ACME threaded rod, cut to 1150mm long, first end machined.

The 0.5 inch ACME was turned down to 10mm to match the inner diameter of the bearing. It was then threaded to M10 for ~ 30mm to allow for the lock nuts to go on, and then turned down to 4.75mm for the last 10mm to match the coupling for the motor shaft.

The metal was a serious pain to machine. Owing to the length (> 1 meter) I was running the lathe at fairly low speed. The steel work hardened VERY easily, and it's very flexible steel. This meant that it was just as easily bent away from the lathe cutting tool as cut. And it was threaded to boot, which mean highly variable loads on the initial cuts...

I ended up using the live center to attempt to hold it in place which improved matters a little, but not much.

Eventually, I used a handful of skate bearing to make up a jig to support the other end, which let me run the lathe much faster, which made the whole thing easier to do. I was initially turning it at 220 rpm with HSS cutting tool. Running it at ~ 480 rpm was dramatically easier.

The threading was done with a 60degree lathe tool, mounted upside down, with the lathe running backwards. I threaded it in until it "looked done", and then cleaned up by running an M10 x 1.5 die over it. Worked very nicely as I didn't need to try to fight workhardening steel with the die getting an initial thread.

Now to make the bearing brackets...

Saturday, January 31, 2009

ACME threaded rod.

I bought it from

Bomond Trading Co Pty Ltd
49 Orchard Rd, Brookvale, NSW 2100
p: (02) 99391344


1/2 inch (12.7mm) ACME threaded rod (aka leadscrew), 10 tpi (10 turns per inch). This is rolled rather than ground so it's less accurate.

The chap at Bomond was very helpful; I phone up on thursday, he said it was a speciality item, but he could get next day. I went this on saturday (this morning), and picked it up. The length of leadscrew and a handful of M10 nuts was under $AUD100 so I was pretty happy. It was the closet place in Sydney I could find to supply it. There's a number of other places I'd found, but they were a long drive away.

The only fly in the ointment was that I was expecting it to be a 3 meter length, but it was actually 12 foot. For some mad reason I'd heard "12 foot" and mentally translated that to "about 3 meters". Of course, it's actually about 3.7 meters, which is longer than will fit in the car.

Bomond didn't have cutting facilities, but I was on my way to Edcon Steel to pick up some aluminium flat bar, so I just left it poking out of the boot of the car a bit while I drove around the corner and asked the chap at Edcon to snip 1150mm off one end for me. Nice and easy.

Wednesday, January 28, 2009

Stepper motors

The stepper motors I have are Linengineering 4118S-62-07 motors. They were a surplus item, so unfortunately the datasheet doesn't seem to be a very common.

My motors are rated for 2.5A per phase, and a resistance of ~1 ohm is cited in a catalogue with a ~3.6Kg-cm torque.

Looking at http://www.linengineering.com/site/products/4118.html and extrapolating a bit, my motor would be something like the 4118S-04V, or having approx the same torque the 4118S-04P does, just at twice the rpm.

So when I'm running my mill at 2000mm/sec on a 1.25mm pitch, that's about 26 revs/sec. Which would be something like 1600g-cm of torque from my wild guessing and eyeballing the graph. Which, frankly, isn't too bad at all at all!

If I get this ACME at 10tpi (or 2.54mm pitch), I should be able to run a similar speed, but at 13 revs/sec and ~ 2200g-cm of torque. When is very reasonable indeed. Ok, I'm sold.

Now I'm off to buy some 3 meters of ACME threaded rod.

Tuesday, January 27, 2009

Simple image to g-code converter


I did a tiny little bit of tidy up and uploaded my trivial C program to http://code.google.com/p/imagecarve/

The program simply translates images to G-code. It does nothing else. It assumes that you're capable of editing the resulting G-code to make it usable on your machine, and that you can add minor things to the g-code like feed rates et al.

It's pretty raw. It assumes many things, including that you have a ballnose cutter and that the input is always correctly formatted PGM.

The line I used to generate the (upside down) image from the pic above is:

cat ../IMG_545.JPG | jpegtopnm | ppmtopgm |
./imagecarve --scale=0.25 --toolsize=3.2 --stepover=1.5 > out.g

followed by hand editing of the resulting 'out.g' file to set a feed rate.

Monday, January 26, 2009

Yay! First cut!


After a lot of preperation the mini-mill is cutting foam again! Pic shows a little test cut from semi hand-rolled G-code. It was done with a 3.2mm ball-nose endmill, using a 2mm stepover and running at ~ 400mm/minute feed rate.

Frankly, the biggest thing it showed was that I feel the need for speed! It could easily have cut at > 1000mm/minute given the fairly shallow cuts being taken. My steppers are pretty tiny, and the threaded rod I'm using is only a 1.25mm pitch so it's spinning pretty fast to reach the 600mm/min rapids it's currently doing. I think I see a purchase of some ACME threaded rod in my future... Which will mean re-doing all the delrin nuts again, dammit.

Currently debating if I should buy 1/2inch or 5/8th inch rod (~12mm and ~16mm respectively). The 12mm is 2.54mm pitch, and the 16mm is 4.3mm pitch, so the 5/8th is capable of much higher speeds, at the cost of some accuracy and backlash. Still very undecided on this.

I say 'semi hand-rolled' G-code as it involved initially a significant chunk of perl, and eventually a chunk of C code that properly compensated for the cutter size. At the moment, it will take a PGM image and convert it into G-code, treating the grey levels as a high map. It's did a semi-reasonable job of carving a picture of K into foam; albeit with some oddities given the simple lightlevel->height conversion. Took nearly an hour to carve a 120mm x 80mm image tho. I am seriously feeling the need for speed!

Sunday, January 25, 2009

Getting slower better at milling.


I'm slowly getting better at maching parts. The photo is a trival couple of spacers; Just some aluminium box, cut and faced to the same length.

I cut them on the bandsaw, squared one end of each on the mill, turned them over, stood them on equal bars and then run a face cutter over the pair.

Pretty trivial machining, but it still involved 3 tools. The nice bit that I'm happy about is that it only took me about 5 to 10 minutes. I'm very slowly getting more experienced and quicker.

This morning I was making more delrin nuts (for the mini-mill) and had both the lathe and knee-mill running at the same time. The lathe was on auto-feed facing and then parting delrin, while the mill was on power-feed facing the aluminium bracket. Less standing around waiting while the machines take fine cuts. Not entirely sure it was a good idea, but it did make things go faster.