Comments Off on Python function for building up gage blocks

So, for a bit I’ve been dicking around with making a function or program that will give you a buildup of gage blocks for a given size. I initially made one that gave a every solution for a given set of blocks but the dataset was HUGE, too big to even store properly especially with a 81pc gage block set. I had something in mind so I wrote a simple-ish function. It was a real mess, it worked but it was a mess. I put it through ChatGPT to simplify it and it’s way better than what I had. Here is the function (in Python).

def gage_blocks(blocks, buildup, maxResults):
    def helper(remaining, current, result, start):
        remaining = round(remaining, 4)
        if remaining < 0 or len(result) >= maxResults:
        elif remaining == 0:
        for i in range(start, len(blocks)):
            block = blocks[i]
            new_current = current[:]
            helper(remaining - block, new_current, result, i + 1)
    result = []
    helper(buildup, [], result, 0)
    return result[:maxResults]

block = [0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.1001, 0.1002, 0.1003, 0.1004, 0.1005, 0.1006, 0.1007, 0.1008, 0.1009, 0.101, 0.102, 0.103, 0.104, 0.105, 0.106, 0.107, 0.108, 0.109, 0.11, 0.111, 0.112, 0.113, 0.114, 0.115, 0.116, 0.117, 0.118, 0.119, 0.12, 0.121, 0.122, 0.123, 0.124, 0.125, 0.126, 0.127, 0.128, 0.129, 0.13, 0.131, 0.132, 0.133, 0.134, 0.135, 0.136, 0.137, 0.138, 0.139, 0.14, 0.141, 0.142, 0.143, 0.144, 0.145, 0.146, 0.147, 0.148, 0.149, 1, 2, 3, 4]
print(gage_blocks(block, 1., 20))

As you can see, it includes the list of blocks for an 81 pc set. the function takes a list ‘block’, a value to achieve ‘buildup’, and finally maxResults which will limit the number of results. Limiting the results is imperative. If you don’t it’ll take forever on sizes beyond .6. Here is the output if you run the function above. Keep in mind it is using the blocks list, the value of 1.0 and it is limited to 20 results.

[[1], [0.95, 0.05], [0.9, 0.1], [0.85, 0.15], [0.85, 0.1, 0.05], [0.8, 0.2], [0.8, 0.15, 0.05], [0.75, 0.25], [0.75, 0.2, 0.05], [0.75, 0.15, 0.1], [0.75, 0.149, 0.101], [0.75, 0.148, 0.102], [0.75, 0.147, 0.103], [0.75, 0.146, 0.104], [0.75, 0.145, 0.105], [0.75, 0.144, 0.106], [0.75, 0.143, 0.107], [0.75, 0.142, 0.108], [0.75, 0.141, 0.109], [0.75, 0.14, 0.11]]

Seems to work well (I guarantee nothing!!!). Hopefully this works for people. Enjoy!

Comments Off on Finishing the kiln

I’ve finally finished the kiln, really all I need to do is put it back together but ultimately it works great. It allows for 8 different programs with 6 different steps each. it can ramp up and down and has a selectable hysteresis.

Now we can cook tool steel quite a bit more reliably. This one uses a MAX31855 rather than the MAX6675 with was limited to 1020C. Anyways, that was fun. Now to move on to the electrolytic deburring machine. At the bottom here I will link to the source code I used. The code sucks, it was my first time using Python for anything substantial so I don’t guarantee it’s use for anything.

Comments Off on Why buy something when you can spend more time and money and do it yourself!?

As the title suggests, doing something yourself is often much more effort and money than just buying something off the shelf. This is the case with the furnace controller I’m making. I ruined the one that came with the original furnace. Replacing it with a modern one would be about 400 bucks or so, not too bad but I decided to make my own. I had already made a basic controller with an arduino nano and a max6675 module. However, I want something more thorough.

So with that said I made a new prototype board with an RP2040 running MicroPython. This was an interesting experience since I’ve never used MicroPython. Also, this time around I bought a quality MAX31855 Adafruit module off Digikey since the ones I bought off AliExpress were all borked.

The prototype kiln controller

As you can see, this uses the following components

  • RP2040-Zero with MicroPython (Available on AliExpress and Ebay)
  • Max31855 Module (Available from Digikey and Adafruit) DO NOT BUY FROM ALIEXPRESS!
  • TM1638 LED display module (Available from Ali and Ebay and basically everywhere)
  • Linear Voltage Reg to 5V (LM7805 or 1084-50)
  • 4 position wire-to-board terminal block
  • 2 general purpose diodes to remove flyback voltage on relays
  • a small Takimisawa 5V small signal relay (to turn on a larger relay, not the best idea)
  • An NPN MPSA13 Transistor to drive the relay
  • Some caps for decoupling, Good idea to decouple the display and the MCU module

A view of the prototype board. Nothing spectacular of note.

The only real challenge of this was writing the software for the controller. I’ve written it in such a way that you can have 8 separate programs and each program can have up to 6 steps. You can individually enable and disable certain steps in a program if you want a different process for each. The controller supports ramping and also has the ability to ramp down. Also, there is some error correction in the form of thrown errors. One thing to keep in mind is that I’ve never actually written anything in MicroPython before so if you do look at the code, don’t judge too harshly, it’s a mess.

Here is a link to the source

So, there’s still a lot to do. I have to make a nice semi-decent looking cover for it and install it properly onto the furnace rather than having a bunch of exposed wires hanging out. Also, I need to test the software a bit more thoroughly and make sure it doesn’t cause issues when the big relay is activated.

This is a quick model of the buttons and sheet that will go into the existing frame. I’ll have to add spacers in order to have it sit correctly

Anyways, some more work to do. I will update this.

January 30th, 2023 | Categories: Electronics, Machining, Work | Tags: , , , , ,
Comments Off on Fixing a kiln

A while back I had put a new thermocouple into our kiln since the last one crapped out. This is not unusual. What was unusual is when the thermocouple braid shorted the controller against the 200v rail since all of the connectors inside the kiln are uninsulated. The controller was toast so I decided to build my own, not very difficult.

First I built a controller from a cheap Inkbird thermal controller with a solid state relay. It seemed to work well until it got to about 600C and then it would level off and just get hotter and hotter without giving a reading that it was above ~800C. So I tried to confirm it with a pyrometer to double check and yes, it wasn’t reading correctly. So I thought it was the thermocouple and I replaced it, no dice. I then made my own controller with a MAX6675 module. Still the same problem. This stumped me for a bit until I did some reading.

What I found was that polarity of the wires is very important. Each wire from a thermocouple has its own composition and this is important in proper application of the Seebeck effect. On a K-Type thermocouple, the wire that goes to the negative terminal is magnetic whereas the positive wire is not. The wires I had were made to the Japanese standard where the red was positive and white was negative whereas US standard has the red wire as negative. The kiln now works correctly.

Some things to note as well is that running a kiln off a cheap Chinese SSR can be a bad idea. The cheap SSR’s seem to limit the overall current, probably at the zero-crossing point where it cuts out. I used the bigger chonkier mechanical relay for this application and there are no problems. Also, turning on a heating element has a fairly large inrush current, it’s good to put some larger decoupling caps on any power supplies that might be feeding from the main AC source.

Once I’m done programming the controller to do ramps and timed cycles I may publish the code and circuit diagram so that others can make their own controller if they wish. That said, here’s a pair of electronics cats who assist by staring at me while I work.

Things are going good. Things are busier than hell and I’ve been working on a few things. Firstly, I’ve been doing woodworking as an interesting departure from what I do on a daily basis. There’s a particular sense of accomplishment in having a usable item ready to use after a few hours of work.

A little work area I’ve set up in the mezzanine of the shop.

So, I’ve also been working on more boxes for use on our products. Hopefully they look good enough and will be better than us sending things out in cardboard or some makeshift case.

A bunch of boxes for our setting masters

It should also be said that I bought a junky little 3018 pro CNC machine off amazon for laser engraving paddle gages and setting masters and whatnot. The machine initially ran like shit, the bearings on the Y axis were some of the worst garbage I’ve seen in a while. I polished the linear rod down a bit and trued up the bearing blocks so that they’re in line with the rods. This however only made it a bit better. I may buy some decent bearings at some point.

The 3018 CNC engraving a paddle gage. This one is just enough to discolor the metal, not engrave it too much. I have a larger laser coming in that will hopefully remedy this problem.

Also, I’ve taken a few more steps to completing a prototype version of my goofy digital LED clock. This was done with a 16×16 matrix of ws2812 LED’s. You can pick these up for like 15 bucks CAD. They’re an interesting display if anything.

The back end of the clock.
Obviously, the protective layer on the plastic hasn’t been removed yet. I figured that putting some translucent plastic over top of the display would make it a bit less hard on the eyes when looking directly at it.

Well, there we go. Perhaps more will occur this month.

September 26th, 2022 | Categories: Electronics | Tags:

So another year is about to close and we wind our way into winter soon enough. I’ve been pushing ahead on a few things and playing around on a couple of others.

Recently sent out a bunch of gages for a large valve manufacturer in the States. We’ve made quite a few of these over the last few years, seems to be a popular design. These represent a great deal of work to make each one so it’s always a treat to see them go out and hear nothing back. No news is good news.

Building an LED clock with a WS2812 matrix. These things can really draw a ton of current if it’s put to full white. I think this will make a nice addition to the shop. I’ve made a box with a white diffuser, this will make the clock a bit easier on the eyes.

Also trying my hand at some woodworking. I’ve been making boxes for sending our product out in custom cases rather than trying to get them done outside of house. This will allow us to make changes or add products together and have a cohesive look to everything.

Well, there’s a bunch of work going on and Rejent is now in the new place with most everything unpacked. Here’s hoping to a good winter.

This is a picture of a good cat!

Here’s a panorama of Edmonton in the summer time, specifically July 2022


June 18th, 2022 | Categories: Electronics | Tags: , , , ,

Over the years I’ve posted things to this site as a bit of a reminder to myself about the kinds of things I’ve done over the years. It has now been about 15 years since I started the site and that prompted me to go through old photos, back some stuff up and reminisce about days gone by. I’m going to post a number of photos that I’ve found that are purely of interest to me but, hey, maybe somebody else might enjoy them too.

My work area circa 2008 or so. I don’t miss the 4:3 aspect ration monitors but I sure seem to have had a lot of them
A panoramic view of Edmonton in the Year 2007, September to be exact. This was taken near the river bank at the Old Timer’s cabin.
My first real bike that I had bought as an adult. I didn’t drive at the time so I rode this sorry bastard of a bike all over the city with me. I still have it and it works fine.
The result of some layup molds I had made for an intake cover. I made the molds but the other guys did the actual hard work of laying up the fiber and making it look like a finished product.
My desk at Endura. As you can see I’ve tried to set up a small electronics lab on my desk there and the area is a mess. This trend will not be going away in 2022.
My first real attempt at making a functioning product. In this case it’s an inline viscometer in a form that would roughly emulate a krebs viscometer. It worked eventually…. somewhat. I truly suffered from a distinct case of hubris but it helped me force my way along to learning what I’ve learned to this day.
The inside of the maintenance shop of Endura MFG. I learned so much here in my 2-3 years, more than almost any other place. Despite being bitter about the place for years, I now understand and appreciate my time here.
Another picture of that inline krebs viscometer. In retrospect, had I known what I know now, I could’ve made this viable. I remember that at the time I was reluctant to test it because I was scared of what would happen if it didn’t work. Would months of work be down the drain? Would I look like a fool? (Hint: it didn’t work very well at all)
A more complete version of the electronics in the previous picture. An interesting example of an attempt at big TTL Quad-half H-bridge and some other shit I don’t remember.
So what was supposed to be a gentle walk down memory lane is now a look at the iterations of a single project. This version is now closer to the one that works. As I write this I’m genuinely surprised how much I did in such a short period of time while doing other things at the same time. This one as you can tell is rotary with a sealing area kept lightly pressurized with a small air pump. This one is still intended to run in-line along a pipe or side of a tank.
Here’s a look down the legislature grounds in September 2008. Is it different now? I don’t know
This is from when I moved myself from the maintenance building over to the lab building. I don’t remember why or how, I just remember that I did.
Another prototype! This one appears to be the one where it’s intended to merely hang on the top of a tank. For reference we’re in March of 2009 here.
Here’s something from June of 2009 that’s kinda fun. I may have an older post about it but this is something that actually works. it’s meant to make a point cloud with 3 linear potentiometers and by using a button you can put the high-res ADC input into a file or whatever and create a point cloud from known values about the analog values. This was neat.
Here we go, the final version of this project. It worked surprisingly well. That said I probably wouldn’t use Phenolic to make the frame but it does look nice. Odlly enough, I even like the smell of phenolic being cut.
Here it is with the protective tube cut. Merely wave your hand over the top and it’ll start up. I had to angle the viewing window in order to allow the infrared sensor to detect objects. In retrospect I wouldn’t have done it this way. The window would be either scuffed or covered in paint and therefore useless. If I recall correctly I had another version of this with a large external perfboard version of what’s inside. This machine never made it past this stage, I was going to implement MODBUS on it and whatever else but didn’t get to that point. The recession had hit hard and that was that.

Well, there we go. Thanks for walking through 2007 to 2009 with me. I was expecting to be enthralled with my pictures of Edmonton but I guess work was, as always, more interesting to me.

May 31st, 2022 | Categories: Machining, Work | Tags: , , , ,

Well, I’ve been here at Rejent on and off for the last 12 years. Now the company is moving to different digs and I figured I’d take some arguably unflattering pictures of the shop. Things are in disarray and thigs are a bit dirty as well.

Right now these things seem mundane but in 20 or 40 years there will be somebody, perhaps even myself who will enjoy looking at photos like these. Our new place will be in the old Precimax building and while it doesn’t have that much more room, it will be a fresh start and we can organize things with a pinch of pride.

Here’s to a good move!

May 26th, 2022 | Categories: Machining, Work | Tags: , , , , , ,

We’ve had these things in waiting for quite some time. I’ve designed them to be lighter, more accurate, less snaggy and a bit sleeker. They take the standard heads that I’ve made for the last 4 years and still move linearly so that you can put whatever kind of styli you want on them. The older ones used to snag due to the fact that there were two bearing being forced to cock over in certain circumstances.

A view of the working end of the gage

As things heat up in the world and the economy either booms or busts, hopefully we’ll be able sell some!

Over the years I’ve had issues with large parts and finding easy ways to lay them out angularly, especially on the ram EDM. During this time I’ve kind of tinkered in my head with an idea whereby you have a level of sorts stuck to the part and you simply rotate it and have a direct reading of rotation applied to the part. I have tried those digital levels but accelerometers don’t have the precision required to get within a few thou over, say 6 inches.

The prototype device as it is right now

It’s obviously very rough and uses a cheap Chinese 2000ppr encoder but it’s good enough for .045 degree increments. I would trust this thing for some larger layout and alignment work. That said, I have a nice US digital encoder on the way with 10000cpr (40000 ticks all the way around) so a resolution of .009 degrees. Some issues I’m having is with the mass. If the mass is too small it won’t overcome the friction of the bearings completely and if the mass is too large it swings for a long time making it a hassle to allow it to settle. I’d like to find a solution whereby I can add friction without adding stiction. Frankly the whole thing needs a good concept redevelopment but I believe it’ll be a handy tool in niche situations.

I’ll keep this updated as I go along.

June 22nd, 2021 | Categories: Electronics | Tags: , , , , ,

Well, here we are, 2021 is here. Let’s show the shop as it stands in 2021. This is of course only the machining side but in another 10 years the pic will be of interest to people who like this kind of stuff. Also, been here for over 10 years now. wow.

Rejent Tool from the north-east side
Rejent Tool from the north west side.

That is all.