Self calibrating PWM

Abstract: A circuit for producing an exact duty cycle for a system having a variable system clock frequency. In the calibrate mode, a waveshape with an exact duty cycle (e.g. 75%) is made by ANDing two or more clock pulse trains, each of which is a multiple of the system clock frequency (CLK). This is compared by a comparator (14) against the output of a current-controlled pulse width modulator (12) which is programmed to produce the same duty cycle. The polarity of the comparator (14) output as a result of the error between the exact duty cycle and the one produced by the modulator (12) increments or decrements a counter (13), the output of which controls a digital-to-analog converter (DAk) (11), which in turn corrects the output of the modulator (12). After a suitable number of interations, the modulator (12), which is now calibrated, will reproduce the exact duty cycle. The circuit is then put into the operate mode by disabling the counter (13), and programming the pulse width modulator (12) to output the desired system duty cycle (e.g. 75%).

Description: This invention is a circuit for calibrating the duty cycle of a pulse width modulation (PWM) system and more particularly is a closed loop feedback system for adjusting the duty cycle of a current controlled pulse width modulator to compensate for the long term variations of the system clock. In a laser printer, a fixed frequency data clock can not be used since the data rate must be variable to make up for the tolerances in the system. For example, such things as the image size and the rotational speed of the polygon can not be kept exactly constant, and therefore the data clock rate must be varied to compensate. A complication arises in a tri-state printer which deposits two different colorants onto the output hard copy in one pass. The colors are typically black and a highlight color of red, green or blue. In a tri-state xerographic system one of the toners is charged positively and the other is charged negatively. Then, by charging the photoreceptor with either positive or negative charges, two colorants can be applied to the photoreceptor in one pass. More specifically, the photoreceptor is originally charged to a first voltage, and then discharged either 0% for one colorant or 100% for the other colorant. In this system it is assumed that if the photoreceptor is discharged approximately 50%, it will attract neither colorant, and the result will be white, the color of the typical paper medium. Actually, the exact percent of discharge needed to get a pure white color may vary, depending on the individual system characteristics. Values of 15% to 70% are common, where 100% is full highlight color and 0% is black. Once the correct level has been found, it is critical that it be maintained. For example, if the highlight color is red and the white level is exceeded by only a few percent, the whole page will have a pink tint. In addition, as the frequency of the clocked data changes, the On and OFF times must vary accordingly to maintain the exact duty cycle. The amount of discharge is produced by pulse width modulation. For each pixel, the light will be on for a part of the time and off for the remainder. The actual duty cycle required for each system can be expressed as a binary number. For example, a duty cycle of 62 1/2%, expressed as an six bit number, would be 101000. Setting the duty cycle of a pulse modulation system is not difficult in a system with a fixed frequency clock. The complication here is that the system clock, as explained above, is also variable. The requirement here is that the ON time must be varied as the system clock frequency varies so that the duty cycle will remain constant while the clock frequency is allowed to change. EP-A-0469,586, which is a document falling under Art.54(3) EPC and is therefore not relevant to the question of inventive step, discloses a data generator for controlling pulse width. Input data for a pulse generator (10) are generated from source data corresponding to a desired pulse width in order to make the pulse generator (10) generate an output pulse having the desired pulse width. The source data are converted into the input data based on a pre-determined conversion relation; the predetermined conversion relation is varied; a width of an output pulse is compared with that of a calibration pulse having a predetermined pulse width; and a conversion relation between a calibration source data corresponding to the pulse width of the calibration pulse and the input data is maintained when the width of the output pulse coincides with that of the calibration pulse. The present invention provides a circuit for generating a signal of pre-determined duty cycle according to the appended claims. In calibration mode, one input to this circuit is a binary calibration number in the form of a digital electrical signal. As an example, let us assume that the circuit calibration number is 75%, expressed as a binary number, 110000. This number is applied to a pulse width modulation circuit to ultimately produce a first delayed waveshape. The other input is a set of system clock pulses of any frequency. The first clock is a square wave signal, the positive half of which coincides to one frame, or pixel, the second negative half of which corresponds to the next pixel. The second clock signal frequency is double that of the first and the third clock signal frequency is double that of the second. The second and third clock signal waveshapes are ANDed together to produce a second delayed waveshape that is ON exactly 75% of the time. The first and second delayed waveshapes are compared (summed), and if the falling edge of the first delayed waveshape occurs earlier, a counter is counted down. If the falling edge of the second delayed waveshape occurs earlier, the counter is counted up. Finally, the counter output is used to control the pulse width modulation circuit, ultimately to produce its delayed output at exactly the same time as that produced by the summed clock pulses. The result is that, for any system clock pulse frequency, an input calibration number of 0.75 results in the output of the PWM circuit having a duty cycle of 75%.. Having completed the calibration of the circuit the circuit is switched from calibration mode to program mode: the counter is disabled from further counting, and the calibration binary number is removed and substituted with a number which corresponds to the desired duty cycle, which the circuit will now produce accurately. In this way, the circuit will produce an accurate duty cycle at any clock frequency. An embodiment of the present invention will now be described, by way of example, with reference to the accompanying drawings, in which: Fig. 1 is a simplified block diagram of a circuit according to the invention; Fig. 2 is a detailed schematic diagram of the circuit of Fig. 1; and Fig. 3 is a timing diagram of the circuit of Fig. 2 Referring to Fig. 1, multiplexer 10 is controlled by a control signal (CALIB/ PROG ) that can select the calibrate or digital programming inputs of multiplexer 10. In calibrate, a six digit binary number is applied, expressing a calibration value. In this discussion it is assumed, for example, that the binary number 110000, representing 75%, is applied. This six bit number is applied to, as a digital electrical signal, the current-controlled pulse width modulator 12 which produces a first waveshape signal. At the same time, two system clock pulse signal, in the form of square wave signals at double and quadruple the frequency of the system clock (CLK), respectively, are added in the PWM reference generator 15 to produce a 75% duty cycle second waveshape signal. The two waveshapes thus produced are compared at the summer 14, the output of which either incrementing or decrementing the counter 13 depending on whether the falling edge of the second or first waveshapes, respectively, occurs first. The counter output is converted into an analog current in digital-to-analog converter (DAC) 11 which controls the current controlled pulse width modulator 12 to produce a slightly larger or smaller duty cycle, respectively. After a number of iterations, the output duty cycle of the modulator 12 converges to 75%. This concludes the calibration phase. In actual use (in program mode), the counter 13 is disabled from changing by the signal (CALIB/ PROG ) applied to the calibration control line of multiplexer 10, and a binary programming number, in the form of a digital signal, is applied to the latch 10, to cause the equivalent duty cycle to be generated at the output of the modulator 12. The circuit is shown in more detail in Fig 2. The six bit calibration number is applied on data bus 20 to a current controlled pulse width modulator 21, a Brooktree part number BT604FN-GA, which produces a delayed pulse on output pin 22. This goes to two latches 22 23, Motorola part number MC10231, which convert this pulse into a waveshape. The output of the first latch 22 goes to the system and is used during regular operation while the output of the second latch 23 goes on through gate 24, Motoral a part number MC10104, to the comparator 26, Motorola part number MC10107, to be used in the calibrate mode. At the same time, a waveshape having a duty cycle of exactly 75% is produced by ANDing two clocks, one twice the system clock frequency, the other four times the system clock frequency. These two clocks are applied to the inputs of gate 27, a Motorola MC10104, which ANDs them. The output is coupled through latch 28, Motorola part number MC10231, and gate 25, Motorola part number 10104, to the other input of the comparator 26. The waveshape which arrives first at the comparator will turn its associated gate ON. If it is gate 29, the gate output, coupled through latch 31, Motorola part number MC10H131, will cause the counter 32, Motorola part number MC10136, to increment. If it is gate 30, the gate output will cause the counter 32 to decrement. The 4 bit output of counter 32 will be coupled through bus 33 to the input of the DAC 34, National part number DAC0800, the output of which is either a greater or lesser amount of current entering output pin 2. The output of the DAC is connected to a constant current generator resistor 35 which supplies current into pin 12 of the modulator 21. The DAC steals more or less of this current at its output pin 2, thus controlling the modulator. One added detail of this circuit is that it has been designed to operate on every fourth pixel frame since the DAC can not operate at 80 ns. The basic 6 MHz clock is applied to input line 36 of gate 38, and a clock with double the time period is applied to line 37. The output is a signal which disables the comparator 26 three out of every four cycles. The overall operation of the circuit during calibration therefore is that after a number of iterations, the counter will finally arrive at a count such that the DAC 34 output current will force the modulator to produce a waveshape having a duty cycle of 75%. The circuit is now calibrated. For actual use, the counter 32 is disabled by disconnecting its clock so that the circuit will hold its calibrated state, and a six bit data word representing the desired duty cycle number will be supplied to the modulator 21 to generate an output with the actual duty cycle. Fig 3 is a timing diagram. The first waveshape, 1PEC!, is the 6 MHz system clock. Each positive time duration of the waveshape is one frame or pixel, and each negative duration is the next frame. The second waveshape, 2PEC!, is double the time period, and half the frequency. Not shown are 1/2 and 1/4 PEC!, which would be 12 and 24 MHz respectively. The VIDEOPWM1! waveshape is the output pulse of the modulator after being coupled through the latch 23, and is one of the two inputs to the comparator. The other input to the comparator is the Fig 3 waveshape REF PW, which is the waveshape that is generated by adding the 12 and 24 MHz clocks together. The White |v|! waveshape is the signal on line 39 which was produced from the binary input and which is one of the input lines to the comparator 26. Ref White! is the other input to the comparator, and is produced from the addition of the two clock signals. As shown in Fig 3, if Ref White! goes negative first, a Down pulse is produced, and if White |v|! goes negative first, an Up! pulse is produced. The Programming I waveshape shows the effect the Down and Up pulses ultimately have on the current entering the modulator 21.

Claims: A circuit responsive to a system clock (CLK) for generating an output waveshape which starts at said system clock time and which has a duty cycle which is determined by a binary number input value, said circuit also being responsive to an input waveshape which is synchronized with said system clock (CLK) and which has a duty cycle exactly equal in numerical value to a calibration binary number input value, said circuit comprising; a pulse generator (12) responsive to said system clock to produce a pulse width modulated output starting at said system clock time in response to said binary number input value and constituting the output waveshape of the circuit, said generator also being adjustable in response to an electrical analog signal, a comparator (14) for comparing the duty cycles of said pulse width modulated output and said input waveshape, a counter (13) responsive to said comparator for incrementing or decrementing a counter count in response to whether the input waveshape or the pulse width modulated output has a larger duty cycle, a DAC (11) responsive to said counter count to output said electrical analog signal to adjust the output duty cycle of said generator (12), and means (CALIB/ PROG ) for disabling said counter from further incrementing or decrementing the counter count when the circuit is switched from a calibration mode to a program mode, so that the output duty cycle will be responsive to any change of said binary number input value in the program mode. The circuit of Claim 1, further comprising a circuit (15) for adding two clocks whose frequencies are multiple of said system clock's frequency to produce said input waveshape. The circuit of Claim 1 or 2, further comprising a multiplexer (10) comprising a control line (CALIB/ PROG ), said multiplexer for coupling to said generator (12) either said calibration binary number input value which is exactly equal to the fractional value of said input waveshape duty cycle or for coupling some other binary number input value and said control line (CALIB/ PROG ) also being coupled to said counter (13) so that said counter can be disabled from further counting and decounting when said other binary number is being applied to said modulator (12).

Inventors: GIRMAY GIRMAY K, SARIAN HARMIK, WU PETER K, GIRMAY, GIRMAY K., SARIAN, HARMIK, WU, PETER K.
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1992
Main classification: H03K7
IPC codes: G06F1, H04N1, H03M1, B41J2