Reprap Blog 2021

Hangprinter v4

The HP4 Prototype 2
HP4 again.
Another image of HP4.

- tobben

Philosophy of Hangprinter


The Software

People hate Software.
Bugs, leaks, errors.
Cryptic messages.
Menus, forms, and help-pages.

Software says "Ok, doing it".
And you wait, you don't know how long.
You don't know what it's doing.
You need it to work.
It sometimes fails. After a while.

Like the most under-funded government agency imaginable.
Broken windows, rotten apples, full trashcans everywhere.
People defend themselves.
Against software.

The Plastic

People hate plastic.
Weak, cheap, poison.
Awful smell, cracking sounds, hysterical colors.
Short use.
Long trash.
Buries us, in lifeless artificiality.

Whatever disease you get,
there's always a chance
that plastic,
disturbing your hormones
triggered it.

That's what people feel.
Plastic comes from an unknown place, underground.
Plastic poison can penetrate your skin.
Get into your body.
Like the devil.

All other materials are natural.
Only plastic is not.
People defend themselves.
Against plastic.

The Robots

People abhor most robots.
Plastic and software with motors.
Commanded by others.
In our surroundings.

The few robots that people love,
are exactly those
that they control,

Other robots steal.
Grab attention.
Grab pictures, writings, and videos.
Robots intrude.
Take jobs.
Take lives.

Robots make money.
For the already rich.

Robots are
the ultimate source
of faceless power.

The Future

A single person
with superior robots
could subjugate all other humans.
All you need is scale.
This risk was not in the past,
but is in the future.

A group of countries
or companies
or countries and companies
with superior robots
own the world.
That's the present.

People must defend themselves.
Against robots.
And the only way
is with robots.

The power over yourself,
can stay yours in two ways:
through kindness of others,
who have robots,

Or you can have robots yourself.

People who hate software
who hate plastic
who have little money
will stumble into non-ownership of robots.
Through defending themselves
against software and plastic.

They must be given ownership,
or they will be owned.
Or worse:

They need free robots.
They need to be handed their free robots.
For free.
Extremely friendly robots.
Easy robots.
Entirely under their command robots.
But strong and valuable robots.

Robots that they will accept.
Robots that will eventually defend them.

But people hate robots.
And receive robots with stiff smiles.
Least wanted pair of socks, on Christmas Day.
Hangprinter is me, knitting socks.

I hate software and plastic. But I need Robots. And also you.

Just my kindness,
will not be enough to cover all,
when robots of power march in.

They will call it,
"economic realities",
and do what they want.
They will harm you only by accident.
Because they won't notice you at all.

But if you have robots.
A few for yourselves,
that you love.
Then you can step aside.
Not care about those in power.
And be free.

- tobben

Torbjørn Must Test New Things. hp-mark Is Good Enough.


I saw this talk about one of my favourite artist's creative process. Here are a few quotes from it that I've resoned around the last few days:

1: "Publishing is not finishing. All the emotions are different. [...] Publishing is deciding to stop when you want to keep working. And it's super painful."

2: "Publishing works best if you think of it as a style of working. It's an attitude that persists throughout the entire creative process. Working to publish is about getting shit done. Your whole mentality shifts when you're working to publish. You focus on the stuff that matters, and you ignore the stuff that doesn't."

3: "Working to publish, it's selfless, it's outward focused, it's about results, and giving back, and contributing to the world."

His shortest version of the good work to publish method is this:

4: "... doing only what matters, the whole time, and then stopping."

He explains that this is a great strategy because most ideas and attempts flop, and you don't know which will succeed beforehand.

5: "You can't choose what you're famous for. ... I can't make a song a hit. I can't control how my songs are pushed through the world and are experienced by others. What I can do is be prolific, I can be creative, I can make great stuff. What I can do is work to publish. You write the next scene, you record the next instrument, you build the next set, you shoot the next tape, you design the next synth, and I can [publish all that] and then I can move on, and I can go to sleep at night, knowing that I did everything I could."

I want to see if this musician's points can help me think better about where to take hp-mark and Hangprinter from here. His work is different from my work, but we're also similar. Let's see if we can make our experiences fit.

1: Publishing Is Not Finishing

Things are never finished, we have that in common. I like his emotion focused description.

With where I'm at with hp-mark right now, I don't want to keep working. So we're not exactly at the same spot, the musician and I. That's because hp-mark is not like a song. It's more like an instrument.

Since even before starting to build hp-mark, I've thought of it as lifting Open Source Hardware over a threshold, closing the loop, ending the guessing game in open source hardware positioning. A short-term grind, a long-term investment for the common good.

Proprietary machines have had motion tracking for decades. Everyone knows an OSHW motion tracker could be made. It just requires someone's work hours. That might as well be me, I thought. But it's not very fun, no, and I knew that. It's painful to continue. It will be delightful to stop.

My hp-mark process changes after this month's demo, because hp-mark is good enough. I have improved both code and hardware a lot, and tested it thoroughly over the last month. It can take OSHW over the threshold just fine, if it reaches widely.

Done March/April 2021
Tasks completed during this sprint.

2: Working to Publish

The musician and I have different outputs and different metrics. For music, success is to reach people. hp-mark needs to

to be successful. My pain comes from ignoring/failing at the former while working to my bones on the latter.

But the musician's point makes a lot of sense for hp-mark in the continuation. Just make a small thing and see if it flies. See if you can have a little success, quickly. I will get back to that way of working.

Make something small work well enough, then try to reach people. Make something else work then try to reach people again. And again and again and so on.

I regret not pasting a giant Aruco marker on the Hangprinter back in November 2020. I could also have dropped the spherical markers in December, when I found they were hard to make/source. And the colored markers stayed with me for too long also. I would have reached more collaborators and supporters by doing something simple, and then spent time reaching out instead. Imperfect decisions there. Well, well.

3 and 4 are Mostly the Same

I think quotes 3 and 4 mostly come down to the same improvement of process for hp-mark as quote 2 did:

  1. Make a small thing.
  2. See if it flies.

5: Torbjorn Tests New Things

I interpret quote 5 as "test new things, test different things, do the next thing". The last couple of Hangprinter years have felt a bit stagnant. Particularly on the outreach side of things. Why?

Many worthwhile Hangprinter related projects are hard and time consuming. Robustness is not quick, easy, cheap, or sensational. We need robustness. So I had to dive into "doing it right", and swam across the swamp.

Still, I should have done it more quick, easy, cheap, and sensational than I did.

There's always a light version of any project, one that breaks you down less. I must break down less. Economically and motivationally.

Quick things to try:

Things that I don't yet know how to fit into the quick publish and outreach success template:

- tobben

hp-mark Is Good But Lonely


The rabbit hole has gotten deeper. But progress is fast at this stage. Average error (that's accuracy) has shrunk from ca 35 mm to ca 3.5 mm. Maybe even smaller. I haven't tested accuracy thoroughly yet.

Precision (that's stability of repeated measurements) at the origin is down from ca 5 mm to ca 1 mm. And also:

CHECK!Detect all markers on 95% of training images

The markers have changed from small colored spheres to bigger retro-reflective disks. They're cheaper, lighter, easier to manufacture, and perform much, much better.

I had to go and implement the disk geometric equations. My body protested for days when I picked up that task. Luckily, this time I had a research paper to guide me through most of the theory, and I could quickly replicate my old test structure. This made me ca 10x faster compared to when I did the sphere geometry.

I've posted a couple of demos since last time:

The first video shows the more fundamental use case for hp-mark: auto/assisted anchor calibration. It enables all other hp-mark use cases, including homing.

So hp-mark is growing up.

The extremely high recognition and identification rate I have now is thanks to some LEDs that I put around the camera:

My Picam with led rings around it
My picam v2 with two rings of in total 20 LEDs around it. This removes most problems I had with shadows disturbing measurements. I'd say it took identification rate from ca 95% to ca 99%(?). Out of ca 1000 test images, I haven't recorded a single identification failure yet.

I know I could enhance accuracy and precision further by mounting these slightly higher end, low distortion lenses:

A set of low distortion lenses
A set of low distortion lenses that I ordered from Arducam. This setup would use the same image sensor, wire connection, and software interface as the current Picam v2.

However, changing the camera PCB and lens means having to calibrate it and also make a new mounting bracket for it. Plus all the fiddling with wires, focusing the camera, unexpected stuff etc.

My guess is 1-2 days of work. Is it worth it? What are my goals?

Keep Your Head Down And Work!

This sprint's goal is "high accuracy auto calibration". The higher level goal is "a reliable work horse". Peace of mind.

The better camera achieves all of that. So I have to do it. Just like I redid the markers.

This isn't how I worked a few years back. This isn't how the HP1, HP2, HP3, and first prototype of HP4 were made. They were all just barely working systems. This is why HP4 will be different.


Body is shouting loudly. And for good reason.

Rest of World, aka everyone I meet, care extremely little about hp-mark in its current form. It you're reading this blog post, you're among very few (source).

As much as I crave attention, Rest of World craves brain tickle. Humans need this always. Brains want to light up.

Current form hp-mark just isn't very...

A side shot of Darth Vader's helmet
MRI scan of person reading up on how a measurement system that is unrelated to their life improved from 35 to 3.5.

... stimulating. For me, a person who is constantly dying for attention, this is a problem.

What To Do

Even at nanometer precision, hp-mark without a context would be nano-stimulating to the non-Hangprinter owning world. Common solutions to this kind of problem:

  1. Pay folks to suffer thruogh your under-stimulating thing. Attention-as-a-service. Day jobs. Ads. This is the most common solution out in the wild.
  2. Find people who love your stuff by unusual amounts.
  3. Put your thing into an exciting context/story.
  4. Pitch! Learn pitching dark arts.
  5. Accept defeat.

All of these have their own pros and cons. Too much to write down here. I will do number 5 for the rest of this sprint, and then try my luck at number 3.

Tasks of the current sprint
The sprint in question.

The first slightly more exciting context, at least for hp-mark, will be HP4. End-to-end, released machine, with build manual and all. I look forward to that.


HP4 is not very interesting on its own either though. It will need it's own number 3 eventually. A context creates a story. Without a story, humans can not understand, or hardly even percieve your stuff.

Number 3 Suggestions for HP4

Short End Note

The old HP story is basically "a living thing that creates economic value". Fully automated, self-replicating, printing furniture, taking zero space when not in use. I'm not sure if that is tickly enough from my attention cravings' perspective. Before it's even out there we'll never know.

hp-mark does more than just exist now. It's getting quite good, but also quite lonely.

- tobben

hp-mark Exists Now


I climbed down a rabbit hole recently. Nearly half a year working on hp-mark. The past 84 days even skipping blog post and newsletter writing.

Progress has been steady. It works now. hp-mark measures positions, like:

First ever non-zero result from hp-mark
Result 1: [-1.27, -217.65, 2.68]. Hand measured position is [0, -217, 0].

Accuracy is not fantastic. The image above is a lucky one, with only 3 mm of error. A more commonly seen error is around 35 mm.

A lot of hp-mark work remains. I ticked 2 boxes, and added 6 new ones in the roadmap today:

Aquire camera 6D pose (this includes defining our world coordinate system)
Aquire effector 6D pose
Detect all markers on 95% of training images
Take image ourselves upon request, don't rely on other programs to take image first
Create a continous stream of position measurements (video?)
Get a statistical idea about size of error
Respond to RepRapFirmware/Duet request for position measurement
Integrate a second camera, to reduce error

I'm a bit overwhelmed still. I need to look backwards a bit.

What Have I Done?

I've been surprised.

Video stitched together from todays test images.

I chose C++, OpenCV, and a very traditional approach for this project. I just wanted the most basic code that would mecanically find circles among pixels, and then apply static geometric equations to transform circles into a nozzle position. No AI stuff, no GPU stuff, no fancy hardware control, just $$ f(x) \rightarrow y, $$ where \(x\) is an image, and \(y\) is a nozzle position.

Such an old and explored problem! I felt confident.

Some things that took long for me to program, in descending order:

I feel like I'm almost too tired of it to even write about this stuff now. But before I climb out of this rabbit hole, I can show you something about how the ellipse detector works internally:

Input to ellipse detector
A zoomed in version of the original image from the PiCam v2.
edge image inside ellipse detector
Color contrast between pixels were used to find these edges in the image.
segment image inside ellipse detector
The edge pixels are the grouped into segments. Each segment has a different color in this visualization. A single segment that forms a closed circle or ellipse will be detected already at this stage. Most detectors can find complete closed-curve ellipses quickly and easily. What sets ED_Lib apart is how hard it tries to piece together the chopped-up circles, and how quick and cheap it manages to do this.
lines image inside ellipse detector
The segments are split up further into lines and arcs. These are the lines.
arcs image inside ellipse detector
... and these are the arcs. (If you compare very closely with the segments image, you find that not all arcs match exactly. They should match exactly. I mixed up images from two different runs when preparing this, so this arc visualization is ever so slightly off. It's still representative for the result below though, in that the top blue marker could not be found amog these arcs either, but all other markers were found.)
output of ellipse detector
The arcs are combined into circles and ellipses according to many different heuristics.

In the image above, we see that one marker was missed, despise ED_Lib's many different heuristics. I tried to tune the heuristics for the hp-mark use case. See how that went, here.

Ultimately failing to tune the heuristics convinced me to put background plates below my markers. That is what I'm currently working on. They will probably end up looking something like this:

marker with bent octagonal background
Test of marker background with bent octagonal background.

The final background design will probably be flat and circular, and hp-mark will use the edge of the background, as well as the marker itself, to determine its position, further improving both robustness and accuracy of the system.

But not today. I'm so tired of that kind of programming. Let's celebrate the restuls at the top of this post for a while first. And let's rest.

- tobben


Hangprinter Campaign: Bountysource Salt

Hangprinter Merchandise USA:

Hangprinter Merchandise Sweden:

Hangprinter Project: [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [31], [32], [33], [34], [35], [36], [37], [38], [39], [40], [41], [42], [43], [44], [45], [46], [47], [48], [49], [50], [51], [52], [53], [54], [55], [56], [57], [58], [59], [60], [61], [62], [63], [64], [65], [66], [67], [68], [69], [70]

Hangprinter Project Homepage:

Print Issue Solution Filter Project: [1], [2], [3], [4]

Sourcing RepRappro Mendel in Larvik: [1], [2], [3], [4], [5], [6], [7]

Archive: 2014, 2015, 2016, 2017, 2018, 2020, 2021

Github Profile: link

Gitlab Profile: link

Hangprinter project on Gitlab: link

Vimeo User: link

Youtube User: link

Twitter User: link

Master's Thesis: link

Linkedin Profile: link

Appropedia User: link

RepRap Forums User: link

Forums threads: Hangprinter version 1, Hangprinter version 2, Hangprinter version 3, List of Hangprinter threads

Source for this blog: Gitlab repo

Everything on this homepage, except those videos who are published via Vimeo or Youtube, is licenced under the Gnu Free Documentation Licence. The videos published via Vimeo or Youtube are also licenced via Vimeo or Youtube.