ATTACHING 1627 PLOTTER TO IBM 1130
The IBM 1627 Plotter is a private labeled and slightly modified version of the Calcomp 565 or Calcomp 563 depending on the model of the 1627. It moves continuous paper forward and backwards over a drum, with a pen that moves left and right along the drum. The drum and the pen move in increments of 1/100 inch to draw graphs and other images. The pen can be raised to move without drawing and then lowered to put ink on the paper.
IBM supports the plotter by installing a double width Solid Logic Technology (SLT) card into a specific pair of sockets in one compartment of the 1130. This 5806223 card implements the device controller logic to permit software running on the 1130 to draw using the plotter. A cable from the 1627 has two Standard Modular System (SMS) paddle cards that plug into the 1130, one providing 115VAC power and the other connecting signals between the 1627 and 1130.
The 1627 is a very simple device. Pulses into the machine command movements, which the plotter accomplishes, but does not provide any feedback to the 1130 about movements or status. The only signal from the 1627 connects to an internal power supply that produces -24V, thus the 1130 can see if the wire is at -24V to determine if the 1627 is connected and powered on.
The controller card in the 1130 responds to the 1130 instruction XIO (execute input output). If an XIO with the device address of the plotter - area code 5 - is issued, the controller card looks at the contents of a memory location pointed to by the XIO instruction.
The first six bits of the word at the memory location are used to request one or more movements. Movements can be combined in one XIO instruction of type Write. Going from left to right, they request:
- Drop the pen down onto the paper
- Roll the drum upwards (backwards on paper)
- Roll the drum downward
- Move the carriage with the pen to the right
- Move the carriage with the pen to the left
- Raise the pen up from the paper
The controller generates the proper duration pulse to the 1627 to cause the movement. It also maintains status of what it believes is happening in the 1627 since there is no feedback from the plotter. When the controller believes the movement has completed it raises a request to the 1130 to interrupt the currently executing instructions and instead execute interrupt handler software.
An XIO instruction of type Sense Device is used to see the status as the controller card sees it. The card sets bits that the XIO Sense Device will place in the 1130 Accumulator (ACC) register for interrogation by software. When the controller is requesting an interrupt, bit 0 is set to 1; this is interpreted as operation complete. If the 1627 is not powered on or not attach, the lack of the -24V will cause the card to report the plotter as not ready by setting bit 15 to a 1. Finally, if an XIO Sense Device is issued after an XIO Write but before the interrupt is requested by the card, then bit 14 is set to 1 to indicate that the plotter is busy accomplishing some movement.
The more common model of the 1627, model 1, takes about 3.9 milliseconds to complete a movement of the drum or carriage. Raising or lowering the pen takes about 100 milliseconds to complete. Thus the time from an XIO Write to the interrupt request is 3.9 or 100 ms. Bit 14 reports the plotter is busy during those intervals.
DISCOVERED SUBTLETY IN BEHAVIOR
In reading the 1130 Functional Characteristics manual which informs programmers how instructions and peripheral devices will behave, I discovered something I had missed in my earlier implementation. If the 1627 is not powered on or not connected to the 1130, when an XIO Write is executed for the plotter, the machine will immediately generate an interrupt request. Thus an XIO Sense Device immediately after the write will return bits 0 and 15 set to 1 without the time delays that occur if the request went to an operational plotter.
VALUE OF A SOFT IMPLEMENTATION USING AN FPGA ON THE CARD
My first implementation of a substitute for the 5806223 IBM card used multiple integrated circuits including timers and other combinatorial logic. I switched to a card that uses a Digilent CMOD S7 FPGA as a daughterboard and just a couple of glue logic chips.
This makes it very simple to change the functionality to include the behavior when the 1627 is not ready so that it does trigger the interrupt request immediately after an XIO Write. Had I not used the FPGA which can be reloaded, as in the earlier implementation, I would have had to redesign and probably manufacture a new printed circuit board.
Two thoughts:
ReplyDelete1. What is the expected behavior if the command requests two contradictory behaviors? For example pen left and pen right?
2. This may already exist, but it would be nice to be able to capture the plotter command stream, and later play it back, for example to a laser printer or svg file.
If simultaneous conflicting movements are requested (up&down, left&right or raise&lower), the reversable ring counter for that direction of movement most likely does not change state, therefore no movement occurs.
DeleteI am wary because the conflicting pulses are generated by separate single shots with nominally the same duration, but component variations can mean they are not truly simultaneous for the entire 1.5 ms. The counter might end up in an invalid state requiring a power cycle to reset it to a 1 hot condition to restore movement.
The IBM controller logic does not check for conflicts nor prevent them. Neither the IBM nor the Calcomp documentation covers conflicting movement requests. The IBM Functional Characteristics makes no statements about combinations of the bits other than the eight movement combinations 45 degrees apart.
If a pen raise is commanded simultaneous with drum or carriage movements, I suspect that the ink is drawn before the pen moves up enough to remove the nib from the paper. Pen lower is going to have completed the movement of the drum/carriage prior to the nib reaching the paper. This is because the pen solenoid takes 50ms to operate while the stepper motors for the drum and carriage operate in a bit less than 2 ms for the model 1 plotter.
Richard Stoffer, in his FPGA based 1130 emulator, did develop a plotter substitute that would capture the XIO Write data and generate postscript commands sent over Ethernet to an HP Laser printer. Since the Functional Characteristics is mute as to the behavior of conflicting movements of the drum or carriage, I doubt he did anything specifically to model the outcome.
If I were to capture the plotter commands, I could put them in RAM on the CMOD S7 board. I suppose I could use the USB interface on that board to request a download of the stored movements (and housekeeping such as clearing the buffer before a graphic job started). That would be a more substantial task than the controller logic I am currently implementing, thus I would need to feel there was enough payback for me to warrant the extra design and testing work.
Since the card and its FPGA logic are open source under the MIT license and will be on Github, someone who did have the use case or need could enhance what I built to add this.