Abstract:
Circuitry for controlling the margin of a laser printer is provided which times a preset margin on a first scanline of a page at high frequency for high accuracy. Thereafter, subsequent scanlines on the page are positioned responsive to the count generated responsive to the preset margin. Hence, the laser may be directly modulated at speeds higher than the standard frequency without a reduction in the relative accuracy of the margin.

Description:
TECHNICAL FIELD OF THE INVENTION 
     This invention relates in general to computer peripherals, and more particularly to a method and device for accurately and automatically locating margins produced by a laser printer. 
     BACKGROUND OF THE INVENTION 
     Laser printers form an image on paper similar to that of a photocopy device. A photocopy device forms an image on a print drum by exposing chemicals on the drum to a light source. The chemicals are then washed off, except in the regions of exposure. The exposed regions will pick up ink and transfer the ink to paper which is pressed against the drum. 
     A laser printer exposes an electrically charged drum which is permanently coated with a photosensitive insulator. The exposed regions electrically attract particles of ink or &#34;toner&#34;. This toner is then transferred to paper by applying a charge to the paper causing the toner to move from the drum to the paper. 
     Typically, laser printers are designed around a print engine manufactured by a third party. The basic components of the print engine are the laser, a drum, and a rotating mirror which directs the laser beam in a straight line across the drum (the &#34;scanline&#34;). In order to generate the image, the laser beam is pulsed on and off as desired while the mirror rotates to expose dots on the drum. 
     Importantly, each print engine is adjusted at the factory to ensure that the first dot on each scanline is precisely aligned. In most cases, the laser scans across the drum from left to right; however, the alignment problem exists regardless of the direction of the scanning. In order to align the first dots on each scanline, a sensor placed to the left of the drum detects the laser beam prior to the beginning of the scan. Once the laser beam is detected by the sensor, the beam is disabled for a predetermined number of clock cycles. When the predetermined number of clock cycles have expired, the laser is enabled to begin pulsing to form the image across the scanline. The distance between the sensor and the start of printing is referred to as the &#34;margin&#34;. It should be noted that the number of clock cycles between sensing the laser beam and enabling the laser will vary depending upon the paper size. Accordingly, a number of predetermined margins are supported by the engine to accommodate various standard paper sizes. 
     Each print engine is tuned at the factory, by adjusting the number of clock cycles of delay after sensing the beam, such that the left margin will typically be accurate within 1/4 of a dot using the print engine standard frequency. Thus, for a 300-dot per inch print engine, the left margin will be accurate within 1/1200th of an inch. 
     Many print engines also allow direct control of the modulation frequency of the laser beam, thereby determining the resolution of the printer. For example, for a 300-dot per inch laser print engine, doubling the modulation frequency of the laser would result in a scanline resolution of 600-dot per inch. However, alignment of the left margin is accurate only within 1/4 dot at the standard frequency. Thus, for a 300-dot per inch engine, the accuracy of the left margin is within 1/4 of a 300 dpi dot, or 1/2 of a 600 per inch dot. Consequently, while the print engine is controlled externally at a higher frequency, the relative accuracy of the margin control will suffer. 
     A current method of externally controlling the left margin requires that the engine communicate, via a serial communications channel, the number of dots for the margin. This value is typically stored in non-volatile memory inside the print engine. This data is determined for each engine at the time of manufacture. The engine, when requested, transmits this information to the controller. The controller then replicates the margin at the desired resolution ensuring precise margin placement. This process, however, requires that the controller microprocessor and the engine microprocessor communicate this information for each page. This consumes hardware resources and slows the controller microprocessor in its main task of generating the image in memory. 
     Thus, a need has arisen in the industry to provide an accurate, automatic method and device for determining an accurate margin in a laser printer. 
     SUMMARY OF THE INVENTION 
     In accordance with the present invention, a method and apparatus is provided for accurately defining a margin in a print engine. Sensing circuitry in the print engine senses the engine&#39;s print medium at a first location on a scanline and generates a first signal responsive thereto. The time between the first signal and movement of the print medium to a second location on the scanline is measured. Thereafter, for each scanline, a control signal to enable printing is generated after receiving the first signal and waiting for the measured elapsed time to expire. 
     The present invention provides significant advantages over the prior art. Because the initial margin is timed at a high accuracy, the alignment of the margin will be accurate within a predetermined error margin relative to the scan rate. Thus, the print engine may be modulated at a various frequencies without affecting the accuracy of the margins. In addition, the accurate placement of the margin is done without intervention by the engine or controller microprocessors, thus allowing faster overall operation of the printer as a whole. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     For a more complete understanding of the present invention, and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which: 
     FIG. 1 illustrates a schematic representation of the major components of a print engine; 
     FIG. 2a illustrates a margin setting circuitry used in the print engine of FIG. 1; 
     FIG. 2b is a timing diagram illustrating the signals generated by the margin setting circuit of FIG. 2a; 
     FIG. 2c shows a block diagram of a current circuit for alignment of left margin; 
     FIGS. 3a-c illustrate page layouts demonstrating the problems associated with operating the print engine of FIG. 1 at a high scan rate; 
     FIG. 4 illustrates a block diagram of the margin setting circuit of the present invention for providing accurate margin placement at a higher scan rates; 
     FIG. 5 illustrates a state diagram describing operation of the circuit of FIG. 4; 
     FIG. 6 illustrates a detailed schematic representation of the circuit of FIG. 4; and 
     FIG. 7 illustrates a timing diagram for the circuit of FIG. 6. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The preferred embodiment of the present invention and its advantages are best understood by referring to FIGS. 1-7 of the drawings, like numerals being used for like and corresponding parts of the various drawings. 
     FIG. 1 illustrates a schematic representation of the major components of a laser print engine 10. Print engine 10 comprises laser 12 which reflects beam 14 off rotating mirror 16 onto drum 18. In the illustrated embodiment, mirror 16 rotates such that beam 14 scans from left to right across drum 18. Prior to impinging drum 18, the reflected beam 14 impinges sensor 20. Responsive to sensing the reflected laser beam 14, sensor 20 outputs control signal (SOS). The SOS signal signifies that the reflected beam 14 has reached a predetermined position in its path. From this predetermined position, the left margin 22 (the lateral position on the drum 18 at which printing begins) may be determined. 
     FIGS. 2a-b illustrate the print engine&#39;s circuitry 23 for setting the left margin 22, and timing diagrams of the signals generated thereby, respectively. In FIG. 2a, a clock 24 decrements a counter 26 which has been previously set to a predetermined count. The counter is enabled upon the trailing edge of the SOS signal. The laser beam is disabled responsive to the SOS signal. When the counter reaches zero, a line sync (LSYNC) signal is output. On the leading edge of the LSYNC signal, the laser 12 is enabled such that printing to the drum 18 may begin. As shown in FIG. 2b, LM represents the time that it takes the reflected laser beam to rotate from the sensor 20 to the desired left margin 22. It should be noted that the position of the desired left margin 22 may vary depending upon the paper size being used. 
     FIG. 2c illustrates prior art circuitry for generating the left margin externally from the print engine. The print engine microprocessor 100 retrieves a number from non-volatile memory 102 indicating the number of dots for the left margin. This information is sent to the controller microprocessor 104 via a serial channel. The controller microprocessor 104 loads the information to the counter 106 which replicates the left margin at the desired resolution. This process must be repeated for each page. This circuitry places an additional burden on the controller microprocessor 104, reducing the performance of its main task of generating the image in memory. 
     FIGS. 3a-c illustrate the problems with operating the print engine of FIG. 1 at a higher frequency to obtain a higher print resolution. In FIG. 3a, each dot at the left margin is aligned within 1/4 of a dot at the standard frequency of the print engine. However, as shown in FIG. 3b, at twice the frequency (and hence, twice the resolution), the margin setting circuit of FIG. 2a aligns the higher resolution dots within 1/4 dot of a standard frequency dot. At twice the standard frequency, the dots will be aligned only within 1/2 of the higher resolution dot. The resultant effect is illustrated in FIG. 3c wherein a vertical line will appear to have perturbations along its length where one or more dots are misaligned. 
     FIG. 4 illustrates a margin control circuit 28 which operates in conjunction with a print engine 10 to provide accurate margin settings without intervention of the engine microprocessor or controller microprocessor. The margin control circuit 28 receives four control signals: LSYNC and SOS from the margin setting circuit 23 of the laser print engine 10, CPAGE, which is received from the print engine and indicates the start of a new page, and 4*MAX --  CLOCK which is generated external from the print engine. The 4*MAX --  CLOCK signal is a clock which is set to four times the frequency for a given resolution. For example, if a 15 kHz clock signal is used for 300 dpi resolution, then a clock signal of 30kHz would be used for 600 dpi resolution. The 4*MAX --  CLOCK signal would then be set to 120 kHz. The four control signals are input to first stage counter and logic circuitry 30. The output of first stage counter and logic circuitry 30 is input to the second stage counter and logic circuitry 32 along with the 4*MAX --  CLOCK and SOS control signals. F --  LSYNC, representing LSYNC for the first scanline of a page is output from first stage counter and logic circuitry 30 to laser control logic 34. The output of second stage counter and logic circuitry 32 (S --  LSYNC), representing the start of each subsequent scanline, is input to logic 34, along with the F --  LSYNC signal. The output of logic 34 is the LMEND signal, which enables the laser 12 to start printing. 
     Operation of the margin control circuit 28 is described in connection with the state diagram of FIG. 5. When the CPAGE signal indicates that a new page has been encountered, the margin control circuit 28 transitions to state 36, indicative of placement at the first line of a new page. On receiving the SOS signal, indicating that the beam has impinged sensor 20, the margin control circuit 28 transitions to state 38. In state 38, the first stage counters are incremented at the 4*MAX --  CLOCK frequency. The counters are incremented until receiving the LSYNC signal from the laser print engine 10. Hence, in state 38, the first stage counters have timed the interval between SOS and LSYNC at a resolution of four times the frequency which will be used to control the laser 12. 
     On receiving the LSYNC signal from the print engine 10, the first stage counters are stopped and the F --  LSYNC signal is enabled (state 40). For the first scan of a new page, logic 34 passes the F --  LSYNC signal to the laser 12 to enable printing. The 1&#39;s complement of the number derived by the first stage counters is loaded into the second stage counters 32 in state 42. Upon receiving the SOS signal, indicating that the laser has impinged the sensor 20 on the second scan, the second stage counters 32 are incremented responsive to the 4*MAX --  CLOCK signal (state 44). When the second stage counters reach zero, the S --  LSYNC signal transitions high. For the second and subsequent scans, the logic 34 passes the S --  LSYNC signal to the laser 12. Hence, when the second stage counters reach zero, the laser is enabled in state 46. While CPAGE is low, the second stage counters will be reloaded with the 1&#39;s complement of the number derived by the first stage counters in state 42. Hence, each scan subsequent to the first scan will use the second stage counters to determine the left margin. The cycle between states 42, 44 and 46 will continue until CPAGE transitions high, indicating a new page. At this point, the margin control circuit 28 will return to state 36. 
     Hence, the margin control circuit 28 uses the factory set margin of the laser print engine 10 to define the left margin on the first scan. All subsequent scans will begin within 1/4 dot (at the frequency driving the laser) of the margin set on the first scan. Hence all dots in a vertical line will be aligned within 1/4 dot, regardless of the frequency used to modulate the laser. 
     FIG. 6 illustrates a detailed block diagram of a preferred embodiment for implementing the margin control circuit 28. J-K flip-flops 48 and 50 have clock inputs coupled to the SOS and LSYNC signals, respectively. The J inputs of the flip-flops 48 and 50 are coupled to ground via pull-down resistor 52 and K inputs are coupled to V cc  via pull-up resistor 54. The preset input of J-K flip-flop 48 is coupled to the CPAGE signal. The Q output of flip-flop 48 is coupled to the preset input of flip-flop 50. The Q outputs of the flip-flops 48 and 50 are coupled to the inputs of an XOR gate 56. The Q output of flip-flop 48 is referred to as the START --  CNT signal and the Q output of flip-flop 50 is referred to as the F --  LSYNC signal. Counters 58a-c are coupled such that the ripple carry output of counter 58a is coupled to the T input of counter 58b and the ripple carry output of counter 58b is coupled to the T input of counter 58c. The output of the XOR gate 56 (the LMCNT --  EN signal) is coupled to the T and P inputs of counter 58a, and the P inputs of counters 58b and 58c. The CPAGE signal is coupled to the CLEAR inputs of the counters 58a-c The 4*MAX --  CLOCK signal is coupled to the clock inputs of the counters 58a-c. The load inputs of the counters 58a-c are coupled to V cc  via pull-up resistor 60. The outputs of the counters are coupled to respective inverters 62, thereby producing the 1&#39;s complement of the output of the counters 58a-c. The output of the inverters 62 are coupled to respective inputs of counters 64a-c. The 4*MAX --  CLOCK signal is coupled to the clock inputs of counters 64a-c. The SOS signal is coupled to the load inputs of the counters 64a-c. The CLEAR inputs of the counters 64a-c are coupled to a RESET signal provided by the control circuitry of the laser printer. The F --  LSYNC signal is coupled to the preset input of D flip-flop 66 via inverter 68. The Q output of D flip-flop 66 is coupled to the T and P inputs of counter 64a and to the P inputs of counters 64b and 64c. The ripple carry output of counter 64a is coupled to the T input of counter 64b; the ripple carry output of counter 64b is coupled to the T input of counter 64c. The Q3 output of counter 64c is coupled to the clock input of flip-flop 66 via inverter 70. The D input of flip-flop 66 is coupled to V cc  via pull-up resistor 72. The Q output of flip-flop 66 (the LMEND signal) is coupled to V cc  via pull-up resistor 74. The CLEAR input of flip-flop 66 is coupled to the SOS signal. 
     Operation of the circuit of FIG. 6 is best understood in connection with the timing diagram of FIG. 7. Responsive to a pulse by the CPAGE signal, the counters 58a-c are cleared, the Q outputs of flip-flops 48 and 50 are set to &#34;1&#34; and the Q outputs are set to &#34;0&#34;. Upon a pulse on the SOS signal, the Q output of flip-flop 48 transitions low, thereby forcing the output of XOR gate 56 (LCNT --  EN) high. The LCNT --  EN signal remains high until the LSYNC signal is pulsed, thereby forcing the Q output of the flip-flop 50 low, and consequently forcing the LCNT --  EN signal low. When the LCNT --  EN signal is high, counters 58a-c, which are connected to form a 12-bit counter, are enabled to count at the frequency given by the 4*MAX --  CLOCK signal. When LSYNC is pulsed, the Q output of flip-flop 66 is forced high, thus generating a high LMEND signal. The LMEND signal starts the printing for each scanned line. The LMEND signal remains high until the subsequent SOS signal is pulsed, which triggers the clear input of flip-flop 66, bringing the LMEND signal low. Simultaneously, the second stage counters 64a-c are loaded with the outputs of inverter 62 (i.e., the 1&#39;s complement of the output of counters 58a-c) and the counters 64a-c are enabled to count at the rate provided by the 4*MAX --  CLOCK signal. When the count reaches zero, the Q3 output of counter 64c will transition low, thereby clocking D flip-flop 66 and forcing the LMEND signal high. This signal starts the second scanline for the page. Subsequent scanlines are repeated by preloading the counters 64a-c and counting to zero. The cycle continues until CPAGE is enabled, at which time the flip-flops 48, 50 and 66 are reset. 
     While the present invention has been described herein as using a clock frequency (4*MAX --  CLOCK) which is four times the frequency driving the laser, a fixed rate clock which was four times the frequency at the highest resolution could also be used, which will increase the relative accuracy at lower print resolutions. Also, the desired left margin resolution could be varied, i.e., a factor such as 3x or 8x could be used rather than the factor of 4x described herein. Furthermore, while the invention has been described in connection with laser print engines, it could be used with other engines, such as ink-jet print engines, which use a similar positioning mechanism in which the printing medium (the laser for a laser print engine and the print head for an ink-jet printer) can be timed between a determinable sensing location and the desired start of the scanline. 
     Although the present invention and its advantages have been described in detail, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.