Tuesday, August 24, 2021

Deep dive into phototransistor/LED and related circuitry in M1000

ISOLATING PHOTOCELLS AND CHECKING THEM OUT

Because the flawed behavior was the same when I swapped the board from my M600 reader, I suspected the problem was between the connector and the photocells, not on the PCB. In order to test it, I wanted to isolate it from the rest of the machine and verify that each of the twelve channels are working properly.

The schematic shows all twelve LEDs with their cathodes tied together and to ground. The LED anodes are wired to a resistor board, with a resistor connected to VCC. The other side of the channel, through which the punched card passes, is a set of twelve phototransistors.

All the collectors of the twelve transistors are tied together and to VCC. The emitters are brought to the connector to the Control PCB. On that board, each signal is connected to the input of an inverter and to a 5.6K ohm resistor to ground. 

Since I have the PCB disconnected, I set up a breadboard with a 5.6K resistor to ground which can be connected to each phototransistor's emitter to test what voltage is developed at the emitter. When the light is blocked by a punched card, the transistor is cut off and the emitter voltage is essentially zero. Without a card in the way, or with a hole in the card, the transistor conducts which pulls the emitter voltage to a positive level. 

All that is needed is to supply 5V to the phototransistor collectors and to the resistor board, which will light the LEDs and let me test the voltage with and without a card between them. I opened the bottom of the card reader to locate the resistor board.

DISCOVERY ABOUT THE RESISTOR BOARD

Unlike the schematic which suggests a single fixed resistor for each channel, the board in the reader has variable resistors to adjust the LED current individually. 

board as depicted on the schematic

actual resistor board

DISCOVERING A PROBLEM AND CORRECTING IT

After having isolated the LEDs and phototransistors, I measured the voltage for each of the 12 channels. Rows 12, 11, 0, 1, 2, 3, 4, 5, 6, and 7 showed just over 3V when no card was present and dropped to almost zero when blocked by a bit of cardboard. 

However, the unblocked levels for rows 8 and 9 were just a tad over 1V. That explains the sporadic pulses of OneDark and erratic behavior. The voltage is not a valid level as an input to an inverter, it is in the forbidden zone. The output of the inverter is undefined and can produce the behavior I saw.

I used a small screwdriver to adjust the levels until rows 8 and 9 were around 3V like the others. They still drop to nearly zero when blocked. 

MUCH IMPROVED RESULTS SO FAR

I now have a very reliable OneDark signal. It is solidly off when no cards are in the reading station. Putting the scope on it, I see that it goes on solidly for the duration of each card passing the station and off again after it passes. If I had a card with all twelve rows punched out in some columns, the OneDark would wiggle, but the actual cards I have only have some holes in each column. 

I did a run on the logic analyzer while running two cards through the machine using the Local mode which automatically picks each card until the hopper is empty. With a limited memory in the analyzer, able to hold just over 2000 clock cycles of data, I couldn't fit an entire card cycle in memory.

I triggered on the start of the PCLK clock that begins with a pick, then with the arrival of a 1 for OneDark. I was leaving for the day so I only did a superficial examination, but all the signals I checked were behaving exactly as they should. 

The reader turned on GPR, good pick reset, stopped the PCLK and began to count with OSCLK to determine the time offset from the edge of the timing tooth to the time when OneDark when on. It then counted with OSUCLK on every other tooth passing, to add in the offset to time the middle of each column. 

I saw the machine raise the 0CR signal when it recognized the start of the card. I saw each column come by, up until the buffer had filled. I didn't verify every individual signal, but will do that when I next get to the workshop.

No comments:

Post a Comment