Coupler Upgrade

by Ivan Hamilton 3/31/2009 7:49:00 PM

I was keen to attach my home brew servo motors and see the mill move. The shaft on the mill's screws is 17mm, whilst the motor's 12mm shafts are designed for a small chain gear (small section of keyed  shaft and a left hand thread), and I needed to grasp below this.

Since I'm coupling the motor directly to the shaft, a figured a coupler with a little flex was in order. My immediate solution was some vinyl hose and a pair of hose clamps. Affixing and tightening the coupler was tricky. The uneven shaft sizes (17mm & 12mm) made it difficult, and I destroyed several hose clamps trying to get it tight enough. That would work for a little while, but it wasn't able to handle the torque and would eventually twist in the middle. I added some support in the middle with a section of hard plastic tube to help prevent this.

But the length of the vinyl tube was too great, and its twisting added extra backlash to the system. Not only that, the backlash amount was unpredictable, increasing during use as the vinyl warmed up. It was always meant to be an interim solution, and the purchase of a 1m length of Ø40mm acetal rod ($55AUD) was the start of something better.

Technically, this was my first CNC machining experience. It was only 2 axes, and involved numerous manual interventions, but to see it moving automatically to perform the desired machining operation was very rewarding.

I've already made two couplers (X & Y), and shortly will make a third to automate the quill (Z). With that, I'll have full 3 axis control and should only need to stop for tool/fixture changes.

Currently rated 1.5 by 150 people

  • Currently 1.476735/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


CNC | Mechanics

DIY Servo Controller - Initial Mill XY Test

by Ivan Hamilton 9/13/2008 7:35:00 PM

After months of putting it off, I jumped in and slapped two motors on to my mill.

I've already identified that the XY mechanisms on my mill aren't going to be up to the task (they have excessive backlash in both the bearing mount & the nuts).

Therefore, it's not worth spending too much time on the installation, as I'll need to redo it when I upgrade the mechanisms. I still hadn't done a "real world test" on my DIY servos & controller, and was keen to see the mill's table move.

Enter the angle grinder, 2 short pieces of RHS and some hose clamps...

So, what did I learn?

Keyboard: The wireless flexible keyboard I got is great. Chuck it where you need it.

Current Draw: It's not unusual in my 1:1 setup to see the motors draw 10A @ 12V. Hopefully this should drop when we switch to 36V. w

H-bridge Temperature: The H-bridge chips got hot. Real hot. I couldn't keep my finger on the heat sink, hot. Since pairs of H-bridges share heat sinks, I swapped the Y axis onto a different pair than the X axis. Then they both got hot... How hot? Not that hot: 57°C. I put a small fan near and let it continue to run: 32°C (ambient was 25°C). Not neccessary, but a larger heat sink or small fan would keep it cool.

PID Tuning: The inertia & friction of the table's screws changed the tuning requirements quite dramatically.

Encoder Inputs: Since I only used 2 of 4 servo channels on my controller, the other 2 encoder inputs were left floating. Phantom transitions on these lines fire interrupts and unnecessarily consume controller time.

Limit Switches: This was a simple test, and no limit switches were installed. Luckily, the flexible coupling slipped when it attempted to go beyond the table's travel. Limit switches are a must.

DIY Flexible couplings: OK, small length of hose with hose clamps. While there is some twist in the soft hose I used, when you consider the 0.2mm of existing screw backlash (@ 3mm/rev) equals 24°, the <10° of hose twist & <6° of servo error is quite acceptable (for now).

The Z axis hasn't had anything done yet, but that's OK. Baby steps. Although it would be easier, I don't want to automate the quill since it's got a lot of play in its rack & pinion setup. I should get moving on the ball screw upgrade and automate the column.

Even with only the X & Y axes done, the machine is transformed. I'm happy to perform any required Z movement manually for the time being.

All in all... I'm pleased, and it's quite exciting (chips will fly soon).

Currently rated 2.1 by 18 people

  • Currently 2.055556/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


CNC | Electronics | Mechanics - Don't hate the player, hate the game

by Ivan Hamilton 9/11/2008 7:09:00 PM

This is a follow up to my original StackOverflow experience. Bear in mind, this was based solely on my initial interaction with the site (I've gained a little more experience since). I'm not knocking the whole concept, and I know it's "still in beta". Anyway, that post gained commentary on J&J's podcast #21.

Firstly, for Joel, I'm the 1 in 10 who has no stake in anything. I have no interest in the failure of StackOverflow. I don't think it's a bad idea, in fact I loved the idea. I still do. I'm just rethinking the implementation, as I don't think the problem is an easy one. I think I cared, because I believed in the idea so much. As for the effort in registering a domain name and throwing a site up... 20 minutes & Paint.NET.  Ivan needs a girlfriend? My fiancée thinks I spend enough time listening to Joel, without having to hear from him that she's not fulfilling her duties.

Jeff suggested two options:

  1. Leave comments - I didn't have to rep to do this at first. But after earning a little rep, I had already run around and done this. And what I found most amazing, is that two of three of the authors have come back and changed their answers (but personally I have doubts that this would stay the case once the novelty wears off).
    So how do I like the game now? Not much, but I'm hopeful. I'm left feeling a little empty (I know... whinge, whinge, whinge). I don't like the idea that an incorrect answer will sit there at the top until enough people bug the author of it to get it edited. Maybe I feel it's unjust that a top rated answer is later changed to say "Whoops. I'm wrong. What Fred said below it right", yet Fred gets no cred. Maybe I'm just pissy that I don't have the rep to go and change these things on a whim. Maybe I'm pissy that to get that rep, I'd need to give "popular" answers... "Survey says!"
  2. Vote it down - I would, but it hurts my rep to vote answers down. As Jeff's stated before, the site is setup to be "anti-down". Many of Jeff's comments draw parallels to gaming, and voting something down damages your own reputation. No gamer would set themselves backwards for no gain (I also think, there's not enough down-voters to correct these situations).

I do agree that you should never look at any site and take the "accepted" or top rated answer as lore. As it's not hard to check all the answers to see if what you're after is mentioned there. Well, not hard for some of us in our "areas of expertise", but I've worked with many people before who have taken code from "Expert Q&A" sites, and wondered why it didn't work. They didn't understand the answer, so couldn't understand why it should have worked, and therefore couldn't fix it when it didn't. I worry for these people... maybe they're just lost.

Jeff makes many references to Wikipedia, but Wikipedia has massive guidelines on it's content. And from Wikipedia, here's what I think StackOverflow may be missing: Verifiability. I don't know how you get people to, firstly answer, and secondly vote, based upon such criteria, but I'm worried that without it, it's too open to group opinion.

I've seen some great answers on StackOverflow, and hope to continue to.  But I'll stand by my original point. How many times did you watch "Family Feud" and ask yourself "What random drug smoking monkeys did they survey to get that as the most popular answer?". Be wary of the popular posts.

P.S. Jeff, I love you man. Joel had the daggers out, but you were there for me. ;-)

Currently rated 1.9 by 34 people

  • Currently 1.882351/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Date raped by

by Ivan Hamilton 9/7/2008 2:27:00 PM

Falling in love with

I have been very interested by the idea of StackOverflow and have been listening to the podcasts with great enthusiasm. A place for programmers to get and receive answers. A place where good answers rise to the top. A place where the knowledgeable get the recognition.

I'm not naive, I've read the criticism, but it couldn't be that bad. There's always jerky naysayers around every endeavor. Although not really relevant to the site's development, I was seriously concerned (shocked actually) when Jeff Atwood suggested NOLOCK as an answer to a SQL locking problem... without even understanding the root cause. Was it a sign?

A couple of days ago I got my beta invite. I was so excited. This early in its life, the site would contain only those truly devoted to IT knowledge. Awesome!

I jumped in and looked around for a topic that I know well enough to give answers on. I found a question on C#, something I know moderately well.

Question #1: C# Language Syntax - Control Flow

The top rated answer had nearly 10 times the votes as any other answer, a pure winner... and was plain wrong. It confidently made a statement, that was simply incorrect. The second top answer was... just confused. It stated incorrect facts about an aspect of the question that weren't even relevant.

I posted a "correct" answer... but without any up-votes, it disappeared into the obscurity of the bottom of the page. And let's face it, when was the last time you looked at the second page on Google?

OK, it's only one crappy question & answer. It was time to find a better question.

Question 2#: C# Language Feature - Variance

OK, even more my style. So much so, I've even previously posted here on variance in C#.

So, let's... oh shit. The top rated answer... wrong. Oh crap, the question's author has even selected it as the "accepted answer". In fact, its opening statement doesn't even make sense. The only relevant word it uses, is the exact opposite of what the question is asking about... and it's used... vaguely. How does this answer have 5 times the votes of the first accurate answer? The next top answer is off-track and doesn't answer the question, merely repeating something about the question that the author already knows.

It's just bad luck... I've picked 2 bad examples. A third... I should try a third. Jokes always reveal themselves at the third item.

Question 3#: C# Date Algorithm

Hey... this one was asked by Jeff Atwood himself. He wouldn't... shit. The top answer is nice, highly up-voted, but contains a serious implementation flaw. Not one that you'd get bitten by very often, but it shows that people aren't exhibiting much skill or care.

I can't take any more.

Falling out of love with

My new friend Christie said the other day: "Half the people in this world are below average." It really struck a chord (just not the "this world" part). What's important here is that half of the anything in anything are below average (well, below median technically, unless it has a symmetric distribution). Half the practicing brain surgeons are below average. Scary huh?

Half the developers that visit StackOverflow are below average. But, they can influence the "value" of answers, and herein lies the problem. Charlie once said "ignorance more frequently begets confidence than does knowledge". It appears that those who are least capable of making accurate judgments on the value & accuracy of responses at StackOverflow, are the ones doing so the most. And that generates a lot of noise. Or so I thought...

But it's not noise. Back in the day, it was much easier for someone to say (and think): "The earth is really a flat plate supported on the back of a giant tortoise". It's something they can somewhat understand, and from their perspective it sounds valid enough. It's also means they don't have to accept that they don't really know the basics of the topic. And there's also confirmation bias - people expect answers that match their prior beliefs. Would someone accept the belief "The earth has sufficient mass for its self-gravity to overcome rigid body forces so that it assumes a hydrostatic equilibrium" when that's something they've never experienced, and it would mean accepting that they don't know anything about it?

Years ago I read a novel research paper on what's now referred to as the Dunning-Kruger effect. If you want to understand a little more about the below average half, read this. But the key tenets are:

  1. Incompetent individuals tend to overestimate their own level of skill.
  2. Incompetent individuals fail to recognize genuine skill in others.

What happens when you give them them power to vote? Self appreciating chaos.

These answers are not being up-voted at random. They're selected because those are the answers that appeal to this relatively unskilled group. And what answers appeal to a below average group? Fairly simple answers, with a bit of techno-babble just beyond their full reach. They rely on existing ideas and buzzword recognition, without trying to understand any of the more thorough responses that might make them feel intimidated. Who writes such vague, inaccurate & terrible responses? A member of the same group.

These incorrect, inaccurate and often unintelligible "answers" go rocketing up the charts. Later attempts to get correct information included are doomed to obscurity, being dwarfed by the popularity of the initial wank-fest of mediocrity.

Devoid of any accuracy-based-recognition, it's just popularity driven by popularity - much like I remember high school.

Follow Up: - Don't hate the player, hate the game

Currently rated 3.8 by 23 people

  • Currently 3.782609/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Quad H-Bridge Design - Ideas

by Ivan Hamilton 9/4/2008 1:36:00 PM

I'm thinking about the quad H-bridge board I want to build to match my quad DC servo controller.

Standard thinking is a discrete bridge built from four MOSFETs and a pair of half-bridge drivers: 4 x IRFP260 @ ~$5 + 2 x IR2184 @ ~$3 = 200V 30A ~$26
But for lower voltages STMicroelectronics make the VNH3SP30-E a "Automotive fully integrated H-bridge motor driver": 1 x VNH3SP30-E = 36V 30A ~$8

These are used by the H-bridge boards I've currently got (packing a lot of power in to a small space). I was initially scared by SMD devices like this, but having seen people achieve amazing results without specialised equipment, I think it's worth the effort.

The only feature I feel is missing is current limiting. The VNH3SP30-E has internal thermal, over-voltage and over-current protection, but that won't stop it delivering 30A to your stalled 2A motor. Dropping a resistor between the VNH3SP30-E and GND would allow you to determine the current by measuring the voltage at VNH3SP30-E's GND pins and combining that with your knowledge of the resistor's value.

Let's use a low 0.01Ω resistor:

  • V = IR = 30A x 0.01Ω = 0.3V
  • P = I²R = (30A)² x 0.01Ω = 9W 

Therefore, for a 30A draw to show 0.3V, a 0.01Ω 9W current sensing resistor is needed: let's say 2 x 0.02Ω 5W resistors in parrallel.

For low current systems (<3A), the 0.03V drop may be too small to adjust. Let's use a slightly higher (but still very low) 0.1Ω resistor:

  • V = IR = 3A x 0.1Ω = 0.3V
  • P = I²R = (3A)² x 0.1Ω = 0.9W

A single 1W 0.1Ω current sensing resistor could be used in low current situations to make the drop more pronounced.

Add an LM339 to compare the 4 drops against a reference voltage and pass that thru a 4081 quad 2-input AND chip with the PWM signal for the H-bridge.

Piece of cake!

Currently rated 3.0 by 2 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


CNC | Electronics

4 Channel Servo Control - v0.1 Assembled

by Ivan Hamilton 8/29/2008 3:35:00 AM

Well, it's done. I now have a self "contained" version of my 4 channel servo controller.

I've made PCBs for the controller, encoder & driver boards and mounted them all with the CNC4PC break out board I bought.

  • Controller Board (Top Left) - This was my first DIY PCB, and the design is a bit rough (no nice mounting holes, board shape, etc). The firmware can be updated via serial, so I didn't add an In System Programming connector (uC is in a ZIF socket in case of fuckup).
  • PC Break Out Board (Top Right) - This is a CNC4PC C10 Bidirectional Breakout Board. It's a basic BOB with buffered I/Os. Gets data from the PC into the servo controller.
  • Driver Board (Bottom Left) - It takes the 4 PWM+DIR signals from the controller and maps those into 2 dual H-bridge Pololu boards. I've added a couple of heat sinks to the H-bridge driver chips, which should help their cooling.
  • Encoder Board (Bottom Right) - Simply takes neat 4P4C modular connectors into jacks.

The final product is a neat little package... at least for my first attempt.

What comes next?

  • Finish the firmware - Add a few more features I'd like (obey & control e-stop line, output override, set speed, boot-loader CRC checks)
  • Finish the tuning software - Add a few more features I'd like (current status display, general UI cleanup)
  • Mount the meters nicely - The voltmeter & ammeter are just loosely connected at the moment.
  • Load testing & tuning - Does its performance match my original goals? Are there areas in the firmware that need attention?
  • Mounting motors on real milling machine - What's the real world like?

For the first time, I would happily pick it up, move it, and feel confident about it working when reconnected (little coloured bits of heat-shrink reduce confusion).

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


CNC | Electronics

Toner Transfer PCB creation - Attempt 2 Assembled

by Ivan Hamilton 8/23/2008 11:27:00 PM

If you've seen my latest PCB creation attempt, you'll know I'm ready to try and assemble my servo controller.

This is the ultimate test of my newly acquired PCB layout and fabrication skills. A good "looking" board will show its true colours when assembled... and I learned a few things.

  • The fill (leaving most of the copper in place and only etching enough to isolate the required tracks) caused problems during soldering. There just wasn't enough clearance for my rough soldering skills. The minimal clearance gap used to allow tracks to weave between the 0.1" pitch pads was too small to deal with when soldering every pad. I dragged solder from pad to fill a number of times, and had to grab the wick. I don't mind taking the extra care when needed, but on every pad? I'll increase this gap in the future.
  • The physical clearances around header sockets and the ZIF sockets were a little tight... I should check such things a little more thoroughly. A sharp knife made them fit.
  • The resistor lengths weren't checked... the carbon films I used were longer than the default I'd selected. They fit with a little inward bending.
  • Repairing tracks is best done with a strand of copper wire laid & soldered along the broken track. A more elaborate method I tried (cutting a new track in the fill) only made things worse.

The assembled controller board

I fired it up, setting the current limiting on my adjustable supply very low to protect the circuit in case of a short. It didn't consume more than a few 10's of mA which was all good. I plugged the serial plug into my machine and powered it up. Boom! Fizz!

Nah, just kidding. The boot-loader showed its startup message and then it all appeared fine. I couldn't properly test it, since my ad-hoc board has all the encoder inputs & driver outputs wired in (as can be seen here), and this new board doesn't. My plan includes making another board (or two) which takes the 10 pin header from the controller and breaks it out into the 4 channels with separate connectors. Given the relative ease with which I've made this one... I'll pump out the extra board in no time.

I think its fair to say, that I'm a little pleased with myself.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5



Toner Transfer PCB creation - Attempt 2

by Ivan Hamilton 8/22/2008 6:24:00 PM

In my previous attempt, removing the paper after ironing was an issue. The Inkjet Photo paper I used had a thin, yet tough, film on the glossy side that stuck between tracks. Removing it was a slow process as any rough attempt would lift the toner track. Also, the paper would bubble and lift when dropped in the water... taking the toner with it. From the web, I knew the results depended largely on the paper, with everyone having their favourite paper. What you need is something smooth (glossy) to transfer a clear image, and easily removed with water.

An idea I had seen was using pages from colour magazines or brochures. The paper is glossy and easily breaks down in water. I looked thru my bin for some junk mail and found a Kmart catalogue: smooth & glossy - yup, disintegrates in water - have you seen these after rain?

I also filled the unused area of my PCB. This will give extra toner to hold the paper down, and also gives the etchant less work to do.

I'm pleased with the result...

The result

The shadow you can see was from my first attempt. This was using the inkjet paper, but chunks of toner pulled up when getting the last of the paper up. I removed it was acetone, but the outline remained. The dark spot at the top right is from lighting, and not really visible (except in this photo).

The outcome was: two bridges & 1 broken track. The bridges were easily fixed with a knife, and the break was repair with some light wire.

The bridges may have been from the toner transfer (I'll look closer next time), and the broken track I think is where I (once again) didn't apply enough pressure near an edge.

Now I'm going to try drilling (not looking foward to that job) and soldering it together.

If I can iron out the bugs from this PCB creation method, it'll open new doors into custom circuit creation. 

We live and learn.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5



Toner Transfer PCB creation - Attempt 1

by Ivan Hamilton 8/21/2008 5:30:00 PM

A little while ago I printed a PCB design on my laser printer to some ink-jet paper I had, and ironed that onto some blank PCB. After that, let it soak in water, and lightly brushed the paper away.

This is my first attempt at home brew PCB creation using the toner transfer method, and the results (while not perfect) are not bad for a first attempt.

There's two parts to this process where I need some more practice: transfer & etching.


I actually did the transfer twice. The first time, a number of the tracks didn't fuse and lifted. I used more pressure and a longer duration the second time, and the result was much better.

One edge was a little patchy, and I'd say my lack of even ironing contributed to this. I though the layout was more centered (see the large gap at the top), and didn't put effort right up to those edges.

Board after transfer

I touched up a few of the patchy areas with a pen (which was a little large nibbed).


Not wanting to make up a large batch of etchant, I grabbed a plastic container just large enough for the board and put in ammonium persulfate crystals. The instructions on my etchant container said 75°C, so I boiled the jug and took it downstairs.

The etching started well, but pretty much came to a stop with a few blobs of copper still remaining. This is going to be due to one of two things: not strong enough etchant or not enough heat.

The etching process (edges gone, 3, 18 & 24 min later)

So, I need to work out a more accurate way to measure out the ammonium persulfate crystals (some small scales), and a way to keep the etchant heated (maybe a hot plate or oven).

Final Results

After giving the board a scrub to remove the toner this is the final result.

Final result

Some of the tracks appear to have been etched from under the toner (they looked good until the toner was removed). This is probably because I left it in the etchant for nearly 30 minutes. It should have only taken about 10 minutes. There were a few areas where the toner transfer wasn't the best, and a more even ironing should help this.

This board is beyond repair, as the tracks on the far left are all broken and they're too fine to repair. This is a learning process, so I'll do another one and see how it goes.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5



SOHO Backup Solution

by Ivan Hamilton 7/30/2008 1:36:00 PM

I need a backup solution for the several machines at home. The standard idea is tape, but this need re-examining:

  • Tape (AIT-5): $100/400GB + $4000 Drive
  • Disk (SATA-300) : $100/750GB

Yikes! Disks are cheaper than tape, that's even before you spend thousands on the tape drive.

But let's take a step back a bit. Why back up?

  • Disaster - Your current data (hardware failure/loss, data corruption)
  • Archival - Your old data (unnoticed accidental loss, compliance)

What do you need for a backup? Simply, to be able to recreate the original data. Backups can be compressed, incremental, or otherwise encoded. They're often not considered a online system, and recovery can take a bit of effort (tape systems can often take feeding tapes from several backups thru). Why can't I just fill a drive with copies of all my files? Better, only copies of what's changed (like Apple's Time Machine)? Even better, only unique files... or file parts?

I've tried Acronis True Image, and its incremental backup option. For my notebook, this creates an initial 40GB file, and then ~1GB incrementals every day after that. After a month, when I'm not interested in retaining the old files, I move the original large image and all its associated incrementals to another directory. Towards the end of a month, I've got both last month's and this month's initial & increment images. To hold 30 days of state, it consumes 2x(40GB+30x1GB)=140GB.

Duplicates? Windows File Protection (WFP) only gives me over 200MB of duplicate files on each XP machine. With multiple machines... why do I need to keep seven backup copies of "notepad.exe"?

Out of interest, I analysed my notebook & desktop. These are very different XP based machines, and don't share any applications. The notebook has all the standard productivity applications, and the desktop has the power hungry video, 3D modelling and gaming applications.

  • Notebook: 93% unique
  • Desktop: 94% unique
  • Combined: 87% unique 

Copying unique files alone gives a reasonable saving, and between two very different machines gives a good saving as well. An interesting find, was that my notebook had 362 files (~1GB) which had the same 64KB at the start, middle and end. I manually inspected a couple of these files, and found 14MB files with only a couple of hundred bytes different 3/4 of the way thru. You'd also, find large similarities between aged versions of files, and it'd be nice to take advantage of that.

This is what I'd like: A disk based solution that can be fed files, find similarities and deduplicate, and then recreate the files when requested. It should also be able to delete no longer needed files from its store and reclaim space.

  • Set Store
    • Set Management: Manage backups of "sets".
    • Timeline Recording: Files & directories have timelined events (creation/updates/removal)
  • Blob Store
    • Smart Chunking: Break blobs into variable length chunks based on data (rolling hash matches).
    • Single Instance Chunk Storage: Store chunks referenced by size & hash.
    • Single Instance Blob Storage: : Store blobs referenced by size & hash as references to multiple chunks.
    • Compression: Compress chunks. Maybe 7z? (compressed: PPMd/BCJ2, non-compressed: LZMA/BCJ2).
    • Cross Volume Storage: Use multiple store locations to support large stores.
  • Client
    • Open files: Backup open files using Volume Snapshot Service.
    • Bypass ACLs: Backup all files using SeBackupPrivilege.
    • Efficient change discovery: Read changes from NTFS Change Journal.

How hard could it be?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Powered by BlogEngine.NET
Original theme by Mads Kristensen

About the author

Name of author Ivan Hamilton
"My inner nerd can beat up your inner nerd."

E-mail me Send mail



<<  December 2019  >>

View posts in large calendar

Recent comments





    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2019

    Sign in