edit gcode externally

I’ve been making some updates to a command line interface (CLI) program lately. I wrote it in the Go language and it’s useful for editing 3D printer gcode files.

A GCODE file is a set of toolpath instructions for both 3D printers and CNC machines.

GcodeEdit

The program is called GcodeEdit and it can so far do the following:

  1. Update the hotend’s temperature, useful for changing the filament material you’d like to use for the part
  2. Show a variety of information from the file, like number of layers and the slicer software which was used to create it, for example
  3. Remove all heat-, fan- and extrusion-related commands so that you can watch the printer go through a “dry run” without wasting any plastic
  4. Repeat the indicated layer but without extruding any plastic, suitable for “ironing” out the last layer and useful during the first couple of layers, for example

I intend to keep adding options to this program and I use it myself, for what it’s worth.

Repository

recycle, reuse, reinvent

Someone had a dual-monitor desk stand for sale (something like $10) and I bought it without much in mind for it. I liked the sturdiness of it and it’s been in my foyer for several weeks.

Yesterday, I designed a VESA mount in PLA and printed it over the span of fourteen hours and it turned out to be perfect. It now accommodates the first of two filament spools for the 3D printer.

SpoolHolderOverview

SpoolHolderWithBracket

SpoolHolderOverhead

black pearl

Since I’ve had the 3D printer for nine months now, I thought it was time for a facelift. I decided to re-theme it completely on the software side of things. The first step was to change out the web interface (stripping away all of Robo’s theme and modifications) and now I’ve replaced the LCD menu as well, which now looks like this:

Black-Pearl-Screencap

PrinterWithLCD

I created this design using Conky, a system monitor from the UNIX world. The theme was inspired by an earlier, larger desktop version of this by Ninquitassar but this was a total re-write.

I hope to now re-theme the web interface to match this styling and to then fork & recompile Conky itself to natively provide the details of the in-progress print job itself. It would be nice to have a feedback loop for the Amazon Echo Dot so that the voice controls will in some way alter the screen as an acknowledgement.

Repository

hot-crossed filament

The dirty little secret in the world of 3D printing is that things go wrong (a lot). This week’s problem to solve is the frequent cross-threading of the rolls of filament itself.  Filament manufacturers don’t seem to understand the requirements necessary for doing this right so it’s up to the rest of us to fix the problem ourselves.

Each time cross-threading occurs during a print job, you lose the entire print since the feeding of that filament just stops. In this photo, the printer has actually lifted the entire holder assembly off the workbench:

IMG_0503

Spool Guide

To deal with this problem, I decided to re-invent the spool holder itself by changing the inner topology from a rectangular shape to parabolic. It now delivers filament in a straighter path to the filament sensor block on the printer, minimizing cross-threading.

The reusable spool guide design incorporates eight individual parts which attach together using standard aluminum hex head bolts.

IMG_0509

Repository

understanding blockchain

Bitcoin is a relatively new phenomenon, getting its start only nine years ago. Since that time, it is now enjoys a market cap of about US$150B at the time of this post. That’s an admittedly-large sum of money for something that’s completely digital and you can’t hold in your hand at the end of the day. I guess it shares the same status then with stocks, bonds, mutual funds and other trading instruments that are a bit ethereal, if you ask me. That said, though, it has come a long way since its inception and there are a thousand or so copycats in one form or another. And yet, does the average person know anything about the underlying code and how it’s implemented?

I thought I’d put together a collection of terms to shed some light on the underlying technology to make it easier to understand.

Node

A node is a single identifiable unit in a variety of storage systems. It often includes a unique ID of some kind to make it distinguishable from its neighboring data. A node could be as simple as the following:

1,This is the data part
2,And this is more data

Linked List

A list is usually something like a comma-separated list of data. A linked list is one in which each new bit of data points back to the previous one in some way. And there are even varieties of this in which the new data points backward and the existing data points forward as well. Here is another example which includes backward-facing pointers:

{ID=1,Data="This is the data part",Previous=0},
{ID=2,Data="And this is more data",Previous=1}

Hash

In the cryptographic world, a hash is usually a large number which was generated from a collection of data. You should assume that the same collection of data as seen later would continue to produce the exact same hash as an output. Furthermore, no other collection of data should produce the same hash. Here’s another example with short versions of hashes included:

{ID=1,Data="This is the data part",Hash="5a285ab1945",PrevHash="00000000000",PrevID=0},
{ID=2,Data="And this is more data",Hash="b6f7f023f02",PrevHash="5a285ab1945",PrevID=1}

This storing-of-the-previous-hash-value in each record is important to prevent any tampering by someone else.

Digital Wallet

Now that you know what a hash is, it’s not too difficult to imagine that a digital wallet (financial account) is represented by one of these as well.

Transaction Ledger

A financial ledger in the form of two paper-based books is something that accountants used to fill out to maintain a company’s finances. A ledger is a history of all the adding and subtracting for the different accounts.

If the data part in our examples above actually represent those +/- activities and correctly identify a pair of financial accounts, then this might be an excellent way of publicly keeping a record of how much different accounts hold in some form of currency.

Block Number

Now that you know what a hash is, that unique identifier/number for each node or block of data is yet another hash number.

Merkle Tree

Since a block can store not one but several transactions in it, the method of storing the data is important. A merkle tree is a way of storing data with individual hashes on each branch plus combined hashes as well at the point of intersection of those branches.

So as we described above, a block can have multiple transactions stored in it. Each individual transaction would include a hash and the accumulation of transactions also gets a combined hash for the sake of safety.

Miners

A Bitcoin miner is a computer whose job it is to create and add blocks to this public ledger. More accurately, though, a miner is usually a single graphics card in a computer which has been setup to mine coins. It requires a fair bit of processing power to do what should be a simple task.

Nonce

A nonce is usually an integer and in our context, it means a special integer which—when added to the contents of a block—produces a hash which begins with four zeroes. As you might have guessed, it requires a bit of work to produce a working hash for a block of transactions and this is the “work” which Bitcoin miners do, for example.

When the correct nonce is guessed and a valid hash produced, it is published along with the block. If this is unique work and was done first then the miner might be rewarded with an amount of digital coin.

Blockchain

A blockchain, then, is a public, distributed ledger of groups of transactions stored in blocks. Each block has been assigned a hash which was programmatically difficult to produce. Each block includes information about the previous block in the chain, making it nearly impossible to alter after-the-fact.

A blockchain allows a digital wallet (as identified by a hash) to have a balance which is the collection of +/- transactions into that account.