Vibrating mirror LSU control method
Technical Field
The invention relates to the technical field of laser printing, in particular to a vibrating mirror LSU control method.
Background
The vibrating mirror is a good vector scanning device, which is driven based on a swinging motor, the basic principle is that an electrified coil generates moment in a magnetic field, but the vibrating mirror is different from a rotating motor, a reset moment is added on a rotor through a mechanical torsion spring or an electronic method, the size of the vibrating mirror is in direct proportion to the angle of the rotor deviating from a balance position, when the coil is electrified with a certain current and the rotor deflects to a certain angle, the electromagnetic moment is equal to the reset moment, so the vibrating mirror cannot rotate like a common motor, can only deflect, and the deflection angle is in direct proportion to the current. Compared with the traditional LSU, the laser printer has the advantages of lower cost, lower noise and lower energy consumption, so that the laser printer has good application prospect in the laser printer, when the laser printer adopts the laser printer to print by the laser LSU, the laser source emits light to the laser, the laser reflected light is transmitted to the photosensitive drum through the lens to form an electrostatic latent image, the laser reflected light is only deflected on the photosensitive drum to retrace left and right, the mode is greatly different from the traditional LSU, the traditional LSU reflected light is only swept along one direction and does not change the direction, the laser LSU is retraced left and right, the sequence of output data is different from left to right, and the data control method of the traditional LSU is difficult to continue.
Disclosure of Invention
In order to solve the problems, the invention provides a vibrating mirror LSU control method.
The invention is realized by the following technical scheme that the vibrating mirror LSU control method comprises the following steps:
s1, acquiring a printing instruction issued by a user through a client;
S2, generating corresponding printing data at the client according to the received printing instruction;
s3, the client side or the printer side driver reversely converts the printing data output from right to left;
S4, the client side or the printer side driver transmits the printing data to the printer;
S5, the printer program controls the swinging of the vibrating mirror according to the type of the printed document, such as characters and images, and executes the printing task.
Further, the client is a mobile phone, a PC or an embedded device with a printing function.
Further, the step S5 specifically includes the following steps:
extracting text or image information in the printed document using image processing or text recognition techniques;
setting the oscillation frequency, direction and amplitude parameters of the vibrating mirror according to the document type;
programming a control program of the galvanometer by using a programming language, and controlling the oscillation of the galvanometer according to the document type and the control parameters;
and testing and optimizing the swinging mode of the vibrating mirror by adjusting control parameters or modifying programs.
Further, the client side or printer side driver transmits the processed print data to the printer by means of network, data line or bluetooth transmission.
Further, the printing instructions comprise the content to be printed in the forms of documents, images and other formats, and further comprise the output format, color, resolution, paper size and other printing parameters of the content.
Further, the programming language is Python or MATLAB.
Further, the method also comprises the steps of extracting edge information of the content to be printed by using an edge detection algorithm, and determining the swinging angle and speed of the vibrating mirror according to the edge information, wherein the specific steps are as follows:
extracting edge information of the content to be printed through an edge detection algorithm;
identifying the extracted edge information and determining the edge related to the printing content;
calculating the swing amplitude and period of the vibrating mirror according to the identified edge position and intensity;
and controlling the swinging angle and speed of the vibrating mirror according to the calculated swinging amplitude and period of the vibrating mirror.
Further, the oscillation amplitude and period of the oscillating mirror are synchronous with the data direction of the content to be printed.
Further, the edge detection algorithm is a Canny algorithm.
Further, the specific steps of extracting the edge information of the content to be printed by using the Canny algorithm are as follows:
T1, carrying out gray processing on the content to be printed, and converting the color content to be printed into black and white content to be printed;
t2, gaussian blur filtering is carried out on the content to be printed so as to reduce noise in the content to be printed;
T3, performing double-threshold processing on the content to be printed, and dividing the content to be printed into a high-threshold region and a low-threshold region;
t4, for a high threshold area, calculating the gradient between adjacent pixels and judging whether the gradient is an edge pixel or not;
T5, for the detected edge pixels, calculating the gradient directions and gradient amplitudes around the detected edge pixels to determine the directions and the intensities of the edges;
T6, connecting the detected edge pixels to form an edge curve;
and T7, carrying out smoothing treatment on the edge curve to remove noise on the edge, and outputting the extracted edge curve and edge strength.
The beneficial effects of the invention are as follows:
the invention applies the vibrating mirror LSU to the laser printer, converts the printing data direction well in advance before exposure, realizes the synchronization of the swing amplitude and the period of the vibrating mirror with the data direction of the content to be printed through programming, can ensure that the printed image is a normal image, has the advantages of lower cost, lower noise and lower energy consumption compared with the traditional LSU, extracts the edge information of the content to be printed by using a Canny algorithm, controls the swing of the vibrating mirror according to the document content edge, can improve the printing speed and reduces the invalid swing of the vibrating mirror.
Drawings
FIG. 1 is a schematic diagram of a laser printing principle based on a galvanometer LSU according to an embodiment of the invention;
fig. 2 is a schematic flow chart of PC or mobile phone side data conversion according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a printer-side data conversion according to an embodiment of the present invention.
Detailed Description
For a better understanding of the objects, technical solutions and advantages of the present invention, reference will be made to the following detailed description of the present invention with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some, but not all, embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, a schematic diagram of a laser printing principle based on a vibrating mirror LSU according to an embodiment of the present invention is shown, and when printing, a laser source emits light to the vibrating mirror, and the vibrating mirror reflects the light to the photosensitive drum through the lens, so as to form an electrostatic latent image. Unlike conventional LSUs, which scan reflected light in only one direction without changing direction, the vibrating mirror LSUs retrace left and right, which output data in different orders from left to right and from right to left, and cannot continue the data control method of conventional LSUs. Therefore, the embodiment provides a vibrating mirror LSU control method, which converts printing data well before exposure, namely when the vibrating mirror LSU scans from left to right, the data is processed normally, but when the vibrating mirror LSU scans from right to left, the whole data is required to be mirrored, so that the printed image is a normal image.
A vibrating mirror LSU control method comprises the following steps:
s1, acquiring a printing instruction issued by a user through a client;
S2, generating corresponding printing data at a client according to the received printing instruction, wherein the printing instruction comprises a document, an image and other formats of content to be printed, and also comprises the output format, color, resolution, paper size and other printing parameters of the content;
The method for converting the data of the PC or the mobile phone side comprises the steps that before the PC or the mobile phone side transmits the printing data to the printer, the printing data output from the right to the left are converted in all reverse directions, and then the printing action is executed by the printer;
As shown in fig. 3, the printer-side data conversion method is that the PC or the mobile phone side does not need special processing, and after receiving the data, the printer reversely converts all the print data outputted from right to left and then sends the print data to the printer to execute the printing operation. The related data reversing operation is realized through related image-text conversion software installed on a client or a printer;
The client side or the printer side driver transmits the processed printing data to the printer in a network, data line or Bluetooth transmission mode;
S5, the printer program controls the swinging of the vibrating mirror according to the type of the printed document, such as characters and images, and the specific steps are as follows:
extracting text or image information in the printed document using image processing or text recognition techniques;
setting the oscillation frequency, direction and amplitude parameters of the vibrating mirror according to the document type;
programming a control program of the galvanometer by using a programming language, and controlling the oscillation of the galvanometer according to the document type and the control parameters;
and testing and optimizing the swinging mode of the vibrating mirror by adjusting control parameters or modifying programs.
The preferred scheme of the embodiment is that the method further comprises the steps of extracting edge information of the content to be printed by using an edge detection algorithm, and determining the swinging angle and speed of the vibrating mirror according to the edge information, wherein the method comprises the following specific steps:
(1) And extracting edge information of the content to be printed by an edge detection algorithm, wherein the edge detection algorithm is a Canny algorithm. Specifically, the specific steps of extracting edge information of the content to be printed using the Canny algorithm are:
In image processing, graying is a technology for converting a color image into a black-and-white image, and each pixel in the color image is multiplied by a three primary color value and summed, and then the result is divided by 3, and the RGB value of each pixel is converted into a gray value thereof, so that the color image can be converted into the black-and-white image, wherein each pixel only contains information of one color;
by applying a Gaussian kernel to each pixel in the image, the pixel values around the pixel are weighted and averaged to reduce the influence of noise, so that the image can be clearer, and meanwhile, the detailed information of the image is kept;
T3, performing double-threshold processing on the content to be printed, and dividing the content to be printed into a high threshold value region and a low threshold value region;
T4, calculating the gradient between adjacent pixels and judging whether the gradient is an edge pixel or not for a high threshold area, and also calculating the gradient between the adjacent pixels and judging whether the gradient is an edge pixel or not for a low threshold area, wherein the gradient refers to the change rate of pixel values in an image, the gradient is used for detecting the edge in the image in a Canny algorithm, and for the high threshold area, the pixel with the gradient being larger than a certain threshold value is considered to be the edge pixel, and for the low threshold area, the pixel with the gradient being smaller than or equal to the certain threshold value is also considered to be the edge pixel;
For the detected edge pixel, the Canny algorithm calculates the gradient direction and the gradient amplitude around the detected edge pixel to determine the direction and the intensity of the edge, wherein the gradient direction represents the direction of the edge and the gradient amplitude represents the intensity of the edge;
connecting the detected edge pixels to form an edge curve, wherein in the connecting process, if the distance between the two edge pixels is smaller than a threshold value, the two edge pixels are considered to be adjacent;
T7, smoothing the edge curve to remove noise on the edge, and outputting the extracted edge curve and edge strength;
(2) Identifying the extracted edge information and determining the edge related to the printing content;
(3) The oscillation amplitude and the period of the oscillating mirror are synchronous with the data direction of the content to be printed, and the identified edge position and intensity parameters of the content to be printed correspond to the width of the oscillating mirror on printing paper after passing through the lens;
(4) And controlling the swinging angle and speed of the vibrating mirror according to the calculated vibrating mirror swinging amplitude and period, wherein the programming language is Python or MATLAB.
The foregoing examples have shown only the preferred embodiments of the invention, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that modifications, improvements and substitutions can be made by those skilled in the art without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.