TESTING AFTER THOSE CORRECTIONS
I plugged the emulator into the VCF 1130 system and ran my hand entered code to fire off characters and commands to the emulator. I needed to see it successfully handle a print, triggering the interrupt level so that I knew it had the correct feedback signals from my box. Without the feedback working, I can't do a shift nor test out the characters on the other hemisphere of the type ball.
The oscilloscope was set up to watch the feedback signals as further confirmation that they are reliably delivered into the 1130 system. I did not see enough swing in the signals to cause the 1130 controller logic to operate as intended. I have to throw in the towel and give up on using the N-channel enhancement MOSFETs - the only type I had in the shop.
THE PROBLEM WITH N CHANNEL MOSFET SWITCHING
The N MOSFET needs a positive voltage on its gate relative to the source, of a high enough differential to switch on the channel and pass current from the drain through the source (actually electrons flow from the source to the drain, but the conventional notation used in circuits has the current flowing from + to - terminals. That is why an N channel MOSFET has a positive voltage on the drain relative to the source.
The classic circuit for these is to have the source hooked to ground, the drain hooked to the + rail through a current limiting resistor, and the load being switched is hooked between the drain and the limiting resistor. An Arduino delivering 0V to the gate will keep it off since the gate is NOT more positive than the source. The high (+5V) output of the Arduino is positive enough for some N channel MOSFETS, although some require a higher differential, thus it can turn on the flow through the MOSFET and pull the load down to ground.
The situation with the 1130 and the 1053 is not the classic situation. The load line is pulling current from the + rail down to -3V inside the debouncer in the 1130. When the MOSFET is switched on, the load line jumps to nearly the + rail, when the MOSFET is off the load line is seen to be at -3V.
The drain of the N MOSFET is thus nearly at the + rail when the switch is off, but drops down to -3V when it is turned on. The gate is more positive than the source when the MOSFET is turned on, but we have to limit current through the resistor which drops the voltage sent to the debouncer circuit. When the switch is on, the current is flowing through the MOSFET in addition to going into the debouncer.
This gets more severe with one of the signals, which has a +48V rail, as the current limiting resistor is set for 2.5W of consumption yet that lowers the voltage to the debouncer too much to work reliably. In reality, the classic circuit does not work well for me.
The ideal use of the MOSFET switch is indeed as a switch, with the + rail on the drain and the debouncer circuit on the source with no current limiting resistor at all. That way it works purely as a switch, the perfect analog for the mechanical switches in the 1053 typewriter we are emulating. The challenge comes from trying to control it with the gate.
The source voltage is going to vary now, from -3V when the switch is intended to be open up to the + rail when the switch is closed. The gate has to be more positive that the source to turn it on, but that means it has to be more positive that the + rail. Unless I want to add additional power supplies above the 12 and 48 V rails of the 1130, this is not possible to do. I certainly can't do it with an Arduino's 5V logic high.
There is even the risk that some current will flow even when the Arduino puts out 0V, logic low, as that is 3V more positive than the source initially. The MOSFET is likely to turn on just enough to raise the source to a point where the gate-source differential is lower than its threshold.
P CHANNEL MOSFET IS THE SOLUTION
If I switch to a P Channel MOSFET and hook it up as a switch, the situation gets better. The rail connects to the source terminal, the drain is connected to the debouncer. The gate has to be more negative than the source terminal, but fortunately in this case the source is steady at the + rail, not varying as in the N channel case. We just need a way to get the gate to sit either at the + rail or about 8-10V below the rail, to have the switch off and on respectively.
That is provided by a simple NPN transistor and a voltage divider between the + rail and the collector. The emitter is hooked to ground and the Arduino will turn this on or off as it drives the base with logic high and logic low respectively. The transistor, when off, allows the MOSFET gate to see the full + rail voltage. When the transistor conducts, the pair of resistors in a voltage divider are sinking current to ground through the emitter.
Choosing the values of the two resistors lets me set the gate voltage I want the MOSFET to see when we want to turn it on. The MOSFET doesn't need any appreciable current to the gate, thus the resistors can have high values. If the upper resistor is 30K and the lower resistor is 10K, with a +12V rail, the junction of the resistors will drop to 3V when the transistor conducts. putting the gate about 9V more negative than the source.
Now this is simplified due to things like the diode voltage drop of the transistor and non-zero emitter-collector on resistance, but you get the idea. For the +48V rail, we can choose an upper at 18K and a lower at 47K to produce just under 35V at the junction and thus the gate will be 13V more negative than the source.
I will order some P channel enhancement, MOSFETs with suitable voltages and thresholds. I have plenty of switching NPN transistors on hand and enough resistors to create the voltage dividers I need.
No comments:
Post a Comment