Board & Source Code Status
I have an order of 12 boards on a UPS truck that refuses to show up at my office when I am there. Hopefully this will end Monday. I’m putting together a parts order so I can stuff the board and find out whether I made myself a set of green coasters. One of the joys of this game is that it’s never easy to get everything you need from Digikey or Mouser, there’s always one part that you need to order from the other guy.
This cropped up as I was shopping for encoders. The one I’ve been using contains tasty lead, which means it’s a no-no for our friends in Europe. So I found a new one for about the same price which might be much better. It’s a Honeywell 128-count encoder, which is 4x the resolution of what I was using, but it doesn’t have detents (which I like). It’s marked as end-of-life, but both suppliers have 500+ in stock, so hopefully it will be available at least for the next few months or so.
Cheap Encoders Considered Harmful
I also had a chance recently to test out some $3 Panasonic 24-count encoders I ordered on a lark with some other items. At that price, I had the idea of doing a board with 3 encoders, one for each X/Y/Z axis, plus the spindle and feed overrides. Unfortunately, my first experience with them wasn’t very encouraging. I found that they missed counts very badly when turned any more than a single click at a time. I could see them still being usable for a secondary control like an SRO/FRO, but for axis control I think they’d start to stink pretty fast. Live and learn.
Another thing I’ve had to educate myself on that has proven surprisingly complex is the world of cables and interconnects. Every electronic project I’ve done has gone great until it came time to run wires between the PCB(s) and the other bits. At that point it went one of two ways:
- Solder nice long leads on while still on the bench, then roll it all into a bird’s nest and jam it in the enclosure. Works if appearance, interference, and space aren’t concerns.
- Mount everything in the enclosure, then spend HOURS cutting, stripping, and soldering wires into place. Pray to the deity of your choice that you never need to remove or replace any of it.
For that reason, I’ve designed this to (1) require as little cabling as possible, and (2) to permit maximum flexibility where it is required. Any connector that uses .100″ spacing will work, and there are literally hundreds of options out there. Many require special tools, so I’m ordering a few different ones to see which are easiest to do without special tools. I have a funny feeling that in the end, plain-old screw terminals may prove the best compromise….
My D’OH! Moment
The first big OOPS I noticed too late in the game was that I did not provide for a reset switch for the Arduino. The on-board switch will be blocked, so this means the only way to do a reset will be to pop the cord. Normally you shouldn’t need to reset the Arduino during operation, but I’d like to provide for the option so this will get fixed on the next rev. If I’m lucky, this is the only oversight, as it’s more of an inconvenience than a fatal error.
Why I’m Not Releasing the Source Code–YET
I’ve gotten a LOT of requests for source code, and the answer is still “no.” Here’s why:
- Always trash the prototype: What I have right now is a bunch of hacks and half-measures stitched together to prove that I could get it to work. One of the most important rules of software development is to build a prototype, and then throw it out and start over when it’s time for the production code. Looking back over the four months or so since I started this, I see a lot of things I want to do differently in an architectural sense, which I’ll write more about later.
- I can’t support it: I want to spend my time building the V1 production code, not helping people to get this crud working in their setup. If I sent the code to somebody and it didn’t work, I’d feel obligated to help them, and right now, I don’t have the time to do that *and* move the more important part forward.
- So? I can use what you have: Probably not. My code is a big pile of spaghetti built around exactly the hardware setup I’ve built. Even if you had exactly the same hardware I do, you’ll find a lot of features that work halfway (on a good day). If you want to just use a few switches and an encoder with no LCD for instance, you’ll find most of it needs re-writing. In that case, you’re going to be better off starting from scratch and building it all your way. In a previous post, I laid out a roadmap for exactly how to do that. Trust me, that’s going to be easier than dissecting my code. I ran into exactly this problem when trying to re-purpose Jeff Epler’s original Arduino-EMC example and ended up redoing everything from first principles. If doing that is beyond your abilities, I suspect my code would prove equally useless.
- We shall sell no wine before its time: From a commercial standpoint, I think it makes more sense for me to not release the software until I have boards for sale. Now, I have no objection to anyone taking that and using it to build their own without buying diddlysquat from me. Likewise, once it’s out there, It’ll be open for anyone to learn from and make a better product than mine. C’est la vie. But, at this moment I do have a little wiggle room to maximize my first-mover advantage. If you’re frustrated because you want to start your project, just think of that waiting as the price you’re paying to have me do the hard work for you 🙂
I have thought about publishing a mini-tutorial on how to push single bits and signals back and forth from EMC through HAL to the Arduino and back, but this would be more hours of work, for which please see (2) above. So I’m planning to do this after the PCB and V1 software are ready. In the meantime, please don’t hate me too much!