Monday, March 9, 2026

Decoding Melco Embroidery Disk Format

 I did not get any documentation along with the pattern disks to tell me whats on them, the printed labels only give me filename codes but nothing more. The pattern distribution company does exist still, and i can search their website to look up patterns which is helpful but dealing with hundreds of floppies is not particularly practical.


This is a perfect excuse to test out my greaseweazel, i can't read the floppies directly without using EDS III which likes to crash alot for some reason or another. I think the copy protection dongle that plugs into the parallel port might be dying, whatever the case i can just read the disks as analog and rebuild the data as raw disk images and just extract the files from the images after sorting out the filesystem structure. 




It takes roughly 80 seconds per disk so this should take somewhere around 17 hours just reading disks continuously.


The filesystem itself just seems to be some sort of FAT12 derivative, im pretty sure alot of this dates from the mid 80s so its not too complicated. The first 16 bytes of the disk just indicates the number or sectors the disk has plus the starting address of the file table. Each 16 byte line of the file table provides a filename, length in bytes and starting position of the sector that stores a list of sector addresses the file occupies. The sector size is 256 bytes, 80 tracks, 9 sectors per track.

It only took me a few hours to sort though the file-structure after building a few disk images and comparing it to some files exported using the existing software. The CND files themselves are a type of vector format, which needs to be converted into actual stitch values to be used by the machine.


It only took about 60 lines of python and i was able to extract the files, so all i need to do is suffer through reading all of the disks and build a database of all the files so i can sort of whats what. I found a python embroidery package that i might be able to use to generate preview images and convert to other formats. Which would be useful since i found a few cases where the previous owner overwrote some of the original pattern files on some of the disks so even by filename i won't be guaranteed to know what I'll find.

Embroidery Machine Restoration

My most recent barn find ended up being a Melco EMC6-MTL embroidery machine, complete with an old celeron 500 "never obsolete" emachines computer with a copy of EDS III and roughly 750 floppy disks worth of patterns.




I am not sure how long the machine ended up sitting, but i ended up taking several weeks digging around for service manuals, scrubbing off years of sewing machine oil and cleaning several decades of lint and grime off of everything. As far as i can tell, the machine itself was well maintained and is in working condition but needs some much needed servicing to get it running smoothly.



I was not exaggerating about the number of floppies, there are boxes labeled 1 - 750 dual density disks and possibly just under ten thousand random patterns. Lots of fonts, random generic sports logos and themed collections such as holidays and whatnot. The disks themselves are some sort of proprietary format that can only be read by some commercial software, more on that later.



I was looking for a project to keep me busy, my plan is to make the machine operate headless and sort out exactly what i have on hand in pattern files.


Sunday, November 5, 2017

Pyranometer update

Data collection

I managed to do some work testing this weekend on the bare un attenuated sensor, its fairly overcast due to it being snowing being winter and all, the data goes from midnight to 6:00 pm. Seems to work fairly well so far although in the summer the intensity will probably saturate it completely. I will need to add a neutral density filter and amplify the signal.

Friday, November 3, 2017

homebrew pyranometer

Its been awhile since i've done any sensor projects so i figured i would take a crack at a pyranometer. The concept is relatively simple, essentially its a device that measures the radiative flux density of the sun.

The basic concepts simple, there are rather expensive scientific worldwide standards maintained that are designed to be very accurate and reproducible. Commercially produced models are calibrated against these under various classification standards. Not having access to one, the next best thing would be publicly available data recorded as geographically close as possible. Luckily the weather station at the airport in my city does take solar readings and provides live daily totals and monthly hourly totals.

The design:

There are 3 common types of pyranometers: photovoltaic, photodiode and thermopile. To start I went with a PIN type photodiode the BPW34 configured in a reverse bias mode. Since photodiodes performance is affected by temperature i threw in a TMP36 temperature sensor giving me -40 to 125c readings at +- 2 degrees of accuracy.

The short circuit amperage is roughly 1.86 milliamperes, with a bias voltage of 5 volts requires a resistor value of 2688.2 ohms. I used a 250 ohm 0.01% resistor along with a 5k screw turn potentiometer in series to provide an adjustable value.




This will provide a decent voltage response rate that will be easily measurable by an adc. The remainder of the electronics is an old arduino and a data logger shield i dusted off out from a drawer somewhere. 5 bolts reference with a 10 bit  adc is about 0.005 volts resolution. Using an rtc for timing i figure making an averaged sampling once a second should do nicely.

The code:


#include <Wire.h>
#include "RTClib.h"

#include <SPI.h>
#include <SD.h>
SdFile root;
File dataFile;
const int chipSelect = 10;

RTC_DS1307 rtc;

const int analogInPin = A0;
const int analogOutPin = 9;

unsigned int lightSum = 0;
unsigned int tempSum = 0;
byte count = 0;
float lightAverage = 0.0;
float tempAverage = 0.0;
DateTime now;
byte currentSecond = 0;
char filename[13];

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
  rtc.begin();
  SD.begin(10);
  
  now = rtc.now();
  sprintf(filename,"%4d%2d%2d.csv",now.year(),now.month(),now.day());
  Serial.println(filename);
  dataFile = SD.open(filename, FILE_WRITE);
  if (!dataFile) {
    Serial.println("cannot create file");
    return;
  }
  else {
    Serial.println("create file");
  }
}

void loop() {
  if (count > 63){
    lightAverage = (float) lightSum;
    lightAverage /= 64.0;

    tempAverage = (float) tempSum;
    tempAverage /= 64.0;
    tempAverage = ((tempAverage * (5000.0/1024.0)) - 500.0 ) / 10.0;
    
    dataFile.print(lightAverage);
    dataFile.print(',');
    dataFile.print(tempAverage);
    dataFile.print(',');
    now = rtc.now();
    currentSecond = now.second();
    
    dataFile.print(now.year(), DEC);
    dataFile.print('/');
    dataFile.print(now.month(), DEC);
    dataFile.print('/');
    dataFile.print(now.day(), DEC);
    dataFile.print('T');
    dataFile.print(now.hour(), DEC);
    dataFile.print(':');
    dataFile.print(now.minute(), DEC);
    dataFile.print(':');
    dataFile.print(now.second(), DEC);
    dataFile.println();
    dataFile.flush();
    while (currentSecond == now.second()){
      now = rtc.now();
      delay(10);
    }
  
    count = 0;
    lightSum = 0;
    tempSum = 0;
  }
  else {
    count++;
    lightSum += analogRead(A0);
    tempSum += analogRead(A1);

    delay(10);
  }
}

Nothing special to look at here, 10 bit sampling means a 0 to 1023 value, the atmega 32 has 16 bit unsigned integers so that is 64 samples cast into a float for the division to prevent rounding errors during accumulation. I could do some weighted averages or something to get around the limitations but this is fine. Samples are performed once every 10 milliseconds for both light and temperature readings. There probably should be a delay between the two readings but as a rough evaluation this is fine to start with. The output is simply written to a csv date stamped to the start of acquisition.

Saturday, October 18, 2014

Telecine Projector: Hardware Details

Quite a few years ago I did a digitization project for a number of 8mm reel to reel home movies. The setup was pretty simple: an old brownie projector, a large screen and a Hi-8 camera. The result was adequate for the time, but required quite a bit post processing to clean up. Film can run at 16 to 18 ish frames a second while the camera ran at 24 static. The color was off, everything was either too dim or over exposed. Additionally when a frame is advanced it is blocked off momentarily to prevent blur during pull-down, this is made more periodic to make it less noticeable to the human eye but causes serious issues with video cameras recording at a faster rate. At the time it took me 6 months to process mpeg-2 video, having to clean up frames one by one at times. This was around 2005 and my phone now is several times more powerful than my computer was then, the results were pretty good considering the resources at hand.

Sometime afterwards I acquired an old 8/Super 8 projector and decided to take another crack at this, having squired 50 or so more reels that needed digitizing. The first step was to gut the entire projector of its electrical, fabricate a new takeup reel and make modifications to the film gate.


Gutting the projector was the easy part, other than the lamp housing and the transformer there was little else in this thing.


Regarding the film gate, a sizeable portion of the film is not seen on the projection. The image is cropped down so the perforations are not visible along with the intermediate region between frames. Since i want to capture as much of the film as possible I enlarged the gate as much as possible for both Super-8 and Regular-8 Film



The original take up reel was missing so I ended up adapting one from an old reel to reel magnetic tape player, it fits and the wobbly thing on the end that allows the reel to hold tension in one direction while allowing the projector to go in reverse works.



I decided fairly early on to use an arduino for the brains of the projector. There isn't much requirements wise: control the brightness of the bulb, advance to the next frame, load film so i picked a fairly cheap easy to program Arduino and a motor control shield and called it a day.



The lamp was a bit of a tight fit, i needed sufficient material to act as a heat sink while allowing for enough room for a reflector without it touching the claw down mechanism. I used a 5300K CREE X-RE led module in a small drop in module cut down to size bolted onto a 1/4 inch thick piece of aluminium that i managed to cut down and make fit.



In order to drive the LED properly I threw together a simple NPN sink drive circuit with a 10 ohm 2 watt resistor in series. Generally driving a power LED with a resistor for current limiting is a bad idea but in this case the load is so small the chance of overheating and the resistor allowing too much current is not a concern.



In order to advance by a single frame I needed a way of knowing when the claw mechanism finished pulling down the next frame, fortunately them main drive pulley controls this directly via a notch on the side that pushes down a little spring arm. So using a black mark on the drive wheel and a photo reflective sensor this is easily achieved.



The original switch control has a position for threading the film that moves some channels to get the film to bend in the right shape. Back when I did this I was lazy and didn't probe out the original switch so I ended up mounting a mechanical switch where I could detect the mechanical position instead.



For the purpose of threading I installed a photo interrupt switch to detect the leader, since its more or less useless for detecting the film itself since it barely absorbs infrared light. 



Most of the hardware modifications ended up being straightforward however the camera took quite a bit time to get right. I ended up choosing a logitech c600 webcam for the imaging sensor, at the time it was the highest resolution 4:3 webcam available for end users. It took longer to find appropriate lenses that had a short enough focal point while being adjustable. I ended up going with a surplus machine vision 22mm lens that screwed into a brass bushing. The dimensions were perfect for it so slide into the mount that held the original projection lens. I glued the webcams lens mount to some scrap plastic that allowed the sensor to be centred in the bushing. The lens had a gear machined into it i ground off to make it fit flush to the projector.


I added a small heatsink to the lcd to try and keep it cool in an attempt to keep it cooler to reduce noise. No clue if it will help but doesn't hurt. The power supply is just an old atx psu i wired up for 12v and 3.3v power nothing special.

Tuesday, October 7, 2014

Hand Gattling Cannon Thingie

After some finagling with parts to make a good fit I managed to finish at least one of these, most of the work was building a cable harness connecting the switch, battery pack and the motor. The rest was finding acceptable materials for a friction drive for the motor.





It works reasonably well for a random prop idea cobbled together from scrap aluminium from a hard drive, curtain rods and a wine chiller.


Saturday, February 23, 2013

Light Table

Simply because i wanted to clear up some space currently being taken up by spare parts i built a light table. Basically its the front bezel and backlight from an old monitor, a ccfl driver and 12 power supply, a sheet of glass and a leg from an old portable barbecue.