DIGITAL DECORATING SYSTEM

Abstract: A digital decorating system (10) for transferring a selected image to a surface (25) of an article (26) includes a thermal head (42), an advancing mechanism (22) for producing relative movement between the printhead (42) and the surface (25) of the article (26), and a force member (41) for exerting a selected amount of pressure between the thermal line of pixels and the surface of the article (25). The thermal printhead (42) includes a plurality of energizable heater elements constructed to deliver heat to a thermal line of pixels on a surface of the printhead (42). The digital decorating system (10) also includes a microcontroller (16) operatively connected to the printhead (42), the force member (41) and the advancing mechanism (22) to provide control signals selectively delivering heat to pixels of the thermal line and selectively causing the movement thereby thermally transferring, over a two-dimensional array of pixels, a two-dimensional image to the article surface (25). The microcontroller (16) can classify the pixels corresponding to the image into parimeter pixels and interior pixels and control energy levels delivered to each pixel cooperatively depend on a level of energy previously delivered to the pixel, on levels of energy delivered to neighboring pixels and on a level of energy required at the pixel to thermally transfer the image to the surface (25).

Description: DIGITAL DECORATING SYSTEM Background of the Invention This invention relates to decorative transfer of images to various types of coarse surfaces. Hot stamping of metallic foils has been widely used for decorating, with graphics and text, such items as book covers, wallets, attache cases, handbags, and suitcases. These articles are made of leathers, vinyls or textiles, which have surfaces with deep grains or fibers having valleys, for example, 0.001 inches or even 0.003 inches in depth. For decorating purposes, the metallic foil, transferred by heat and high pressure, typically has a mirror-like surface for shiny appearance. Furthermore, the transferred material includes a tinted or clear lacquer top layer covering the metal surface to provide protection and a rich gold or other appearance. Traditionally, to transfer the metallic material, one has to first fabricate a custom-made metal die with raised and recessed areas corresponding to the particular design. The raised areas press the foil against the receiving substrate to transfer the material having the desired pattern while heat is applied. The stamping press applies pressures of hundreds of pounds or more to the die. While this type of transfer has been widely used, it also has drawbacks. For example, it takes a relatively long time to fabricate the die and the fabrication process is relatively expensive. There are other widely used techniques for decorative printing, but they also require fabrication of special tools for different designs. For example, silk screen printing requires fabrication of a print screen and pad printing requires fabrication of a pad. Computer controlled thermal printing is a different thermal process. It uses a thermal printhead controlled by a computer to print an image, typically, on paper. The thermal printhead generates heat localized over dots of a computer generated pattern to be printed. A thermal printing ribbon, disposed between the printhead and the paper or other web, releases ink that is thermally transferred in tiny amounts to the paper. The ink layer consists of a particulate or liquid-like material. The thermal printing ribbon also includes constituents that facilitate good adherence of the ink dots to the paper surface. The entire process is relatively fast and economical. However, this process has not been equated with hot stamping because of limitations of the process and the materials on which a precise image can be formed. Thermal printing has been used for decorative printing on papers of varying surface qualities. To improve the quality of the transferred image, printheads have been used to transfer several layers of ink on the same dot or puffing particles have been included in the transfer composition to fill irregularities on the printed surface. In either case, the thermal printing process and its effects have differed significantly from the hot stamping process that transfers relatively larger chunks of metallic material to the. surface to achieve a specular effect. Summary of the Invention The invention provides low-cost decorating techniques that can achieve advantages of both thermal printing and hot stamping and can transfer high quality decorative images to rough surfaces. The techniques do not require special tools made individually for different images in order to thermally transfer a continuous metallic foil and create an image with a smooth specular surface of the transferred metal on different types of substrates. The novel digital decorating techniques generate high quality decorative images by computer-control. The decorating techniques produce images on rough or very rough surfaces while still achieving transfer of fine lines and edges and uniform fill of large areas. The thermal transfer system is constructed to deliver varying amounts of energy to pixels of the image depending upon important different parameters of the transfer system, the deposition surface and the image. While aspects of the invention can use only relatively few different energy states and take into account only few process variables and still transfer good quality images in many instances, other aspects of the invention provide the flexibility to employ a large number of variables and many different energy states for each pixel to further improve the transferred image. By employing different novel algorithms, different pixels are heated to different temperatures to generate high quality images. According to one important embodiment, a digital decorating system for transferring a selected image to a surface of an article includes a thermal printhead, an advancing mechanism for producing relative movement between the printhead and the surface of the article, and a force member for exerting a selected amount of pressure between the thermal line of pixels and the surface of the article. The thermal printhead includes a plurality of energizable heater elements constructed to deliver heat to a thermal line of pixels on a surface of the printhead. The digital decorating system also includes a microcontroller operatively connected to the printhead, the force member and the advancing mechanism to provide control signals selectively delivering heat to pixels of the thermal line and selectively causing the movement thereby thermally transferring, over a two dimensional array of pixels, a two dimensional image to the article surface. The microcontroller can classify the pixels corresponding to the image into perimeter pixels and interior pixels and control energy levels delivered to produce heat at the perimeter pixels and the interior pixels. The energy levels delivered to each pixel cooperatively depend on a level of energy previously delivered to the pixel, on levels of energy delivered to neighboring pixels and on a level of energy required at the pixel to thermally transfer the image to the surface. The thermal line of pixels may press directly onto the surface of the article to transfer the image by thermally altering the surface of the article. Alternatively, the digital decorating system may further include a thermal foil with a metallic layer located between the thermal line and the surface of the article. The pixel may be a perimeter pixel relative to the image and the microcontroller may be arranged to provide to the perimeter pixel an energy level substantially above a threshold level of energy required for thermal transfer of material from the thermal foil thereby creating a substantial gradient of temperature between the perimeter pixel and a neighboring pixel outside of the image. The substantial gradient enhances the thermal transfer of the metallic layer to the surface. The pixel may be a perimeter pixel of the image that, together with neighboring perimeter pixels, form a line of the image at a selected angle relative to the thermal line. Then the microcontroller provides to the perimeter pixel an energy level above a threshold level of energy required for thermal transfer of material from the thermal foil. The microcontroller also provides to a pixel outside of the image and in a corner neighboring two the perimeter pixels an energy level below the threshold level. The selected angle may be from about 30 degrees to about 60 degrees. The perimeter pixel may immediately precede several pixels that received energy substantially below the threshold level. Then the microcontroller provides to the perimeter pixel an energy level substantially above the threshold level thereby creating a substantial gradient of temperature between the perimeter pixel and a neighboring pixel. The substantial gradient causes thermal transfer of the metallic layer to the surface. If the perimeter pixel immediately follows several interior pixels, the microcontroller provides to the perimeter pixel an energy level about equal to the threshold level to cause thermal transfer of the metallic layer to the surface. The pixel may be an interior pixel and the microcontroller may provide to the interior pixel an energy level below the energy level delivered to the perimeter pixel. The printhead may include a heat sink and a thermal exchange unit thermally connected to the thermal line and constructed to actively deliver or remove heat from the heat sink. The thermal exchange unit is constructed to actively cool the printhead. The digital decorating system may further include a surface heater located near the thermal line. The surface heater may be constructed to preheat the surface of the article immediately before the surface reaches the thermal line. According to another important embodiment, a computer controlled thermal decorator for transferring images from a thermal foil includes a printhead, including a set of heater elements, constructed to thermally transfer a line of pixels from the foil to a rough substrate, and an advancing mechanism constructed to produce relative movement between the printhead and the substrate. This movement enables thermal transfer of an x-y matrix of pixels. The decorator also includes a controller constructed and arranged to examine, for each pixel, the relationship of neighboring of pixels of the matrix to the pixel for forming a selected image, and based upon the relationship of the print status of the pixel and its neighboring pixels, dependently select the level of energy to be applied to the heater element in respect of the pixel from a group of possible energies. According to another important embodiment of such a system, the examination of neighboring pixels in according to an algorithm that determines whether the pixel lies at an edge of the image and the selection of the energy to be applied depends on that determination. In preferred embodiments of this feature, pixels at an edge are heated to a higher temperature than pixels filling the body of the image, to produce enhanced separation of the foil from the carrier. According to another important embodiment of such a system, the examination of neighboring pixels determines whether the pixel is in the region of a line lying at an acute angle to the printhead line and the state of energization of the pixel is determined according to a line smoothing algorithm that partially heats unprinted pixels neighboring the feature. According to one embodiment, the algorithm determines if a pixel is outside the image but in a corner defined by pixels printed or to be printed, in which event the energy selected for the pixel in question heats the pixel below normal pixel printing temperature but sufficiently, in combination with the heating effect of the adjacent pixels, to cause partial transfer of the foil in the corner region of the pixel in question to contribute to line smoothing. According to another important embodiment, the examination of neighboring pixels according to an algorithm determines whether the pixel is a "fill" pixel, lying in the interior of the image, beyond the edge of the image, and if so, an energy level is selected that is sufficiently low to prevent any discoloration or tarnishing effect on the foil is applied to the pixel. In another aspect, a computer controlled thermal decorator, for transferring images from a thermal foil, includes a printhead, an advancing mechanism and a controller. The controller examines an image to be printed and increases the energy delivered to heater elements, relative to an average energy, and the energy applied to the leading edge of the image. The controller may be further programmed to increase the energy delivered to heater elements transferring the trailing edge of the image. In another aspect, a computer controlled thermal decorator, for transferring images from a thermal foil, includes a printhead, an advancing mechanism and a controller. The controller examines an image to be printed and applies power to pixels not to be printed, if the pixels lie in a corner defined by pixels that are to be printed. In another aspect, a computer controlled thermal decorator for transferring images from a thermal foil, includes a printhead including a line of heater elements that are selectively energized during relative movement to a substrate. The decorator further includes a heater that preheats the substrate to enhance the transfer of the foil. The heater may heat the substrate generally, immediately prior to passing under the printhead. The heater may be in a form of a second printhead that heats the substrate in a pattern related to the pattern to be thermally transferred. The second printhead may have substantially the same number of heater elements as the first mentioned printhead. In another aspect, a computer controlled thermal decorator, for transferring images to a substrate, includes a printhead including a line of heater elements that are selectively energized during relative movement to a substrate. The heating elements are exposed for direct contact with the substrate to thermally alter the substrate and thereby transfer the image. The decorator may further include a controller constructed and arranged to control power levels suitable for different types of substrates. The substrate may be leather. In another aspect, a computer controlled thermal decorator for transferring images from a thermal foil includes a printhead, including a set of heater elements, constructed to thermally transfer a line of pixels from the foil to a rough substrate, an advancing mechanism constructed to produce relative movement between the printhead and the substrate. This movement enables thermal transfer of an x-y matrix of pixels. The decorator also includes a controller constructed and arranged to control the energy delivered to the pixels dynamically in relationship to energies delivered to the neighboring pixels that form the image. The printhead includes a heat transfer member constructed to maintain a selected temperature of the printhead. The heat transfer member may be constructed for active heating or cooling. For certain applications, the controller is advantageously constructed and arranged to transfer the negative of a desired image thereby leaving a well defined decal on the substrate that is subsequently transferred as by use of a heated roll. Also, in certain circumstances, it is advantageous that the decorator include a second printhead and the controller is constructed and arranged to transfer the negative of a desired image to the foil by employing one printhead thereby leaving a decal and the controller is constructed and arranged to transfer the decal to the substrate by employing the second printhead. The invention also includes novel methods employed by the above-described systems. Brief Description of the Drawing Fig. 1 is a perspective view of a digital decorating system. Fig. 2 is a diagrammatic side view of a thermal transfer system. Fig. 3 is a perspective view of a printhead of the thermal transfer system. Fig. 4 is a view of the bottom of the printhead taken on line 4-4 of Fig. 3. Fig. 4A is a magnified view of a portion of Fig. 4. Fig. 5 is a simplified perspective view of a printhead with a heat pipe for maintaining a desired temperature. Figs. 5A and 5B are simplified perspective views of printheads cooled by air. Fig. 6 is a diagrammatic side view of the thermal transfer system including a bulk heater for heating the substrate or the thermal foil. Figs. 6A and 6B are diagrammatic side views of the thermal transfer system, including a second printhead for preheating the substrate, and the thermal foil, respectively. Figs. 7 and 7A are simplified perspective views of the thermal transfer system designed for preheating the substrate. Fig. 8 is a magnified view of irregularities of an edge produced by a standard thermal transfer, while Fig. 8A is a magnified view of a smoother edge produced by an "edge enhancement" algorithm according to the present invention. Fig. 9 is a diagrammatic view of a circular image to be thermally transferred to a substrate. Fig. 9A is a diagrammatic plan view of a uniform energy distribution for the thermal image transfer of the image of Fig. 9, and Fig. 9B is a highly magnified view of a portion of Fig. 9A. Figs. 9C and 9D are highly magnified views of the transferred image employing the uniform energy distribution of Fig. 9A and a "line enhancement" algorithm according to the present invention, respectively. Fig. 10 is a diagrammatic view of pixels considered in an enhancement algorithm and a chart with different thermal transfer combinations considered by the algorithm. Fig. 11 is a block diagram of the thermal transfer algorithm. Fig. 12 is a block diagram of the overall organization of the digital decorating system. Description of Preferred Embodiments Referring to Fig. 1, a digital decorating system 10 includes a personal computer 12 interfaced with a thermal transfer system 14. Computer 12 performs overall control over the digital decorating process and generates a selected image. Thermal transfer system 14 is a compact, table top system for transferring the provided image to a selected surface of an article (for example, vinyl, leather, plastic, textile or paper) . Referring to Fig. 2, thermal transfer system 14 includes a microcontroller 16, a drive assembly 22, a thermal foil assembly 30, and a thermal printhead assembly 40. Drive assembly 22 (i.e., advancing mechanism) includes a stage 24 constructed to move an article 26 before and during the image transfer process. Drive assembly 22 receives signals 38 from microcontroller 16. Thermal foil assembly 30 includes thermal foil 32 spooled on a supply roll 34 and a set of rollers 36 constructed to advance foil 32 (together with article 26 being advanced by stage 24) at a selected rate determined by control signals 38. Thermal printhead assembly 40 includes at least one printhead 42 pressed against article 26 by a force member 41 and responsive to control signals 44 from microcontroller 16. Force member 41 is constructed to vary the pressure exerted by the printhead. The pressure is in the range of about 1 to 8 pounds per inch, and preferably about 5 pounds per inch of print line. Referring to Fig. 3, printhead 42 is an edge type printhead that includes a set of electrical connectors 46, a heat sink 48, and a ceramic member 50. While the thermal printhead assembly is stationary during the thermal transfer process, it can be repositioned to a different location prior to the transfer process. The repositioning achieves easy access. o different locations of the decorated items. Electrical connectors 46 are connected to a plurality of energizable heater elements constructed and arranged to selectively heat each of a line of pixels on the surface of ceramic member 50. Referring to Fig. 4, in one preferred embodiment, the heater elements 52 are made of strip 53 of a resistive material deposited on the bottom surface of ceramic member 50, and connected to a plurality of leads 54 and a common ground terminal 56. Individual leads 54 are connected to electrical connectors 46, which are in turn operatively connected to a power supply and microcontroller 16. As shown in Fig. 4A, a magnified portion of Fig. 4, the spacing between leads 54A and 54B is approximately the same as width W (for example, W = 0.003") of strip 53. Microcontroller 16 provides control signals 44 to a current source (not shown) that applies energizing current, for instance to lead 54A. The current flows from 54A to ground terminal 56 through a portion of resistive strip 53, which forms one heating element 52A. Ceramic member 50 also includes a relatively thin but hard layer of glass that covers strip 53 and the leads. The heating elements heat the corresponding pixels (i.e., dots) on the surface of the glass layer, and the surface is in contact with thermal foil 32. The temperature of a pixel depends on the amount of energy delivered to the corresponding heater element and the thermal history and instant printing condition of the printhead. Thermal printhead assembly 40 may use different printheads having resolution of 200, 300, or 400 dots per inch. Microcontroller 16 receives a selected image from computer 12 and generates a data matrix corresponding to the image area. Importantly, the data matrix includes an enhancement of the image by electronic means to improve its visual appearance and physical character after the thermal transfer to surface 25 of article 26. The enhancement algorithm generates selected levels of energy delivered to each pixel at each position of stage 24, as opposed to application of the same energy condition to all pixels, as is frequently done, for example, in direct thermal printing. Thus, the data matrix can be visualized as a three-dimensional matrix with two- dimensional spatial information, and the energy level data, generated by the enhancement algorithm, represented as the third dimension. The enhancement algorithm is interactive, that is, capable of adjusting the individual levels of energy relative to the local shape of the image, the thermal history of the pixel, levels of energy applied to the neighboring pixels, the overall temperature of ceramic member 50 and heat sink 48, the morphology of surface 25, and the type of material to be thermally transferred. Furthermore, in certain embodiments, the enhancement algorithm uses a set of sensors distributed on printhead 42 that provide further input data for a dynamic analysis of the energy conditions for determining energy levels to be applied to the pixels. The enhancement capabilities of the system enable high quality images to be printed that can be compared to those produced by various hot stamping techniques that use pressure dies. Digital decorating system 10 can operate in different modes to produce different types of images on surface 25. The first mode is achieved by direct application of heat and pressure from the surface of ceramic member 50 to surface 25 of article 26. As article 26 advances, printhead 42 applies to surface 25 pressure induced by force member 41 and heat selectively generated by the heater elements to thermally alter the material surface and thereby transfer the image. This mode does not use thermal foil assembly 30. The second mode of image transfer employs thermal foil assembly 30, as is described below. Other modes employ multiple printheads without foil, or with one or multiple foils or ribbons . The enhancement algorithm employed in a particular system is selected in accordance with the mode of transfer, the desired image and the general operating parameters such as type of foil and type of substrate involved. The second image transfer mode employs thermal foil assembly 30 to thermally transfer material to surface 25 and thereby create the image. Thermal foil 32 includes a thermally resistive carrier film, a light- transmissive lacquer layer that may include a coloring agent or pigment, a thin metal layer, and a thermally activated adhesive layer that includes resins and fillers that preferably includes a puffing agent. The carrier film is preferably back-coated with a heat-resistive lubricant. Between the carrier film and the lacquer layer there is a release coating, such as thermally responsive synthetic wax, which under heat releases the lacquer, metal and adhesive laminate from the carrier. The preferred thermal foil is described in detail in a co-pending U.S. Patent Application, Serial No. , filed January 28, 1997, entitled "Thermal Foils for Digital Decorating," attorney docket no. 06456/005001, incorporated by reference. In the second thermal transfer mode, stationary printhead 42 applies heat and pressure to foil 32 and surface 25, both of which move underneath printhead 42. As mentioned above, the enhancement algorithm controls the energy sequence delivered to each pixel of the image (and the pressure delivered by force member 41) . Each pixel receives the energy from a current source or a voltage source. In a preferred embodiment, each pixel receives constant current over three time intervals while thermal foil 32 and substrate 25 move continuously at a low speed (2 mm/sec. to 25 mm/sec.) Alternatively, foil 32 and substrate 25 can remain stationary during the three time intervals. Each interval lasts about one millisecond and the current is either on or off during the interval. Thus, this arrangement enables current profiling over each pixel. The image develops as the pixels transfer the material from thermal foil 32 to substrate 25. The energy sequence is chosen to account for the unique properties of different thermal foils 32. Specifically, foils 32 may include different thicknesses of the continuous metal layer that is thermally transferred to substrate 25 together with the lacquer and adhesive layers of the laminate. The metal laminate tends to separate from (or peel off of) the thermally resistive carrier film in flakes or small sheets of material, whereas continuity of the deposited material is desired to achieve a specular effect. This significantly differs from the thermal transfer of particulate or liquid like material, such as thermal ink. The digital decorating system monitors and controls the overall temperature of printhead 42, which may include one or more temperature sensors. During the thermal transfer process, a current source delivers current pulses to the tiny heater elements 52, which in turn convey heat to thermal foil 32 and ceramic member 50. In general, approximately 20% of the generated heat is consumed by the thermal transfer process and about 80% is conducted away to ceramic member 50 and heat sink 48. Ceramic member 50 and heat sink 48 have a relatively large thermal mass for managing the heat transfer and providing stable thermal conditions. However, the large thermal mass sometimes also limits the operation of printhead 42, for example, in certain circumstances it may limit the available speed of the thermal transfer process. For images where heater elements need to deliver large amounts of heat in one area and small amounts in another area, the overall thermal management may be difficult. Furthermore, ceramic member 50 has only a limited ability to deal with localized hot spots or thermal overload. One preferred embodiment of printhead 42 includes a heat exchange unit constructed to actively cool or heat printhead 42 to achieve stable conditions. Active heating keeps the contact surface of printhead 42 preheated so that the print elements advantageously require less energy for the transition from non-printing to printing state, thus enabling fast operation. In other embodiments, active cooling is employed to increase the protection of the heater elements. The system for energizing the pixels over a range of energy transfer states is adapted to the particular heat management system employed. In certain embodiments, referring to Figs. 5A and 5B, printhead 42 employs heat exchange units 66 or 70, which use air convection for cooling. In another embodiment, the heat exchange unit uses a set of thermoelectric elements placed in thermal contact with heat sink 48. The thermoelectric elements may be implemented to operate in a cooling mode or in a heating mode depending on the polarity of the current delivered to them by a power supply operatively connected to microcontroller 14. In certain preferred embodiments, the system algorithm interactively adjusts the printhead temperature as one parameter of the thermal transfer process. In another embodiment, referring to Fig. 5, heat exchange unit 60 controls the overall temperature of printhead 42. As illustrated, heat exchange unit 60 includes a heat exchanger 61, a heat pipe 62, and a condenser with a set of cooling fins 64. Heat exchanger 61 includes a set of conduits extending relatively close to heater elements 52. The conduits are designed to carry a liquid with a high thermal capacity. Heat exchange unit 60 may be a closed system using a boiling liquid, wherein the liquid boils as it circulates near heater elements 52 and condenses in the condenser cooled by cooling fins 64. This boiling and condensing transfers a large quantity of heat for a given printhead size, and is capable of operating heater elements at a very small safety margin. Furthermore, the boiling liquid equilibrates local temperatures near heater elements 52 ; thus there is no need to employ a routine in this algorithm to adjust the energy levels to the individual heater elements to compensate for the overall temperature. The boiling liquid also provides a thermal ceiling for the heater temperature and can significantly raise the power ceiling of the heater elements, especially if the materials of the printhead are selected to have good thermal conductivity. Referring to Fig. 6, in another embodiment, thermal transfer system 10 employs a bulk heater 80 for preheating substrate surface 25 or thermal foil 32. Both surface 25 and thermal foil 32 have a relatively low heat capacity and thus, to preheat effectively, bulk heater 80 is located relatively close to the heater elements of printhead 42. Microcontroller 16 sends control signals (84) to bulk heater 80 and, in preferred embodiments, receives back temperature signals from thermal sensors located on the heating surfaces. In a substrate preheating mode, bulk heater 80 heats its surface 81, which provides heat to surface 25. One or more temperature sensors, embedded on surface 81, detect the temperature of surface 25 and provide a signal to microcontroller 16. Microcontroller 16 receives the temperature signal and adjusts the power provided to bulk heater 80 in a feedback arrangement. Depending on the material, the temperature of surface 25 is selected to soften material 26 and make it more receptive to printing (for example, in the case of vinyl) , or it is selected to preheat material 26 to reduce the time needed for thermal transfer at each dot. The softening of heat-sensitive materials (i.e., vinyl) enables moderate pressures of the printhead to momentarily flatten the material in the thermal transfer region and improves thermal contact between the foil and the substrate. Similarly, in a foil preheating mode, bulk heater 80 heats its surface 82, which provides heat to thermal foil 32. Bulk heater 80 maintains the temperature of foil 32 at an elevated level, though sufficiently low so that no material migrates from the foil; subsequently, printhead 42 delivers a limited amount of power during the thermal transfer process to raise the temperature from the preheated, non-printing condition to a further elevated, printing condition. Referring to Fig. 6A, in another embodiment, thermal transfer system 10 employs a second printhead 43, located in close proximity to printhead 42, for selectively preheating surface 25. By computer control, second printhead 43 preheats surface 25 only at the locations where printhead 42 subsequently transfers the metal foil to surface 25. The preheating improves adhesion of thermal foil 32. The preheating also enables "differential" heating of thermal foil 32 by delivering additional heat from preheated surface 25 to the bottom layer of the foil. The preheating temperature, in certain preferred instances, is selected to be higher than the softening temperature and can even be selected to be so high as to alter the surface composition of surface 25 since any potential discoloration will be covered by the transferred foil. For example, heating the surface of vinyl above about 200°F renders the selectively heated areas more receptive to the thermal deposition. These areas do not appear different to the naked eye, but common foil adhesives are found to selectively adhere to such a latent heat image relative to areas untouched by the heat. At these temperatures, components within the vinyl, such as monomers or plasticizers, migrate to the surface in heated areas and the foil adhesives adhere in an improved way to these compounds. Furthermore, for some materials, the high heat makes it possible to print more deeply into a textured surface. To maintain the registration, the printheads are preferably located close together. The control software communicates with both printheads. The control software advantageously provides adjustment to the timing and relative location of the two images on the print lines, enabling fine adjustment of registration by observing the thermal pattern and the transfer effect. The preheating area can thus be brought into precise registration with the following thermal transfer area. Alternatively, referring to Fig. 6B, thermal transfer system 10 employs a second printhead 43A for selectively preheating thermal foil 32. Printhead 43A can not only preheat thermal foil 32 but also thermally transfer an initial layer of material to surface 25. The initial layer pretreats surface 25 and can include a puffing material that fills valleys in the surface. Subsequently, printhead 42 thermally transfers the metal and lacquer layers with an additional adhesive layer to surface 25. In another embodiment, printheads 42 and 43A are arranged to transfer material .from two separate thermal foils. The transferred images of the foils do not need to be identical, but, in certain advantageous arrangements, can be arranged and controlled to complement each other. Referring to Fig. 7, a substrate heater 74 includes a heat lamp 75 (for example, an infrared lamp) coupled to a planar light guide 76, e.g., of quartz, constructed to deliver a line of the generated heat to surface 25. Microcontroller 16 sends control signals 77A to a controller 77, which regulates power delivered to heat lamp 75. A temperature sensor 78, or an array of them, located in thermal communication with substrate 25, measures the temperature of the substrate just before the substrate reaches the line of pixels at printhead 42. Temperature sensor 78 also provide feedback data to controller 77. This embodiment can use different temperature sensors, including a infrared sensor. In another embodiment, referring to Fig. 7A, a substrate heater 80 uniformly heats substrate 25 with hot air of a selected temperature. Substrate heater 80 includes an air pump or fan 82 and a heater 84 connected to a nozzle device 86, which delivers jets of hot air to substrate 25. Referring now to the control aspects of the preferred system, in general, the enhancement algorithm includes specific advantageous thermal transfer techniques, referred to as "line enhancement," "edge enhancement," "lacquer protection" and "trailing edge." The "edge enhancement" technique enables the generation of clearly defined edges in the thermally transferred pattern, while enabling the fill area to provide a uniform, desirable appearance. In the edge enhancement technique, microcontroller 16 "looks" for initial transfer pixels and generates higher energy levels for pixels that form an edge, especially the leading edge of the image. Thus, the leading, peripheral pixels (i.e., edge pixels) are controlled to have a higher temperature than interior pixels; this creates an advantageous temperature gradient at the edge between heated and unheated regions. The temperature gradient enables the transferred material to separate from the material remaining on the foil in a well-defined manner relative to the heated pattern. This is particularly applicable to leading edges and side edges in a patterned area being progressively transferred. To create an optimal temperature gradient, microcontroller 16 also takes into account the temperature of ceramic member 50 and heat sink 48 and the temperature of surface 25. These temperatures may also be adjusted to create the optimal temperature gradient. The temperature gradient, in turn, enables a clean break and transfer of the lacquer, metal and adhesive layers. Figs. 8 and 8A sketch the difference in the transferred image of line L, wherein the shaded areas 90 represent the layers laid down to form the image while the white areas 92 represent surface 25. As shown in Fig. 8, without the edge enhancement algorithm, the edge L tends to be irregular. On the other hand, as shown in Fig. 8A, the same edge produced by the edge enhancement algorithm is more regular in appearance. The energy considerations will be discussed specifically in connection with Fig. 10. In the filled area beyond the leading and side edges, microcontroller 16 directs a much lower energy to the pixels (i.e., interior "fill" pixels), where the image is also transferred. The lower energy heats the pixel to a temperature wherein the thermal transfer still occurs due to the selected properties of the metal foil, because a lower energy level is sufficient to continue the peeling and transfer process. . The lower energy level decreases the generated heat, which prevents damage to the lacquer layer that can produce a tarnished appearance to the reflective decoration. This is the "lacquer protection" technique. There are no similar concerns in thermal printing, i.e., thermal transfer of ink. This enhancement algorithm is specific to thermal foils transferring metal. The "line smoothing" routine in a novel way eliminates a stair-step appearance of lines or edges that lie diagonally to the direction of the thermal transfer motion. For example, if the image is a circular pattern, as shown in Fig. 9 (or any pattern with a line that lies at an acute angle to the direction of motion) , a uniform distribution of energy over the matrix at the transfer points of the edge will generate a stair-step pattern of thermally transferred material (see Fig. 9A) . This uniform application of energy and the thermally transferred material are shown in Figs. 9B and 9C, respectively. According to the novel "line smoothing" routine, a low level of energy is applied to a pixel lying outwardly of the edge pixel (i.e., a pixel not assigned as part of the computer generated image) The result is that a decreased thermal gradient is produced at the edge in this instance, which produces less precisely defined lines that effectively smooth the line that would otherwise have a crisp stair step appearance. It is further realized that, in particular reduced heating of a "nonprinting" pixel that lies in the corner between two "printing" pixels that form the stair step produces the most heat concentration in the crotch or corner portion of the pixel next to the heated pixel. This causes transfer of the foil in this limited region to produce a desired smoothing effect. a partial material transfer occurs in a corner region of that pixel and a smoother appearance, as suggested in Fig. 9D, is achieved. In cases where pixels are of equal dimensions in both directions, the most effective angles for this algorithm lie at about 45 degrees to the thermal transfer axis, while a beneficial range is generally between about 30 degrees and 60 degrees for fine art work. Fig. 10 illustrates in a simple way a matrix employed for implementing the enhancement techniques with respect to assigning different energy levels to the individual pixels of an image. (As mentioned above, the algorithm also takes into account the substrate and foil temperatures, the overall temperature of the printhead, the pressure, and the type of the substrate, but theses will be discussed separately.) On the top, Fig. 10 shows the rows and columns of pixels being printed by printhead 42 in print direction 94. The row "n" indicates the line of dots about to be transferred (or not transferred depending on the image) , while the row "n-1" is a line that has been transferred in the preceding print stripe and "n-2" is a line that has been transferred in the stripe preceding "n-1." The algorithm has to assign an energy level to a pixel E. The algorithm "looks" at the pattern around pixel E of the image to be transferred. The chart in Fig. 10 indicates possible combinations of the transfer states for pixels A, B, C, and D, wherein "0" denotes no transfer, according to the computer- generated image, and "1" denotes material transfer. Overall, in this implementation there are 16 different combinations, but only 12 different energy possibilities, El through E12 , because some of the patterns are essentially identical for thermal transfer purposes. For example, the material transfer at pixels B and C is identical to the material transfer at pixels B and D, assuming that the thermal conditions at pixel C and pixel D (due to the heating of their additional neighboring pixels, not shown) are identical. If there was no material transfer at the immediately preceding row "n-1," microcontroller 16 raises the energy of pixel E, and executes the edge enhancement algorithm. If there was material transfer in rows "n-2" and "n-1," microcontroller 16 directs lower energy to pixel E. This lower energy is either zero energy, if no transfer should occur at pixel E, or to an intermediate value, if material transfer should occur at pixel E. In the latter case, microcontroller 16 executes the "lacquer protection" routine, which prevents thermal damage to the lacquer layer. Additionally, if there was material transfer at pixel B, but not at its neighboring pixels in rows "n-1," (or there was material transfer at pixels A and B, but not at their neighboring pixels in rows "n-2" and "n-1") the algorithm "looks" for lines at an angle to the transfer direction. For example, if there is material transfer at pixels B and C, pixel E receives energy E 5 , which is about three-quarters of the energy of pixels B and C. Furthermore, microcontroller 16 executes the "line smoothing" routine. The "Line smoothing" routine directs a small amount of energy to the corner pixel next to heated pixels B and C for partial transfer of material that removes the stairstep pattern, as described above. Similarly, if there is material transfer at pixels F and D, then microcontroller 16 directs a small amount of energy to pixel E for partial transfer. The algorithm can also "look at" the next succeeding stripe. If there is material transfer at pixels E, but no transfer at pixel F (or pixels of the "n+l" stripe) , microcontroller 16 executes a "trailing edge" routine and pixel F receives no energy. In general, the "trailing edge" routine does not assign increased values of energy to the last transferred stripe, that is, there is no increased heating of the leading edge as executed by the "edge enhancement" routine. However, to break off the material to be transferred at the trailing edge, the thermal gradient may be needed for some types of thermal foils. This is again due to the unique properties of the metal layer that tends to break off clean at the trailing edge. A simplified version of the enhancement algorithm, in general, achieves very good results by only "looking at" a partial image and considering just a few transfer stripes. Fig. 11 shows diagrammatically the thermal transfer algorithm. The computer provides image data (100) to a stripe generator 102, which analyzes each thermal line to be transferred and provides this to a sub-stripe generator 104. As is described below, sub- stripe generator 104 generates sub-stripe data (112) and the corresponding power (energy) control signals for a power controller 110. Power controller 110 also receives print speed data 108 and foil & substrate data and delivers current signals for each sub-stripe to the heater elements of the printhead. The printhead includes a temperature sensor that sends temperature data (116) to power controller 110. Appendix A includes a listing of a source code that can be described as follows: Data kept for each dot (pixel) of the printhead (1 = on) previous dot line: this dot line: wherein X = current state of dot X P = previous state of dot X L = current state, dot to left of X R = current state, dot to right of X Arrays kept for each line of data: * normal stripe [ ] = X for each dot of head not current stripe [] = X not previous stripe [ ] = P not left stripe [ ] = L not right stripe [ ] = R * edge stripe [] = X * (P + L + R) Time during which one row of data is printed is broken into 3 "substripe" intervals of equal duration. "Normal stripe []" data is printed during the first two substripes, "edge stripe []" data is printed during the third substripe. The nominal power for each sub-stripe can be adjusted independently and is corrected for head temperature. Initialization: (Function "Stepup Printing ()") * Cells "Compute Strobe Energy ()" to build a look-up table "rollofftable [ ] [ ] " which contains power settings for each possible head temperature data reading for each of the 3 "substripe" interval power levels. * Initializes image buffer data from a file, points to its start * Initializes data arrays Normal Stripe [ ] , not Current Stripe [ ] , not Prev Stripe [ ] * Initialize Sub Stripe number to 0 * Initialize and start Sub Stripe rate timer & IRQ Interrupt Service routine "SendStripe ()", called from sub-stripe timer IRQ, does following: * sets strobe energy based on recent-average head- thermstor data and on current substripe number. * quits if done printing all data. * updates sub-stripe number, module 3. if substripe = 0 • get NextStripe [] from image Buffer ptr, (updates normal Stripe [ ] not Current Stripe [ ] , not Prev Stripe [ ] • shifts normal Stripe [ ] to head for printing @ substripe #1 energy level) else if substripe = 1 • leaves head data unchanged (normal Stripe [] data continues printing @ substripe #1 energy level) • calls "build Edge Stripe()" to compete not Left Stripe [], not Right Stripe [], and finally Edge Stripe [ ] else if substripe = 2 • shifts Edge Stripe [ ] data to head for printing at substripe #2 energy level Fig. 12 shows a block diagram of the overall organization of digital decorating system 10. Microcontroller 16 runs the enhancement algorithms (126) and the system control algorithms (128) . Microcontroller 16 receives image data 100, user parameters 120, system parameters 122 and thermal foil parameters 124. User parameters 120 include information about the object and surface being decorated. System parameters 122 includes manufacturer information, the printhead rating, the heater ratings and other. Thermal foil parameters 124 are parameters unique to the foil currently used. Microcontroller 16 controls print speed 130, printhead force 134, printhead power 138, substrate heat 142 and foil heat 146 and can receive their actual values, measured by sensors 132, 136, 140, 144, and 148 in a feedback loop 150. // // FILE: PHEAD.H // PROJECT: DOS // REVISION: 1.10 // DATE: 12/05/96 // // DESCRIPTION: // Header file for PHEAD.C - Print head control functions // REV DATE BY DESCRIPTION // // B1.00 04/18/96 JRC Beta pre-release 1.00 // B1.01 04/24/96 JRC Beta pre-release 1.01 // B1.02 05/09/96 JRC Beta pre-release 1.02 // B1.03 06/05/96 JRC Beta pre-release 1.03 // B1.04 07/02/96 JRC Beta pre-release 1.04 // B1.05 08/07/96 JRC Beta pre-release 1.05 // B1.06 08/07/96 JRC Beta pre-release 1.06 // B1.07 09/05/96 JRC Beta pre-release 1.07 // (documention of changes from B1.06 incomplete) //-B1.08 09/27/96 JRC Beta pre-release 1.08 // ■ -B1.09 11/01/96 JRC Beta pre-release 1.09 // Added function prototypes ComputeStrobeEnergyO, // GetMaxWattsO. SetCompensationC), SetOutyCycl e() . & // SetForceO. Deleted prototypes GetEnergyK). // GetEnergylOOO, GetForcelO. & GetForcelOOO . // Added conditional prototypes SetConstantRolloff( ) & // GetConstantRolloffO // 1.10 12/05/96 JRC Beta pre-release 1.10 // Moved def MAX_W0RDS_PER_LINE here from PHEAD.C // - - #ifndef PHEAD_H #define PHEAD_H tfifndef DATADEFS_H ^include "datadefs.h" #endif // ——_———_——- // LOCAL DATA DEFINITIONS // max head width supported, in 16-pixel words ^define MAX_W0RDS_PER_LINE 78 // — // FUNCTION PROTOTYPES BYTE AnalogFromHeadResistance (double r): BYTE AnalogFromHeadTemp (int temp): void ClearPrintHead (BOOL latch): void ComputeStrobeEnergy (void): int GetHeadHeatMax (void); int GetHeadHomeX (void): BYTE GetHeadNumber (void): int GetHeadOverTemp (void): double GetMaxWatts (void); int GetNPixels (void); int GetResolution (void); int Get ordsPerLine (void): double HeadResistanceFromAnalog (BYTE data) ; int HeadTempFromAnalog (BYTE data); BYTE InitHeadlnfo (void): BOOL IsPrintDone (void): void KillPrint (void): void SendStripe (void): void SetCompensation (int comp) ; void SetDutyCycle (int n) double SetForce (int n): BOOL SetupPrinting (int * pBM, int * pLen, int xLoc, int yLoc); void StartPrinting (void) #1fdef TW0_R0LL0FF_M0DES void SetConstantRolloff (BOOL fl ag ) ; BOOL GetConstantRolloff (void): #endi f / /tfi fndef PHEAD_H // __—-_._, // FILE: PHEAD.C // PROJECT. DOS // REVISION: 1.10 // DATE: 12/05/96 // // DESCRIPTION: // Print head control functions // REV DATE BY DESCRIPTION // - - // B1.00 04/18/96 JRC Beta pre-release 1.00 // B1.01 04/24/96 JRC Beta pre-release 1.01 // B1.02 05/09/96 JRC Beta pre-release 1.02 // B1.03 06/05/96 JRC Beta pre-release 1.03 // B1.04 07/02/96 JRC Beta pre-release 1.04 // 07/08/96 JPR start adding dot control // B1.05 08/07/96 JRC Beta pre-release 1.05. // Used "PHEAD.C" identical to B1.04 (no dot history) // B1.06 08/07/96 JRC Beta pre-release 1.06 // - Incorporates JPR's new dot history control functions // B1.07 09/05/96 JRC Beta pre-release 1.07 // (documention of changes from B1.06 incomplete) // B1.08 09/27/96 JRC Beta pre-release 1.08 // B1.09 11/01/96 JRC Beta pre-release 1.09 // Added variable "Edge Enhancement" effect (formerly // known as dot history): // - Added function SetCompensationO // Added energy (microstrobe duty-cycle) rolloff feature // to compensate for changes in head temperature. // - Conditional based on DDS.H switch "TW0_R0LL0FF_M0DES" . // functions SetConstantRolloff() . GetConstantRol loff() // variable constantRolloff allow setting constant // rolloff regardless of energy setting. // - Normally uses percentage rolloff, based on new member // "rolloff" added to headlnfo structure // Added rol loffTable[] . microstrobe duty cycle counter // values for each temperature & substripe. Added // functions ComputeStrobeEnergyO to mit this table & // replaced startStrobesO with setStrobeEnergyO which // which reads the thermistor & does lookup. // Optimized code to provide higher data rates, supporting // print speeds up 2 IPS even with 4" heads: // - Reduced number of sub-stripes from 4 to 3. // - Rewrote SendStnpeO. moved dot-history functions from // getNextStπpe( ) to new function bui ldEdgeStπpe( ) . // Consolidated shift functions into shiftStπpeO , // which writes to both left & right shift regs for 4" // head. // Simplified interaction with JOBCMDS.C. // - Replaced functions GetEnergylO, GetEnergylOOO , // GetForcelO, & GetForcelOOO with SetForce (), // SetDutyCycle (): deleted elements ππcroDutyl, // microDutylOO from headlnfo structure. // - Added function GetMaxWattsO & added member axWatts // to headlnfo structure // Conditional based on DDS.H switch COUNT DOTS, added dot // counting per line. Array lιnedots[], pπntf oτ average // dot power. // Increased headHeatMax from 120 to 150 F in headlnfo struct // 1.10 12/05/96 JRC Beta pre release 1.10 // Simplified pointer setup in shiftStnpeO // Removed def MAX_W0RDS_PER_LINE to PHEAD.H // Modified SetupPπntingO & getNextStπ pe( ) to handle flipped // bitmap files; using new local variable "flipped". // -- - //include <alloc.h> /include <math.h> /include <stπng.h> /include "dds.h" // LOCAL DATA DEFINITIONS ////define F0RCE_4_INCH TRUE //debug 4' head code using 2" head // number of printhead types supported //define N_HEADTYPES 2 // microstrobe counter modes //define STB_M0DE_1 LSB_MSB | C0UNTER_MODE_l | C0UNT_BINARY //define STB_MODE_2 LSB_MSB j C0UNTER_M0DE_2 | C0UNT_BINARY // microstrobe rate (40 kHz) //define MICR0_PERI0D 0.000025 //define PERI0D_C0UNT (DDS_TMR_FAST_CLK * MICR0_PERI0D) // LOCAL VARIABLES // Data structure: information unique to each supported head type // - typedef struct { //its name char name[25]; //data width in 16-pixel words: total, left section, right section int rasterWords. leftWords, rightWords; //polarity of data: word which turns OFF printed dots WORD ClrData: //resolution (DPI), width (pix) , distance home sensor to left dot (pix) int dpi. nPixels. homeX; //nominal dot element resistance, tolerance ( 2 = 20%) double RDot. RDotTolerance; //thermistor characteristics: //pullup resistor, value @ 25 C, exponent Beta factor double thRPullup. thR25. thBeta : //absolute max temperature, max head heater setting (degrees F) int overTe p, headHeatMax; //min, max head force double forcel, forcelOO; //max print energy, watts double maxWatts: //energy rolloff factor per degree F double rolloff; ) head_info_t; static const head_info_t near headlnfo [N_HEADTYPES+1] = { ( .."NO PRINTHEAD INSTALLED", -0. 0. 0. 0x0000, 0. 0, 0. 1.. 1.. 30000.. 30000., 3950.. 1. 1. 0.. 0.. 0.. .0070 }. { "KYOCERA KBE-57-12MGL2-GS", 42. 0, 42. 0x0000. 300. 672. 672. 1710. , 0.2. 30000.. 30000.. 3950.. 160, 150. 3.. 15.. 0.100. .0070 }. { "KYOCERA KBE-106-12MGL1-GS". 78. 36, 42, 0x0000. 300. 1248. 1248. 1710.. 0.2, 30000.. 30000.. 3950.. 160. 150. 5.6. 27.9, 0.100. .0070 } }; // Prmtheaα variables, initialized from the "headlnfo"- structure // static BYTE near headNumber = Oxff; //head type ID//, read from hardware static int near wordsPerLine: //data width: total, left, right static int near leftWords: static int near πghtWords, static int near pairsToShift; //larger of leftWords, πghtWords static int near resolution: //resolution in DPI static WORD near clearData; //"dots off" data word static double near maxWatts: //max print energy static double near maxDutyCycle; //corresponding max duty cycle // Lookup table: temperature in deg F for each thermistor A/D value // static BYTE near headTempTable [256]: // Variables for printing raster files // static int near activeBM: //// of file being printed static int near stπpesToSend: //// stripes to print static BOOL near printing, //flag, printing active static BYTE near ssNum: // current substripe number (0..3) // Pointer to PπntBuffer data being printed // - static WORD huge * imagePtr; // Arrays of graphic stripe data for printing // // previous, inverted stati c WORD near notPrevStπ pe [MAX_WORDS_PER_LI NE] ; // current, inverted static WORD near notCurrentStπpe [MAX_WORDS_PER_LINE] . // cur. mv, shifted right 1 pix static WORD near notLeftStπ pe [MAX_WORDS_PER_LINE] : // cur. inv, shifted left 1 pix static WORD near notRightStπpe [MAX_WORDS_PER_LINE] . // "normal", for printhead static WORD near normalStπpe [MAX_WORDS_PER_LINE] : // "edge". fot printhead static WORD near edgeStπpe [MAX_WORDS_PER_LINE] ; // print settings variables // static double near jobDutyCycle; //duty cycle (from Print Energy) static double near ssMicroWeight [3]; //substripe weightings (from edge enh.) // energy rolloff lookup table: // microstrobe duty cycle count & mode values for each substripe // entries for each possible themistor A/D reading // - static struct near { WORD count: BYTE mode: } rolloffTable [256] [3]; // last 16 thermistor readings, index for storing next ' -one // - static BYTE near tHeadSample [16]; static int near tHeadlndex - 0; //ifdef TW0_R0LL0FF_M0DES static BOOL constantRolloff = FALSE; //flag: use constant rolloff factor //endif //1 ' fdef C0UNT_D0TS static int near lineDots [3300]: //// of dots On for each line of raster file //endif // bitmap flipped flag // static BOOL near flipped: // LOCAL FUNCTION PROTOTYPES // — ___—-, staU c void near bui IdEdgeStripe (void): stati c void near getNextStripe (void); stati c void near setStrobeEnergy (int ss); stati c void near shiftStripe (WORD near *pStripe); static void near startPCycleTi er (double speed): // GLOBAL FUNCTION DEFINITIONS // // FUNCTION: AnalogFromHeadResi stance // // PURPOSE: Converts a printhead resistance value from ohms to A/D // converter counts // // USAGE: BYTE AnalogFromHeadResistance (double r) // // PROTOTYPE IN PHEAD. H // // ARGUMENTS: r is a printhead resistance. value in ohms // // RETURN VALUE: Corresponding value in A/D converter counts // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none // BYTE AnalogFromHeadResistance (double r) { int data - 0: double rmin, rmax; //get min and max head resistance for this head type data - GetHeadNumberO; rmin - headInfo[data].RDot * (1. - headInfo[data].RDotTolerance) ; r ax = headInfo[data] .RDot * (1. + headInfo[data] .RDotTolerance) ; if (rmax =- rmin) return 0; //compute A/D converter counts data - (int) (255. * (r - rmin) / (rmax • rmin)); if (data < 0) data = 0; else if (data > 255) data = 255; return data; / / // FUNCTION: AnalogFromHeadTemp // // PURPOSE: Converts a printhead temperature value from degrees F to A/D // converter counts // // USAGE: BYTE AnalogFromHeadTemp (int temp) // // .PROTOTYPE IN PHEAD. H // // ARGUMENTS: temp is a printhead temperature value in degrees F // // RETURN VALUE Corresponding value in A/D converter counts // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none // —-.- --- -. .„ BYTE AnalogFromHeadTemp (int temp) i int i , isave: l = GetHeadNumber( ) ; // insure that head temp lookup table is initialized //save index into table of first temperature entry which is >= desired temp for (isave = 0. i = 0; i<256; ι++) { if (headTempTable[i ] >= ■ temp) isave - i ; else break: } //return index (A/D counts) return isave; } // FUNCTION: ClearPrintHead // // PURPOSE: Shifts (and optionally latches) a line of "dots off" data into // the printhead // // USAGE: void ClearPrintHead (BOOL latch) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: latch: TRUE- shift and latch data. FALSE= shift data only // // RETURN VALUE: none // CALLS: (macros) <DOS.H>: inportbO <DOS.H>: outportbO DATADEFS.H: DISABLEO DATADEFS.H: ENABLEO AFFECTS: none void ClearPrintHead (BOOL latch) { DISABLEO; //trig logic analyzer: start shifting outportb (LPT1. inportb (LPT1) | 0x01), asm mov bx. clearData //BX = 'dots off" data asm mov ex, pairsToShift //CX = loop counter, pairs of words to shift clearTwoWords: asm mov ax, bx //load left shift register with "dots off" data asm mov dx. LEFT_HEAD_SR asm out dx. ax asm mov dx. RIGHT_HEAD_SR //load right shift register (starts shifting) asm out dx. ax asm mov dx. DIGITAL_IN //set port addr for reading "shift done" waitClearDone: //loop here till 'shift done" bit is set asm in ax. dx asm and ax. HEAD_SHIFT_DONE asm z waitClearDone asm loop clearTwoWords //loop till CX //trig logic analyzer: end shifting outportb (LPT1. inportb (LPT1) & -0x01); if (latch) //optional latch data into head outportb(HEAD_LATCH. 0); ENABLEO: FUNCTION: ComputeStrobeEnergy PURPOSE: Builds print energy rolloff table "rolloffTabl e" for upcoming print cycle. For each possible A/D reading of the printhead thermistor, look-up values are generated for the timer and mode words / / necessary to produce the desired micfiostrobe duty cycle for // each sub-stripe. / / / / Calculations are based on the energy-vs-temperature factor / / "rolloff" in the headlnfo table for the current printhead. / / / / Calculations are take into account the Head Temperature print / / setting and values of module-level variables "jobDutyCycle" / / and "ssMicroWeightU" , which are controlled by the Print / / Energy and Edge Enhancement print settings, respectively. // // USAGE : void ComputeStrobeEnergy (void) // / / PROTOTYPE I N : PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: none // // CALLS: (macros) // DATADEFS . H : MAX O // DATADEFS . H : MI N O // // (functions) // JOBCMDS: GetJobHeadTempO // // AFFECTS: none void ComputeStrobeEnergy (void) { double tempSetting; //Head Temperature print setting int l ; //temperature index (head thermistor A/D counts) int j ; //substripe index double temp; //temperature @ temperatur index double energyRol loff ; //energy rolloff factor @ temperature double ssMicroOuty; //rolled-off microstrobe duty cycle WORD pulseCount: //microstrobe counter value BYTE mode; //microstrobe moαe word //ifdef TWO_ROLL0FF_MODES double kRoll = maxDutyCycle / 250.; //endif //get Head Temperature print setting, value at which there is no rolloff //(use no less than 70 degrees F) tempSetting = MAX (70., GetJobHeadTempO ); //Loop thru for each possible thermistor A/D reading: for (i=0; K256: ι++) { //loop up the corresponding temperature (not less than 70 F) temp = (double) headTempTable[i ] ; temp = MAX (70.. temp); //i fdef TW0_R0LL0FF_M0DES i f ( constantRol l off ) ( if (temp >= headInfo[headNumber] overTemp) energyRolloff = maxDutyCycle: else energyRolloff = kRoll * (temp tempSetting). } else { if (temp >= headInfo[headNumber] .overTemp) energyRolloff - 0; else energyRolloff = 1. (headInfo[headNumber] rolloff * ( temp-tempSetting) ) } //else //set energyRolloff multiplier: //if temp > max allowed for head, multiplier = 0; if (temp >= headInfo[headNumber] .overTemp) energyRolloff - 0; else { //else multiplier = 1 (rolloff * delta temperature) energyRolloff = 1. (headInfo[headNumber] rolloff * (temp tempSetting)). //multiplier must be >= 0 if (energyRolloff < 0. ) energyRolloff = 0. ; ) //endif //produce desired duty cycle for each substripe at current temperature for (j - 0; j < 3: j++) ( //ifdef TW0_R0LL0FF_MODES if (constantRolloff ) { ssMicroDuty - (jobDutyCycle energyRolloff) * ssMi croWei ght[j ] , if (ssMicroDuty < 0. ) ssMicroDuty = 0.. } else ssMicroDuty = jobDutyCycle * ssMicroWei ght[j] * energyRolloff; //else //duty cycle (DC) = nominal DC * substripe weighting * energyRolloff ssMicroDuty = jobDutyCycle * ssMιcroWeιght[j] * energyRolloff: //endif //observe max DC limits for each substripe if (j < 2) ssMicroDuty - MIN (ssMicroDuty. maxDutyCycle * 1.125); else ssMicroDuty - MIN (ssMicroDuty. maxDutyCycle): // setup micro strobe timers ... if (ssMicroDuty < 0.5) { // alternate strobes 1 and 2 pulseCount = (WORD) (PERI0D_C0UNT * ssMicroDuty * 2); mode = 0; } else { // strobe strobes 1 and 2 together pulseCount = (WORD) (PERI0D_C0UNT * ssMicroDuty) ; mode = 4; // minimum timer value = 2. maximum = pulse period -2 if (pulseCount < 2) pulseCount - 2: else if (pulseCount > ((W0RD)PERI0D_C0UNT - 2)) pulseCount = (W0RD)PERI0D_C0UNT - 2; //place timer words in the lookup table rol loffTable[i][j]. count = pulseCount; rolloffTable[i ][j] .mode = mode; 1 / / FUNCTION : GetHeadHeatMax // // PURPOSE: Get maximum Head Temperature setting allowed by printhead // // USAGE: int GetHeadHeatMax (void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: maximum Head Temperature setting, in degrees F // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none int GetHeadHeatMax (void) ( return (headInfo[GetHeadNumber( )] .headHeatMax) ; } // FUNCTION: GetHeadHomeX // / / PURPOS E : Get X - axi s di stance from home sensor to l ef t - mos t dot on head // // USAGE: int GetHeadHomeX (void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: home to left-dot distance, in pixels // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none // int GetHeadHomeX (void) ( return (headInfo[GetHeadNumber( )] .homeX) ; } // FUNCTION: GetHeadNumber // // PURPOSE: Reports ID number of current printhead // // USAGE: BYTE GetHeadNumber(void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: current printhead ID number +1. 0 if none installed // / / CALLS : PHEAD : I m tHead lnf o O // // AFFECTS: none BYTE GetHeadNumber(void) { if (headNumber > N_HEADTYPES) headNumber = InitHeadInfo( ) ; //re-read from hardware if unknown return headNumber: } // ==.=—«==.== :-=. // FUNCTION: GetHeadOverTemp // // PURPOSE: Get absolute max operating temperature of current peinthead // // USAGE : int GetHeadOverTemp (void) // // PROTOTYPE IN PHEAD. H // // ARGUMENTS: none // // RETURN VALUE Absolute max temperature, in degrees F // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none // i nt GetHeadOverTemp ( voi d ) { return ( head I nfo[ GetHeadNumber ( ) ] . overTemp) ; } // FUNCTION: GetMaxWatts // // PURPOSE: Get maximum power for current printhead // // USAGE: double GetMaxWatts (void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: maximum power for current printhead. in watts per dot // // CALLS: none // // AFFECTS: none double GetMaxWatts (void) ( return maxWatts: > // FUNCTION: GetNPixels // // PURPOSE: Get width of current printhead, in pixels // // USAGE: int GetNPixels (void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: width of current printhead. in pixels // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none int GetNPixels (void) ( return (headInfo[GetHeadNumber( )] .nPixels) ; ) // FUNCTION: GetResol uti on // // PURPOSE: Get resolution of current print head // // USAGE: int GetResol ution (void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: print head resolution in dots per inch // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: updates variable "resolution" int GetResolution (void) I return (resolution = headInfo[GetHeadNumber( )] .dpi : // _,_—__====== // FUNCTION: GetWordsPerLine // // PURPOSE: Get printhead data width in 16-bit words // // USAGE: int GetWordsPerLine (void) // // PROTOTYPE IN; PHEAD. H // // ARGUMENTS: none // _ // RETURN VALUE head width in 16-bit words // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: updates variable "wordsPerLine" / / int GetWordsPerLine (void) ( return (wordsPerLine = headInfo[GetHeadNumber( ) ] . rasterWords) ; 1 // FUNCTION: HeadResistanceFromAnalog // // PURPOSE: Converts raw A/D data from head resistance pot to ohms // // USAGE: double HeadResistanceFromAnalog (BYTE data) // // PROTOTYPE IN: PHEAD.H // // ARGUMENTS: data: raw A/D data from head resistance pot // // RETURN VALUE: Head resistance in ohms // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none double HeadResistanceFromAnalog (BYTE data) I double r. rnom, rtol ; rnom = headInfo[GetHeadNumber()] .RDot; rtol - rnom * headInfo[GetHeadNumber()] .RDotTolerance; r = rnom + ( (double)data 128.) / 128. * rtol ; if ( r < 0. ) r = 0.; if (r > rnom+rtol ) r = rnom + rtol ; return r; //head resistance in ohms // _ —-. _-. -.-—===— ===== ——--, —. _ // FUNCTION: HeadTempFromAnal og // // PURPOSE: Converts head temperature from raw A/D data from head // thermistor to degrees F // // USAGE: int HeadTempFromAnal og (BYTE data) // // PROTOTYPE IN: PHEAD.H // // ARGUMENTS: none // // RETURN VALUE: Head temperature in degrees F // ■CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none int HeadTempFromAnal og (BYTE data) { GetHeadNumber (); //get head number, init if necessary return (int) headTempTable[data] ; //head temp in deg. C 1 // FUNCTION: InitHeadlnfo // / / PURPOSE : Reads hardwa re for pri nthead I D j umpers . / / I ni ti al i zes pri nthead vari ab l es accord i ng l y // // USAGE: BYTE InitHeadlnfo (void) // // PROTOTYPE IN: PHEAD.H // // ARGUMENTS: none // // RETURN VALUE: Printhead ID number: 0 if error // // CALLS: (macros) // <DOS.H>: inportO // DATADEFS.H: MAXO // // (functions) // <MATH.H>: expO // <MATH.H>: logO // // AFFECTS: Initialized head temperature lookup table and other variables // based on hardware prinhead ID jumpers BYTE InitHeadlnfo (void) I BYTE id; double k. tempdata; //initialize microstrobe duty cycle energy weightings for each substripe //Normalized for using 3 substnpes per line instead of 4 ssMicroWeight [0] = 1.125: ssMicroWeight [1] = 1.125; ssMicroWeight [2] = .75: // read head id// from hardware id - (BYTE) (Onport(DIGITAL_IN) && HEAD_TYPE_INPUTS) / 0x100); if (id < NJHEADTYPES) { ιd++; //add 1 to hardware reading (valid = 1 to n) //ifdef F0RCE_4_INCH //endi f // initialize thermistor A/D data to head temperature lookup table k - headInfo[ιd].thR25 / exp (headInfo[ιd] . thBeta/298. ) . headTempTable[0] = 212: headTempTable[255] = 0; for (l - 1; l < 255; ι++) { tempdata = headInfo[ιd] .thBeta / log (l * headInfo[ιd].thRPullup / k / (255-ι) ) -273.; tempdata = (tempdata * 1.8) + 32: // convert to degrees f if (tempdata > 212.) headTempTable[i] = 212; else if (tempdata < 0.) headTempTable[ι ] - 0; else headTempTable[ι] - (BYTE) tempdata, //initialize other variables based on printhead ID resolution = headlπfoCid] .dpi ; clearData = headInfo[ιd].ClrData; wordsPerLine = headInfo[ιd] .rasterWords; leftWords = headlnfoCid] .leftWords; πghtWords = headInfo[ιd].rιghtWords: pairsToShift = MAX (leftWords. nghtWords). ) else ιd-0: //(invalid - 0) return id; ) // FUNCTION: IsPnntDone // // PURPOSE. Tests whether printing is done // // USAGE: BOOL IsPπntDone(void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: FALSE if printing in procress, else TRUE // // CALLS: none // // AFFECTS: none // ————====— BOOL IsPrintDone( void) I return ( Sprinting) ? TRUE : FALSE; } // // FUNCTION: KillPπnt // // PURPOSE: Stops printing // // USAGE: void KillPnnt (void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: none // // CALLS: (macros) // <D0S.H>: outportb( ) // DATADEFS.H: DISABLEO // DATADEFS.H: ENABLEO // // (functions) // PHEAD: Cl earPπntHeadO // // AFFECTS: Shuts off microstrobes. kill stripe interrupts // Resets "printing" flag, latches "dots off" data into head // void KillPnnt (void) { DISABLEO; outportb (HEAD_STROBE_CTRL. 0): // disable strobes outportb (DDS_ICR. (DDSIcr &- ~ENABLE_STRIPE_IRQ) ) ; // disable stripe lrq printing - FALSE: //reset "printing" flag ClearPrintHead (TRUE); //shift & latch "dots off" data into printhead ENABLEO; } // —— — — , -. // FUNCTION: SendStπpe // // PURPOSE: Latches previous data into head // Sets up proper microstrobe energy for printing it // // Does other processing depending on current substripe (/: // // ssNum= 0: Loads next stripe data from print buffer // Shifts "normal" stripe data to head // // ssNum= 1: Computes "edge enhancement" stripe data // Continues printing "normal" stripe data // // ssNum= 2: Shifts "edge enhancement" stripe data to head // // USAGE: void SendStnpe(voιd) // // PROTOTYPE I PHEAD. H // // ARGUMENTS: none // // RETURN VALUE: none // CALLS: (macros) <D0S.H>: ιnportb( ) <D0S.H>- outportb( ) DATADEFS.H: DISABLEO DATADEFS.H: ENABLEO (functions ) PHEAD ClearPnntHeadO PHEAD buildEdgeStnpeC ) PHEAD getNextStnpe( ) PHEAD setStrobeEnergy( ) PHEAD shιftStnpe( ) AFFECTS: none void SendStnpe(voιd) { outportb (HEAD_LATCH. 0); setStrobeEnergy (ssNum): if (stnpesToSend == 0) //normal, exit after last stripe sent { DISABLEO: //disable interrupts, save flag outportb(HEAD_STROBE_CTRL, 0); // disable strobes DDSIcr &= ~ENABLE_STRIPE_IRQ; // reset stripe lrq enable bit outportb(DDS_ICR. DDSIcr): // reset enable bit in port printing - FALSE: ClearPrintHead (TRUE): // redundant clear head, latch OFF bits ENABLEO: //restore interrupts ) else //count off stripe { ssNum++; if (ssNum ~ 3) { ssNum - 0; stπpesToSend- //set logic analyzer bits corresponding to ssNum outportb (LPT1. (inportb (LPT1) & -OxOC) ] (ssNum << 2 ) ) ; i f ( stπ pesToSend == 0 ) / / no more data Cl earPri ntHead ( FALSE ) ; / / cl ear pri nthead el se / / more data switch (ssNum) ( case 0: getNextStnpe (): shiftStnpe (normalStπpe); break; case 1: buildEdgeStπpe (); break; case 2: shiftStnpe (edgeStn pe) : break; } // FUNCTION: SetCompensation // // PURPOSE: Sets "edge enhancement" effect. // Adjusts duty-cycle weighting of "edge enhanced" substripe // relative to "normal" substripe. // // USAGE: void SetCompensation (int comp) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: comp: Edge Enhancement setting (0 to 100) // // RETURN VALUE: none // // CALLS: none // // AFFECTS: Substripe energy weightings "ssMicroWeightf ]" void SetCompensation (int comp) ( ssMicroWeight [0] = 1.125: ssMicroWeight [1] = 1.125: ssMicroWeight [2] = (double) (comp) / 44. // — . // FUNCTION: SetDutyCycle / / // PURPOSE : Sets nominal microstrobe duty cycle / / / / USAGE : void SetDutyCycle (int n) / / / / PROTOTYPE I N : PHEAD. H / / // ARGUMENTS: n: Print Energy setting (0-100) // // RETURN VALUE: none // // CALLS: PHEAD: GetHeadNumberO II PHEAD: HeadResi stanceFromAnal og( ) II DDSHW: AnalogO II I I AFFECTS: variables maxWatts, maxDutyCycle, jobDutyCycle void SetDutyCycle (int n) ( double headResistance: headResistance - HeadResistanceFromAnalog (Analog (HEAD_0HMS_AD) ), maxWatts = headInfo[GetHeadNumber( )] .maxWatts ; maxDutyCycle = maxWatts * headResistance / (24.0 * 24.0): jobDutyCycle = (double) n * maxDutyCycle / 100.; // --------- :.=. // FUNCTION: SetForce // // PURPOSE: Sets up head force to be used for printing // // USAGE: double SetForce (int n) // // PROTOTYPE IN PHEAD. H // // ARGUMENTS. n: Print Force setting (0-100) // // RETURN VALUE Actual print head applied force in pounds // // CALLS: PHEAD: GetHeadNumberO // // AFFECTS: none // double SetForce (int n) ( double fl. fl00; if ( (n < 1) || (n > 100) ) return 0.0; fl = headInfo[GetHeadNumber( )] .forcel: flOO - headInfo[GetHeadNumber()] .forcelOO: return (fl + ( (double)(n-l) / 99.) * (flOO fl) ); // // FUNCTION: SetupPrinting // // PURPOSE: Sets up a raster data file for printing // // USAGE: BOOL SetupPrinting (int * pBM, int * pLen, int xLoc, int yLoc) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: pBM: pointer to bitmap file to be printed // pLen: pointer to number of raster lines to be printed // xLoc: starting X location // yLoc: starting Y location // // RETURN VALUE Error status: TRUE if error, else FALSE // // CALLS: (macros) // DATADEFS.H: MINO // // (functions ) // <STDI0.H>: pnntf ( ) // " PHEAD: GetNPixelsO // PHEAD GetMaxWattsO // PHEAD getNextStnpe( ) // PHEAD setStrobeEnergy( ) // PHEAD shiftStripeO // PHEAD startPCycleTimer () // DDSHW Analog( ) // JOBCMDS GetJobFlipYO // JOBCMDS GetJobPrintEnergyNum( ) // JOBCMDS GetJobPnntSpeedO // MOTOR: GetMaxXMoveO // MOTOR: GetMaxYMoveO // RASTER CloseRasterFile( ) // RASTER DeleteRasterFile( ) // RASTER GetPrintDataO // RASTER GetRasterHeightt ) // RASTER GetRasterTempFlag( ) // RASTER OpenPπntDataFile( ) // RASTER ShiftedRasterFileO // // AFFECTS: none // BOOL SetupPrinting (int * pBM. int * pLen , int xLoc, int yLoc) { BOOL errStat = FALSE; //error flag: none yet int oldBM = * pBM: //raster file numbers: original, shifted int newBM; int maxXmove = GetMaxXMove (); //max X position of left-most dot int i ; //counters: general -purpose, word, stripe 1nt word: int stripe: WORD huge *bufPtr; //pointer to page buffer //ifdef C0UNT_D0TS long dotTotal = 0; //endif flipped = GetJobFlipYO ; //test for flipped bitmap //// stripes: lesser of raster file height, distance to bottom of bed stnpesToSend = MIN (GetRasterHeight (oldBM). GetMaxYMoveO - yLoc); if (stnpesToSend <= 0) //flag error if nothing to print errStat = TRUE; if (lerrStat) //if no errors yet { *pLen = stnpesToSend; //tell caller how many stripes if (xLoc >= (maxXmove + GetNPixels () ) ) //if starting X is beyond width of bed. flag error errStat = TRUE: else if (xLoc > maxXmove) { //else if starting x is beyond point where we can place the first dot //we have to build a new. temporary raster file, shifting data to right newBM = ShiftedRasterFile ( oldBM, maxXmove. xLoc. wordsPerLine. yLoc. stnpesToSend, TRUE ). //if succesful creating shifted file, tell the caller we're using the //new shifted raster file, else flag error if (newBM > oldBM) *pBM - activeBM = newBM; else errStat = TRUE: } else //else no shift needed, tell caller we're printing the original file *pBM = activeBM = oldBM: } if (lerrStat) //if no errors yet ( errStat = OpenPπntDataFi 1 e (activeBM); //open raster file, flag errors if OerrStat) { lmagePtr = PnntBuffer; //point to start of print buffer //LOOP TO COPY RASTER DATA LINE-BY-LINE TO PRINT BUFFER // - for (stripe - 0; stripe < stnpesToSend; stnpe++) { //flag error if not enough room for another line if (imagePtr + wordsPerLine >= PπntBufferEnd) { errStat - TRUE; break; //else (enough room) zero out next line of print buffer bufPtr = imagePtr; for (word = 0; word < wordsPerLine; word++) *bufPtr++ - 0 //ifdef C0UNT_D0TS //copy stripe of file data from file to buffer (dot-counting version) 1 ineDots[strιpe] = GetPπntData (imagePtr); dotTotal += 1 ineDotststripe] ; //el se / /copy stri pe of data from f i l e to buffer ( non -dot - counti ng vers i on ) GetPn ntData ( i magePtr ) ; //end i f //point to next line of print buffer imagePtr += wordsPerLine: } //LOOP DONE: if (flipped) //point to last line of print buffer for flipped bitmap imagePtr - PπntBuffer + (long) wordsPerLine * (long) ( stri pesToSend- 1 ) ; else //point to first line of print buffer for normal bitmap imagePtr = PrintBuffer; CloseRasterFile (activeBM); //close raster file if (GetRasterTempFlag (activeBM)) //if raster file was temporary (shifted) DeleteRasterFile (activeBM); //delete it ) } if OerrStat) { //print nominal dot power //ifdef C0UNT_D0TS printf ("Average power. %.2f\r\n", dotTotal / stnpesToSend * GetMaxWatts( ) * GetJobPnntEnergyNu O / 100.), //endif //set speed of stripe IRQ timer startPCycleTimer (GetJobPnntSpeed ()); if OerrStat) //if no errors yet { //fill inverted current stripe data for upcoming edge enhancement for (word = 0; word < wordsPerLine; word++) notCurrentStrιpe[word] = Oxffff; getNextStnpe( ) ; //fetch first stripe from array ssNum - 0; //imt substripe counter to 0 shiftStnpe (πormalStripe) ; //shift first stripe to head if (errStat) //if errors, tell caller: *pBM = 0; //printing no bitmap *pLen = 0; //lenght is zero //Initialize array tHeadSampleU to current thermistor data for (i = 0; i < 16: i++) tHeadSample[i] - Analog (HEAD_TEMP_AD) : tHeadlndex = 0: setStrobeEnergy (0); //set duty cycle for first substripe return errStat; //return error status flag // FUNCTION: StartPrinting // // PURPOSE: Starts interrupt-dnven printing via stripe timer IRQ // // USAGE: void StartPrinting (void) // // PROTOTYPE IN: PHEAD. H // // ARGUMENTS: none // . // RETURN VALUE none // CALLS: (macros) <DOS.H>: outportbO DATADEFS.H: DISABLEO DATADEFS.H: ENABLEO (functions) PHEAD: setStrobeEnergy() AFFECTS: none void StartPrinting (void) ( setStrobeEnergy (0); //set duty cycle for first substripe printing = TRUE: //printing begins now DISABLEO; DDSIcr |= ENABLE_STRIPE_IRQ: //Enable stripe timer IRQ: "or" in irq enable bit outportb (DDS_ICR. DDSIcr): // set enable bit in port ENABLEO: } // LOCAL FUNCTION DEFINITIONS // FUNCTION: buildEdgeStripe // // PURPOSE: Builds "edgeStnpeU" , line of edge enhancement data for head // // Each dot in this stripe is 1 (ON) if: II II current dot is 1 and ( current dot was previously 0 // {OR dot to its right is 0 // // USAGE: void near bui ldEdgeStπpe (void) // // PROTOTYPE IN. local // // ARGUMENTS: none // 11 RETURN VALUE: none II II CALLS: (macros) II <D0S.H> ιnportb( ) II <00S.H> outportb( ) II <D0S.H> FP_0FF() II II AFFECTS: Updates array edgeStπpe[] . intermediate arrays II notLeftStnpe[] and notRιghtStnpe[] I I void near bui ldEdgeStπpe (void) { . /ytrig logic analyzer: start computing edge stripe data outportb (LPT1. inportb (LPT1) | 0x02). asm push es //save ES asm mov ax, ds asm mov es, ax //set ES to data segment DS // Form a 1 pixel left shifted version of the inverted current stripe to // represent dots without right neighbors. // // Thi s assumes a pi xel organi zati on as fol l ows : // // word: | 0 | 1 | 2 | ... | n | // pixel: j 15 θj 15 θj 15 0| |15 0| // // - asm std //set direction flag for auto decrement _SI - FP_0FF (notCurrentStnpe) : //DS:SI - source = notCurrentStripe _DI - FP_0FF (notRightStnpe); //ES:DI = dest = notRightStnpe asm mov ex, wordsPerLine //CX = wordsPerLine asm mov bx. ex //BX = 2 * (CX-1) asm dec bx // - offset in bytes to last word in each asm add bx. bx // stripe buffer asm add si . bx //Add BX offset to SI and to DI asm add di . bx asm stc //set carry before starting shift //(data is inverted) next_lsh1ft: asm lodsw //get a word from notCurrentStripe asm rcl ax. 1 //shift 1 bit left asm stosw //store shifted version in notRightStnpe asm loop next_lshift //loop till done // Form a 1 pixel right shifted version for dots without left neighbors // (See above comment for data organization) / / asm el d //clear direction flag for auto increment _S I - FP_OFF( notCurrentStn pe ) , //DS:SI = source = notCurrentStripe _DI - FP_OFF( notLeftStπ pe ) : //ES:DI = dest = notLeftStπpe asm mov ex , wordsPerLi ne //CX = wordsPerLine asm stc //set carry before starting shift //(data is inverted) next_rshift: asm lodsw //get a word from notCurrentStripe asm rcr ax. 1 //shift 1 bit right asm stosw //store shifted version in notLeftStπpe asm loop next_rshιft //loop till done //Merge data from notCurrentStripe, notPrevStnpe, notteftStnpe and //notRightStnpe to form edge-enhancement data edgeStnpe. // //Each bit in edgestnpe is set to 1 if corresponding merged bits are: // notCurrent = 0 AND (notLeft-1 OR notRιght=l notLeft-1) Jl / Thιs result bit is XORed with "dots off" bit in clearOata to set correct //polarity for printing when shifted to the head // - //leave direction flag set for auto increment _SI - FP_OFF(notCurrentStnpe) , //DS-.S1 = source = notCurrentStripe _DI - FP_OFF(edgeStnpe): //ES:DI = dest = edgeStnpe asm mov ex, wordsPerLine //CX = wordsPerLine asm mov bx. 0 //BX = offset to notPrev, notLeft, & notRight next_edge: asm mov dx, word ptr notPrevStnpe [bx] //dx notPrev OR notLeft OR notRight asm or dx. word ptr notLeftStnpe [bx] asm or dx. word ptr notRightStnpe [bx] asm lodsw //get word from notCurrentStripe asm not ax //flip it to normal polarity asm and ax, dx //AND it with mask bits in DX asm xor ax. clearData //XOR it with "dots off" bits in clearData asm stosw //store it in edgeStnpe asm add bx. 2 //increment offset to next mask asm loop next_edge //loop till done asm pop es //restore original contents of ES //trig logic analyzer: done computing edge stripe data outportb (LPT1, inportb (LPT1) & -0x02); FUNCTION: getNextStπpe PURPOSE: Fetches a stripe of raster data from the print buffer Builds array normalStrιpe[ ] for shifting to head Builds arrays notPrevStnpe[] and notCurrentStnpe[] for later use in computing edge enhancement stripe USAGE : voi d near getNextStπ pe ( voi d ) // // PROTOTYPE IN: local // // ARGUMENTS: none // // RETURN VALUE: none // CALLS: (macros) <D0S.H> ιnportb( ) <D0S.H> outportb( ) <D0S.H> FPJJFFO <D0S.H> FP_SEGO AFFECTS: updates print buffer pointer bufPtr updates arrays normalStnpe[] , notPrevStnpe[] and notCurrentStπ pe[ ] void near getNextStnpe (void) { //trig logic analyzer: start computing normal stripe data outportb (LPT1. inportb (LPT1) | 0x02), asm push es //save contents of DS and ES asm push ds asm eld //clear direction flag for auto increment //throughout this routine //Copy former contents of notCurrentStnpe[] into notPrevStπpe[] // asm mov ax. ds //set ES to data segment DS asm mov es. ax _SI - FP_0FF (notCurrentStripe): //DS:SI = source = notCurrentStripe _DI - FP_0FF (notPrevStnpe); //ES:DI = dest = notPrevStnpe asm mov ex, wordsPerLine //CX = wordsPerLine asm mov bx. ex //BX = wordsPerLine (save a copy) asm rep movsw //copy data _DS - FP_SEG (imagePtr): //DS:SI = ■ source - imagePtr (current _SI - FP_0FF (imagePtr); // (line of print buffer) _DI - FP_0FF (notCurrentStripe); //ES:DI = dest = notCurrentStripe asm mov ex. bx //CX = copy of wordsPerLine next_from_buffer : asm lodsw //get word from bitmap buffer asm not ax //complement data asm stosw //store in notCurrentStripe asm loop next_from_buffer //loop till done asm pop ds //restore DS (current data segment) //Copy/invert from notCurrentStπpe[] (XORed with "dots off" data) //to normalStnpe[] for upcoming shift to head. // _SI - FP_0FF (notCurrentStripe). //DS:SI = source - -notCurrentStripe _DI - FP_0FF (normalStπpe); //ES: DI = dest = normalStnpe asm mov dx. clearData //DX = "dots off" data = clearData asm mov ex, bx //CX = copy of wordsPerLine next_normal : asm lodsw //get word from notCurrentStripe asm not ax //complement it back to normal asm xor ax, dx //XOR it with "dots off" value " asm stosw //store it to normalStnpe asm loop next_normal //loop till done asm pop es //restore ES if (flipped) imagePtr - wordsPerLine: //back up one line for flipped bitmap else imagePtr +- wordsPerLine: //advance one line for normal bitmap //trig logic analyzer: done computing normal stripe data outportb (LPT1. inportb (LPT1) & -0x02). } . // , — = = ______ .---— // FUNCTION: setStrobeEnergy // // PURPOSE: Sets timer value and mode to produce the correct duty cycle // value for the selected sub-stripe // // USAGE: void near setStrobeEnergy (int ss) // // PROTOTYPE IN. local void near setStrobeEnergy (int ss) { WORD pulseCount; //timer counter value for microstrobe on-time BYTE mode; //timer mode for microstrobe on-time WORD tHeadAverage; //average of recent head thermistor A/D readings int ι. //general -purpose counter //grab new thermistor reading, stuff it via pointer to array //bump pointer for next time tHeadSample[tHeadIndex++] = Analog(HEAD_TEMP_AD) ; if (tHeadlndex >- 16) tHeadlndex - 0: //compute average of thermistor values for (tHeadAverage - 0, i = 0; i < 16: i++) tHeadAverage +- tHeadSample[i] ; tHeadAverage >>= 4; //divide by 16 //use rolloffTable for lookup of microstrobe timer count and mode //corresponding to thermistor average and sub-stripe pulseCount = rolloffTable[tHeadAverage][ss]. count; mode - rolloffTable[tHeadAverage][ss].mode: //update duty cycle period timer to constant rate outportb (DDS_TMR_345_CTRL. C0UNTER_1 | STB_M0DE_2); outportb (DDS_TMR_4. (WORD)PERI0D_COUNT) outportb (DDS_TMR_4. ((WORD)PERIOD_C0UNT) >> 8); //updated duty-cycle on-time timer to looked-up on-time outportb (DDS_TMR_345_CTRL. C0UNTER_2 | STB_M0DE_1): outportb (DDS_TMR_5. pulseCount); outportb (DDS_TMR_5, pulseCount >> 8); // , setup strobe control lines per looked-up mode word outportb(HEAD_STROBE_CTRL, mode | 3): // set us mode, strobes enabled // FUNCTION: shiftStripe // // PURPOSE: Shifts a stripe of raster data to the printhead // // USAGE: void near shiftStripe (WORD near *pStripe) // // PROTOTYPE IN: local // // ARGUMENTS: pStripe: pointer to a stripe of data for the printhead // // RETURN VALUE: none // // CALLS: (macros) // <D0S.H> inportb( ) // <D0S.H> outportb( ) // <D0S.H> FP_0FF( ) // // AFFECTS: none // __—: » _——_ void near shiftStripe (WORD near *pStripe) { //trig logic analyzer: start shifting stripe data outportb (LPT1. inportb (LPT1) | 0x01); asm push ds //save contents of DS asm mov bx, leftWords //BX = offset in words to data for right part of head asm mov ex. pairsToShift //CX = number of word pairs to shift out to head _AX - FP_0FF (pStripe): //AX = (near) ptr to first (left) word of stripe asm add ax. bx //DI = AX + (2 * BX) asm add ax. bx // = ptr to of data for right part of head asm mov di , ax asm sub ax. ex //SI = DI - (2 * CX) asm sub ax. ex // = ptr to data for left part of head asm mov si, ax // (may contain leading garbage) asm mov bx. 0 //BX - 0 = running offset to add to SI and to DI // LOOP TO SHIFT 2 WORDS OF DATA TO HEAD (LEFT & RIGHT SIMULTANEOUSLY) // shiftTwoWords: asm mov dx. LEFT_HEAD_SR //port number for left head shift reg asm mov ax. [bx+si] //fetch a word asm out dx. ax //load left shift reg (no shift yet) asm mov dx. RIGHT_HEAD_SR //port number for right head shift reg asm mov ax. [bx+di] //fetch a word asm out dx, ax //load right shift reg (starts shifting) asm add bx. 2 //bump offset to next words of data //ifdef AMPR0_CM486II // // WAIT FOR SHIFT COMPLETE: SOFTWARE DELAY LOOP. // / / MACHI NE DEPENDENT . BUT FASTER THAN HARDWARE METHOD / / ( REQU I RED FOR RELIABLE 2 - I NCH - PER- S ECOND PRI NT I NG W I TH 4 " WI DE HEAD ) // // Delay just long enough so that I/O write to LEFT_HEAD_SR always occurs // just after the HEAD_SHIFT_DONE signal from the XILINX gate array goes // high. This must be determined emperically using a scope or analyzer. // asm mov ax, 28 //loop counter (determined emperically) wai tShiftDone: asm dec ax //dec counter asm jnz wai tShiftDone //loop till we've waited long enough asm loop shiftTwoWords //END OF LOOP.. SHIFT 2 MORE WORDS //else // // WAIT FOR SHIFT COMPLETE: READ BACK THE LEFT_HEAD_SR SIGNAL IN HARDWARE // // MACHINE INDEPENDENT. BUT SLOWER // (TOO SLOW FOR RELIABLE 2-INCH-PER-SECOND PRINTING WITH 4" WIDE HEAD) // asm mov dx. DIGITAL_IN //Set port address for reading waitShiftDone: asm in ax. dx; //read (slow, since it waits for ISA bus) asm and ax. HEAD_SHIFT_DONE //is shift done signal hi yet asm jz waitShiftDone //loop if it ain't //endif // DONE // asm pop ds //restore DS //trig logic analyzer: done shifting stripe data outportb (LPT1, inportb (LPT1) & -0x01); } // FUNCTION: startPCycl eTimer // // PURPOSE: Sets up and starts print stripe timer for correct print speed // // USAGE: void near startPCycleTimer (double speed) // // PROTOTYPE IN: local // // ARGUMENTS: speed: desired print speed in inches per second // II RETURN VALUE: none It , ' II CALLS: (macro) // <D0S.H>: outportbO // // AFFECTS: Stripe timer (does not enable stripe IRQs) void near startPCycleTimer (double speed) { WORD Timer_count; //compute counter value desired substripe rate Timer_couπt = (WORD) (DDS_TMR_SLOW_CLK / (speed * resolution * 3)); //program the timer to run outportb ( DDS_TMR_012_CTRL. COUNTER ) j LSB_MSB | C0UNTER_M0DE_2 | C0UNT_BINARY ): outportb(DDS_TMR_0, Timer_count) ; outportb(DDS_TMR_0. Timer_count >> 8): } //ifdef TW0_R0LL0FF_M0DES FUNCTION: SetConstantRolloff GetConstantRolloff PURPOSE: SetConstantRolloff: Sets/clears constantRolloff flag. GetConstantRolloff: Returns value of the constantRolloff flag If the flag is set, duty cycle is rolled off by a constant amount per degree F, unaffected by the Print Energy setting If the flag is clear, duty cycle is rolled off by a percentage amount per degree F. based on the Print Energy setting. USAGE : void SetConstantRolloff (BOOL flag) BOOL GetConstantRolloff (void) PROTOTYPE IN: local ARGUMENTS: For SetConstantRolloff: new value for constantRolloff flag For GetConstantRolloff: none I- RETURN VALUE: For SetConstantRolloff: none For GetConstantRolloff: current value of constantRolloff flag CALLS: none AFFECTS: Energy vs temperature rolloff via value constantRolloff flag void SetConstantRolloff (BOOL flag) { constantRolloff = flag: ) BOOC GetConstantRolloff (void) ( return constantRolloff; ) //endif

Claims: Other embodiments are within the following claims: 1. A digital decorating system for transferring a selected image to a surface of an article, comprising a thermal printhead including a plurality of energizable heater elements constructed and arranged to deliver heat to a thermal line of pixels on a surface of said printhead; an advancing mechanism constructed and arranged to produce relative movement between said printhead and said surface of said article; a force member constructed and arranged to exert a selected amount of pressure between said thermal line of pixels and said surface of said article; a microcontroller operatively connected to said printhead, said force member and said advancing mechanism to provide control signals selectively delivering heat to pixels of said thermal line and selectively causing said movement thereby thermally transferring, over a two dimensional array of pixels, a two dimensional image to said article surface; said microcontroller further constructed and arranged to classify said pixels corresponding to said image into perimeter pixels and interior pixels and control energy levels delivered to produce heat at said perimeter pixels and interior pixels, said energy levels delivered to each pixel cooperatively depending on a level of energy previously delivered to said pixel, on levels of energy delivered to neighboring pixels and on a level of energy required at said pixel to thermally transfer said image to said surface. 2. The digital decorating system of claim 1 wherein said thermal line of pixels presses directly onto said surface of said article to transfer said image by thermally altering said surface of said article. 3. The digital decorating system of claim 1 further comprising a thermal foil, including a metallic layer, located between said thermal line and said surface of said article. 4. The digital decorating system of claim 3 wherein said pixel is a perimeter pixel relative to said image and said microcontroller is arranged to provide to said perimeter pixel an energy level substantially above a threshold level of energy required for thermal transfer of material from said thermal foil thereby creating a substantial gradient of temperature between said perimeter pixel and a neighboring pixel outside of said image, said substantial gradient enhancing the thermal transfer of said metallic layer to said surface. 5. The digital decorating system of claim 3 wherein said pixel is a perimeter pixel of said image that, together with neighboring perimeter pixels, form a line of said image at an acute angle relative to said thermal line, said microcontroller being arranged to provide to said perimeter pixel an energy level above a threshold level of energy required for thermal transfer of material from said thermal foil, and said microcontroller being also constructed and arranged to provide to a pixel outside of said image and in a corner neighboring two said perimeter pixels an energy level below said threshold level. 6. The digital decorating system of claim 5 wherein said selected angle is from about 30 degrees to about 60 degrees. 7. The digital decorating system of claim 5 wherein said perimeter pixel immediately precedes several pixels that received energy substantially below said threshold level, said microcontroller being arranged to provide to said perimeter pixel an energy level substantially above said threshold level thereby creating a substantial gradient of temperature between said perimeter pixel and a neighboring pixel, said substantial gradient causing thermal transfer of said metallic layer to said surface. 8. The digital decorating system of claim 5 wherein said perimeter pixel immediately follows several interior pixels, said microcontroller being arranged to provide to said perimeter pixel an energy level about equal to said threshold level to cause thermal transfer of said metallic layer to said surface. 9. The digital decorating system of claim 4 wherein said pixel is an interior pixel and said microcontroller is arranged to provide to said interior pixel an energy level below said energy level delivered to said perimeter pixel. 10. The digital decorating system of claim 1 wherein said printhead includes a heat sink and a thermal exchange unit thermally connected to said thermal line and constructed to actively deliver or remove heat from said heat sink. 11. The digital decorating system of claim 10 wherein said thermal exchange unit is constructed to actively cool said printhead. 12. The digital decorating system of claim 3 further comprising a surface heater located near said thermal line, said surface heater constructed to preheat said surface immediately before said surface reaches said thermal line. 13. A computer controlled thermal decorator for transferring images from a thermal foil comprises: a printhead, having a set of heater elements to thermally transfer a line of material from a thermally transferrable foil to a substrate; an advancing mechanism to produce relative movement between the printhead and the substrate, enabling thermal transfer of a plurality of lines of material to form a deposited pattern; and a controller that for each pixel, examines the relationship of neighboring pixels to the pixel and based upon the relationship of s print status of the pixel and its neighboring pixels, adjusts a level of energy to be applied to the heater element in respect to the pixel. 14. The computer controlled thermal decorator of claim 13 further comprising a force member disposed to exert a selected amount of pressure between said thermal line of pixels and a surface of an article. 15. The computer controlled thermal decorator of claim 14 wherein the controller is operatively connected to said printhead, said force member and said advancing mechanism to provide control signals to control each of the members. 16. The computer controlled thermal decorator of claim 15 wherein the controller via the control signals selectively delivers heat to selected heater elements of the printhead and selectively causing said movement to thermally transfer, over a two dimensional array of pixels, a two dimensional image to the article surface. 17. The computer controlled thermal decorator of claim 16 wherein said controller classifies said pixels corresponding to said image into perimeter pixels and interior pixels and controls energy levels delivered to produce heat at said perimeter pixels and interior pixels in accordance with the level of energy previously delivered to said pixel, and to levels of energy delivered to said neighboring pixels, and to a level of energy required at said pixel to thermally transfer said thermally transferrable material to said surface. 18. The computer controlled thermal decorator of claim 17 wherein said printhead presses directly against said surface of said article while selected elements are heated to transfer said material to the surface of the article. 19. The computer controlled thermal decorator of 17 further comprising a thermal foil, including a metallic layer, located between said printhead and said surface of said article. 20. The computer controlled thermal decorator of claim 15 wherein said pixel is a perimeter pixel relative to a portion of the substrate to be printed and said controller is arranged to provide to said perimeter pixel an energy level substantially above a threshold level of energy required for thermal transfer of material from said thermal foil to produce a substantial gradient of temperature between said perimeter pixel and a neighboring pixel outside of a portion of the surface to be printed, said substantial gradient enhancing the thermal transfer of said metallic layer to said surface. 21. The computer controlled thermal decorator of claim 15 wherein said pixel is a perimeter pixel of a portion of the substrate to be printed that, together with neighboring perimeter pixels, form a line of said of portion of the substrate to be printed at an acute angle relative to said thermal line, said controller providing to said perimeter pixel an energy level above a threshold level of energy required for thermal transfer of material from said thermal foil, and said controller providing to a pixel outside of said portion of the substrate to be printed and in a corner neighboring two said perimeter pixels an energy level below said threshold level. 22. The computer controlled thermal decorator of claim 21 wherein said selected angle is from about 30 degrees to about 60 degrees. 23. The computer controlled thermal decorator of claim 21 wherein said perimeter pixel immediately precedes several pixels that received energy substantially below said threshold level, said controller provides to said perimeter pixel, via the control signals, an energy level substantially above said threshold level to produce a temperature gradient of between said perimeter pixel and a neighboring pixel, said gradient causing thermal transfer of said metallic layer to said surface. 24. The digital decorating system of claim 23 wherein said perimeter pixel immediately follows several interior pixels, said controller provides to said perimeter pixel an energy level about equal to said threshold level to cause thermal transfer of said metallic layer to said surface. 25. The digital decorating system of claim 24 wherein said pixel is an interior pixel and said controller is arranged to provide to said interior pixel an energy level below said energy level delivered to said perimeter pixel. 26. The digital decorating system of claim 13 wherein said printhead includes a heat sink and a thermal exchange unit in thermally communication with said printhead elements and to actively deliver or remove heat from said heat sink. 27. The digital decorating system of claim 26 wherein said thermal exchange unit cools said printhead. 28. The digital decorating system of claim 26 further comprising a surface heater located near said thermal line, said surface heater disposed to preheat said surface immediately before said surface reaches said thermal line. 29. A method for thermally transferring a selected image to a rough surface of an article, comprising allocating an amount of heat to each pixel of a two dimensional array of pixels forming said image, said array of pixels being formed by interior and perimeter pixels and said amount cooperatively depending on at least one of, a position of said pixel, heat previously allocated to said pixel, heat allocated to neighboring pixels, and heat required at said pixel to thermally transfer said image to said surface, delivering said amount of heat to each pixel of a thermal line of pixels located on a surface of a printhead by energizing heater elements of said printhead, and causing relative movement between said printhead and said surface while thermally transferring said image to said surface. 30. The method of claim 29 further comprising pressing directly said thermal line onto said surface of said article to transfer said image by thermally altering said surface of said article. 31. The method of claim 29 wherein said pressing further comprises pressing a thermal foil including a specular metallic layer, against said surface while thermally transferring material from the foil to the surface of said article. 32. The method of claim 29 wherein said allocating step includes providing to a perimeter pixel an amount of heat substantially above a threshold amount of heat required for thermal transfer of material from said thermal foil to produce a temperature gradient between said perimeter pixel and a neighboring pixel outside of said image, said gradient enhancing the thermal transfer of said metallic layer to said surface. 33. The method of claim 29 wherein said allocating step includes finding a perimeter pixel of said image that together with neighboring perimeter pixels forms a line of said image at a selected angle relative to said thermal line, providing to said perimeter pixel an amount of heat above a threshold amount of heat required for thermal transfer of material from said thermal foil, and providing to a pixel, located outside of said image and neighboring two perimeter pixels, an energy level below said threshold level. 34. The method of claim 29 wherein said allocating step includes finding a perimeter pixel of said image that adjoins an interior pixel, and providing to said perimeter pixel an amount of heat about equal to a threshold amount of heat required for thermal transfer of material from said thermal foil. 35. The method of claim 29 further comprising providing a heat sink thermally connected to said thermal line, and conducting heat between said heat sink and an exchange unit. 36. The method of claim 35 wherein said step of conducting heat includes delivering heat to said heat sink. 37. The method of claim 35 wherein said step of conducting heat includes removing heat from said heat sink. 38. The method of claim 30 further comprising preheating a portion of said surface of said article immediately before said portion reaches said thermal line. 39. The method of claim 31 further comprising: preheating a portion of said thermal foil immediately before said portion reaches said thermal line.

Inventors: ARONEO STEPHEN L, POLLARA NICOLAS J, ROSENFELD JON, ARONEO, STEPHEN, L., POLLARA, NICOLAS, J., ROSENFELD, JON
Applicants: ARONEO STEPHEN L, GEN SCANNING INC, POLLARA NICOLAS J, ROSENFELD JON, ARONEO, STEPHEN, L., GENERAL SCANNING, INC., POLLARA, NICOLAS, J., ROSENFELD, JON
Application year: 1998
Main classification: H04N1
IPC codes: B41J2, G06K15, H04N1