Another pen kit from Beaufort Ink and a wooden pen box to hold it.
The box retains the bark as a feature (it's special wood...).
The pen is made from the same wood, so it's a good match for the box.
Recesses cut with a CNC router, crushed velvet lining.
Tuesday, 25 June 2019
Making a Night Light from an IKEA LED Lamp
After a request for some night lights I remembered that I had some IKEA motion sensitive LED lamps that were bought for use in cupboards. One is still in use, the other (they come in packs of 2) was just lying about. They are easy to fix to walls and battery powered, so no trailing cables. I tried one as a night light months ago, but it was very bright and came on during the day as well, so it was removed from duty.
Thinking about the new request, I wondered if the lamp could be modified to add a 'darkness only' feature. Dismantling the lamp revealed a standard PIR chip inside: the BISS0001. Looking at the datasheet revealed even more good news: the chip has a function that disabled the output from triggering if it detects light. The example circuit has the components for this feature included.
I ordered the parts (100k resistor and an LDR) after working out the values I needed.
I modified one lamp and it didn't work, this was due to the routing of tracks on the PCB, so I lifted the pin on the IC and added the components directly to the pin. SOIC chips don't have robust pins, so bending it up once is about all it can manage. Any more flexing and the pin falls off.
After adding the components correctly, the lamp now only triggers and turns the LEDs on when it is dark. I've also removed three of the four series resistors that current limit the LEDs, as the amount of light given off was too much for a night light.
You also have the option of changing the time that the lamp stays on for, by changing the value of a resistor (or capacitor). This is detailed in the datasheet.
Lift the pin 9 leg:
Then put a 100k resistor from pin 9 to pin 11:
The LDR (light dependent resistor) looks like this:
I used my CNC router to cut a hole that matched the shape of the LDR and glued it in place:
The legs from the LDR wrap around the PCB quite nicely:
One leg can be soldered to the track at the edge of the PCB, the other requires a wire to run to pin 9:
I have modified one of the lamps to have a longer ON time, the rest are as they came. They've been running for a while now and are pretty useful.
These are the LDRs I used:
https://www.ebay.co.uk/itm/192823191519
The resistor was a standard 1206 100k surface mount resistor.
Friday, 10 May 2019
The Failures of 3D Printing
Not 3D printing in general, but the 3D printed parts that were no good, for whatever reason, when I was building my prototype can transformer. The finished article is here:
and makes things like this:
When I was building the prototype I printed many parts, a lot of which didn't work. This is normal for my builds, but this time I kept the failures. It was surprising how many there were:
The histogram of failure
I laid them out grouping the same part, so you can see which bits I had trouble with. The X carriage, for instance, is there as four failed parts, and the Z carriage is there in a form that isn't in the final machine. There are some gears in the picture (a lot of gears, in fact) which are also not in the final machine. I started off driving the Y axis using gears as they 3D print well. They have a lot of backlash, however, and just didn't work well enough. The final machine uses MXL belts.
The biggest failure is the part that engages with the top of the can and has to grab the can well enough to stop it moving as the Y axis rotates. They are the two rows of circular objects just down from the top. I had a lot of trouble with that poart and still don't have it perfect. In the end I made a common base for the part and screw inserts of different shapes in to it. This means I don't waste (any more) plastic and time printing the main body.
Most parts are failures for mechanical design reasons, the printer itself is very reliable now and I only had one or two print failures and they tend to be operator error in some form anyway.
The reason for black and white is that I have two printers, one set up for black and one for white. I found they print slightly different sized objects, so having different colours was useful as I knew which printer had printed what.
The coffee machine works. It's good for single cups of coffee, as you don't have to stand there too long pouring water. The old coffee machine is definitely dying, it now takes about an hour to run a pot of water through it.
To investigate how easy it would be to automate the new machine, I set this up:
There's a peristaltic pump:
which pumps water from the kettle to the filter. The power supply is adjustable, which is important to ensure the water flow isn't too fast as it will overflow the filter. For the pump I have the suitable voltage seems to be around 4V, which is pretty low. Usefully the power supply seems to remember its setting when it's off so you don't have to set it up every time you turn it on. A simple voltage regulator circuit and a knob would be equally and probably more suitable.
This arrangement also means you can replace the peristaltic pump pipe if it is dirty or damaged. You can also clean the pipe. We've never cleaned the insides of the old machine.
Thursday, 25 April 2019
Can Transformer
I was thinking about the battery connections on my DIY digital watch and how tricky it was for me to create things out of thin metal. Either I cut it by hand, which always results in less than perfect parts, or I spend quite a while setting up my CNC3020 and cutting it on that. That gives better results but can be fiddly.
Then I made the link between the problem and the drinks cans that I melt down for raw material. Drinks cans are made of aluminium or steel and come in a nice uniform shape. So I decided to make a machine that can turn these cans into useful stuff. And the CanTran was born.
It's actually a sort of CNC lathe that is designed to chop up drinks cans, transforming them into useful things. Putting a can in the machine is a simple matter that takes just seconds, using a spring loaded tail holder and a 3D printed part that engages in the can top at the other end.
It's got three stepper motors and a Proxxon rotary tool to do the cutting. The controller is a Duet:
which has a nice web interface and accepts gcode. I've always had a problem finding a tool to generate gcode, so I created a small simple script to convert DXF files to gcode. This isn't too complicated a task as the CanTran has 3 axes, but in reality is a 2D machine. The script converts just lines and arcs from DXF (LibreCAD) into gcode with just 2 Z depths at the moment. Any tool that generates gcode should work.
I use a D bit cutter, the same type I use to mill PCBs.
There's a little tour of the prototype here:
This is the machine cutting some test slots into a can. This is sped up by a factor of 20:
You can make labels with it:
You can cut letters into the can and then illuminate it:
Or, cut abstract patterns and do the same:
I've put the 3D files here:
https://www.thingiverse.com/thing:3570030
We'll have to see how useful it turns out to be...
I like it when a plan comes together, especially when it doesn't work well at first.
The story starts way back when I saw that a long time ago Casio had brought out a programmable calculator that used magnetic cards to store programs. I had a Casio fx-502p many years ago and learnt a lot about programming using that machine. Things like how to fit a program into not a lot of space. There's a program I remember from the 1980's written by someone who's name I don't know, that played tic-tac-toe. You could only ever lose or draw playing against it. I am still looking for the listing...
Anyway, I found that there were a few calculators before the fx-502p, such as the fx-201p. After a wait of a year or so I managed to buy one of those and found it was programmed in a strange language that Casio called Fortran, but is better described as 'fortran'. Then I found the Casio PRO fx-1, which is an fx-201p with a card reader.
My Casio PRO fx-1
The fx-201p just forgets when you turn it off, which is an exquisite form of torture when you've just spent hours crafting a gem of a program and have no way of preserving it. The card reader makes it worth spending the time working on programs.
Card reading calculators aren't common, but there were a few. The main two were the HP41C and the TI59. The TI 59 filled the same niche as the PRO fx-1 in that it has lesser siblings that forget when power is removed. Both TI and Casio families have 'continuous memory' versions that don't forget when the power is removed as they keep a low level of power supplied to the RAM chips, but changing the batteries can be a problem with these. You also can't swap between different programs easily as you can with a card reader. HP had many card reader calculators in the line up as they make proper stuff. Later on manufacturers used cassette interfaces a lot, but they are slow and bulky on the whole.
Back to the PRO fx-1. After an ebay search finally came up with a PRO fx-1, I had to buy it. Unfortunately it didn't come with any cards. The cards are no longer sold by Casio any more (shame on you). They could probably be obtained from someone who has some, but I think you'd need to give them at least two unicorns in exchange. The cards are a bit oddball, too. From photographs I'd worked out that they were 93mm long, which is a bit bigger than a standard credit card. I hunted for cards of that size and they do exist, but they are rare and expensive. So, I figured that if I used a standard credit card and pulled it a bit slower then the calculator wouldn't know it was a shorter card than it was used to. Hopefully.
There was another, more serious, problem, though. The cards that Casio made had a strange band of stripes running the length of the card just below the magnetic stripe. They were printed in the same magnetic ink that the stripe is printed with, but this made no sense as intermittent magnetic stripes are just nonsense. As I had a calculator, I could investigate, so I dismantled my calculator and had a look. It turns out that, as people had guessed, the band of stripes was for optical synchronisation (of recording). There is an optical sensor in the top part of the calculator. This also explains why the cards are transparent.
This made more sense, the band of stripes isn't magnetic at all. This is a bit at odds with the manual which tells users that they can write protect a card by putting an 'anti-magnetic self adhesive strip' on the bottom stripe of the card. This implies that the band of stripes is part of the recording of a card, not the reading.
So, I needed to have an optical band of stripes on the cards. How do I do this? It occurred to me that instead of printing a set of stripes on a transparent card (You can get transparent cards, but they are another rarity) I could make holes in a normal card. Making 85 3mm x 0.5mm holes in a credit card sized card isn't exactly trivial, but when you have a CNC engraver it is in the realms of possibility.
I had a couple of expired credit cards so I put them on the CNC, created a quick DXF file, converted to gcode and had a go. The result was better than I expected. I tried the cards but they didn't work. I was expecting this as there are tow types of magnetic stripe (in general, there are actually many different subsets): low coercivity and high coercivity. Coercivity is a measure of how hard it is to magnetise something: if it's low corecivity (LO-CO) then it's easy to magnetise. If it's high coercivity (HI-CO) then it's harder. The units used for coercivity is Oe (Oersted) and LO-CO is around 300, HI-Co around 3000. HI-Co is used for cards that have permanent data on them, such as credit cards, as you don't want it to be accidentally erased. LO-CO is used for data that is rewritten often (more than once, really). The Casio cards are LO-CO, as you want to be able to record cards at will. HI-CO cards could have been used, but as they are harder to write data to, they take more power to write and hence battery life would be adversely affected.
So, the credit cards wouldn't work, but the optical stripe looked fine. I ordered some LO-CO CR80 sized blank PVC cards. In the meantime I had some help from the calculator community and was sent a photograph of a Casio card with a ruler nbext to it. Up until now I'd been sizing cards from parts of the calculator, which, it turns out, isn';t a good way to size things. This picture enabled me to determine that I'd got the size of the cards wrong and they were actually CR80 size. Good news.
There was bad news, though, as my PRO fx-1 seemed to have taken exception to being dismantled and had decided to stop responding to keypresses properly. After a disappointing hour or two where I thought I'd broken my calculator I determined that my calculator, even though it looked pristine, had actually had some battery leakage in the past. This seems to have caused some problems with the keyboard scanning, which I fixed by giving the keyboard PCB a good scrub.
With the keyboard reliable again, i was ready for the CR80 cards to arrive. Which they did. I put them on the CNC and milled some slots.
I used a 20 degree D cutter for this, at a low rpm to avoid melting the plastic. A 10 or 15 degree cutter is better. (Note: I have now moved to a 0.55mm end mill)
Trying the card was disappointing, as it didn't seem to work. I couldn't get a card to store a program. As a last resort before giving up, I soldered some wires on the card read/write head and looked at the recording signals on my scope. I was interested in the data format and even if I didn't get my cards working then at least I'd be able to work out what the data format was and why there were 85 slots (for 127 steps, odd number). I was also wondering if the card reader was faulty in my machine. Looking at the recording waveforms
they looked healthy, so I looked at the read waveforms. They also looked healthy:
In fact they looked very healthy, and I thought that maybe I was pulling the cards through too fast. I slowed down the pull speed and success! I managed to record and read a card. Oddly, from that point on I have had no real problems recording and reading cards. I have also tried to pull them through too fast and too slow, but they just work, so I'm not sure why I had a problem before.
So, I can make cards for the machine. They take a while to mill, I have to mill twice, once for the cut and once to clean it up, and I have to use a scalpel to clean the swarf off the slots, but they do work.
Here's a video of me using one of the cards:
Making your own
If you want to do this, here's some details:
I used:
LO-CO cr80 blank PVC cards
0.2mm D 20 degree cutter (10 degree or 15 degree is better) i have now moved to using a 0.55mm end mill to cut the slots.
3D printed CR80 holder https://www.thingiverse.com/thing:3571814
Gcode file to cut slots (on Thingiverse page above)
CNC 3020 (generic CNC milling/engraving machine)
Saturday, 20 April 2019
Cheap DRO Revisited
I thought it was time I revisited the cheap DRO, so I have put the files on github and made a video showing it all working. The files are very much a dump of my code and PCB files, there's no guarantee it will build.
It's a start though, if you want to have a go at making one. The video shows the physical arrangement and also shows the update rate.
I milled the PCBs on my CNC3020, so they were very cheap, if you were to have them made then you'd probably want to reduce the size quite a bit, or the cost could be quite high. They are all single sided.
I have not put it in a case, I have mounted it up high in the workshop so chips don't get to it (I only have a mini-lathe and mill, so they don't throw things about much).
I think the cost I gave of £150 is probably quite a bit on the high side, as I milled the PCBs, which is cheap and used cheap calipers. Some discrete components came from my parts bin, too.