Printer status detection methods, devices, and printers
By combining a light transmitter circuit and a light receiver circuit, the printer's cartridge cover and paper status are detected by utilizing the resistance change and output voltage value of the resistor module. This solves the high cost problem caused by the need for a dedicated module in the existing technology and realizes a cost-effective detection solution.
Patent Information
- Application Number
- CN202310797798.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-06-30
AI Technical Summary
Current printer status detection requires dedicated lid detection and paper detection modules, resulting in high production costs.
The system employs a light emitter circuit and a light receiver circuit. By controlling the light emission state of the light emitter and the resistance change of the resistor module, the output voltage value is obtained to detect the printer's cartridge cover and paper status.
A single detection module can detect both the lid and paper status, reducing the printer's production costs.
Smart Images

Figure CN116619922B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printer technology, and more particularly to a printer status detection method, apparatus, and printer. Background Technology
[0002] The rapid development of thermal transfer technology has spurred the emergence of printers applicable to various scenarios, such as express delivery waybill printers, price tag printers, and thermal receipt printers. With fierce competition among printer manufacturers, market share is typically captured by lowering product prices. Therefore, reducing printer production costs has become a key research focus for all manufacturers.
[0003] Before executing a printing task, the printer needs to check its status, such as whether the paper tray lid is closed and whether the paper tray contains paper. This is usually done by integrating a dedicated lid detection module and a paper detection module into the printer. However, this method of determining the printer's status through dedicated lid detection and paper detection modules has the problem of high production costs. Summary of the Invention
[0004] This invention provides a printer status detection method, apparatus, and printer, which can improve existing solutions for detecting printer status.
[0005] In a first aspect, embodiments of the present invention provide a printer status detection method, wherein the printer includes a light emitter circuit and a light receiver circuit, the light emitter circuit including a light-emitting state and a non-light-emitting state; the light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver, the resistance value of the resistor module including a first resistance value and a second resistance value, and the voltage value across the resistor module being the output voltage value of the light receiver circuit, the method comprising:
[0006] The resistance of the resistor module is controlled to the first resistance value, and the light emitter is controlled to be in the non-light-emitting state. The first output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the on state based on the first output voltage value.
[0007] When it is determined that the printer is not in the open state, the light emitter is controlled to switch from the non-light-emitting state to the light-emitting state, the second output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the open state based on the second output voltage value;
[0008] When it is determined that the printer is not in the open state, the resistance of the resistor module is controlled to the second resistance value, the third output voltage value of the light receiver circuit is obtained, and the paper status in the printer is determined according to the third output voltage value.
[0009] Optionally, determining whether the printer is in an on state based on the first output voltage value includes:
[0010] When the first output voltage value is higher than a preset value, it is determined that the printer is in the open state;
[0011] When the first output voltage value is not higher than a preset value, it is determined that the printer is not in the open state.
[0012] Optionally, determining whether the printer is in the on state based on the second output voltage value includes:
[0013] When the second output voltage value is not higher than the preset value, the printer is determined to be in the open state;
[0014] When the second output voltage value is higher than the preset value, it is determined that the printer is not in the on state.
[0015] Optionally, the paper status includes a paper-on-demand status and a paper-out-of-demand status;
[0016] Determining the paper state in the printer based on the third output voltage value includes:
[0017] When the third output voltage value is higher than the preset value, the paper state is determined to be the paper-containing state;
[0018] When the third output voltage value is not higher than the preset value, the paper status is determined to be the paper shortage status.
[0019] Optionally, after determining that the paper state is the paper-containing state, the method further includes:
[0020] Determine whether the current timeframe contains a motor stepping task;
[0021] If the motor stepping task is included, then after the motor stepping task is executed, the operation of controlling the resistance of the resistor module to the first resistance value and controlling the light emitter to the non-light-emitting state is repeated.
[0022] If the motor stepping task is not included, then after a first preset time interval, the operation of controlling the resistance of the resistor module to the first resistance value and controlling the light emitter to the non-light-emitting state is repeated.
[0023] Optionally, after determining that the printer is in the on state, the method further includes:
[0024] After a first preset time interval, the operation of controlling the resistor module to be in the first resistance value state and controlling the light emitter to be in the non-light-emitting state is repeated.
[0025] Optionally, the optical transmitter circuit further includes a first switching element for controlling whether the optical transmitter is energized;
[0026] The resistor module includes a first resistor, a second resistor, and a second switching element; the second resistor and the second switching element are connected in series and then in parallel with the second resistor.
[0027] Optionally, controlling the resistance of the resistor module to the first resistance value and controlling the light emitter to the non-emitting state includes:
[0028] The second switching element is controlled to be in the open state, so that the resistance of the resistor module is the first resistance value, and the first resistance value is the resistance value of the first resistor;
[0029] The first switching element is controlled to be in the open state, and the light emitter is in the non-emitting state;
[0030] Accordingly, controlling the light emitter to switch from the non-emitting state to the emitting state includes:
[0031] The first switching element is controlled to be in the closed state, so that the light emitter switches from the non-emitting state to the emitting state;
[0032] Accordingly, controlling the resistance value of the resistor module to be the second resistance value includes:
[0033] The second switching element is controlled to be in a closed state, so that the resistance of the resistor module is the second resistance value, which is the parallel resistance value of the first resistor and the second resistor.
[0034] Secondly, embodiments of the present invention provide a printer status detection device, including a light emitter circuit, a light receiver circuit, and a control module. The light emitter circuit includes a light emitter, which has a light-emitting state and a non-light-emitting state. The light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver. The resistance value of the resistor module includes a first resistance value and a second resistance value. The voltage across the resistor module is the output voltage value of the light receiver circuit. The control module is configured to:
[0035] The resistor module is used to control the resistance value of the resistor module to the first resistance value, and to control the light emitter to the non-light-emitting state. The first output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the on state based on the first output voltage value.
[0036] When it is determined that the printer is not in the open state, the light emitter is controlled to switch from the non-emitting state to the emitting state, the second output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the open state based on the second output voltage value;
[0037] It is also used to control the resistance of the resistor module to the second resistance value when it is determined that the printer is not in the open state, obtain the third output voltage value of the light receiver circuit, and determine the paper state in the printer based on the third output voltage value.
[0038] Thirdly, embodiments of the present invention also provide a printer, the printer including a printer status detection method capable of performing any embodiment of the present invention.
[0039] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute and implement the printer status detection method according to any embodiment of the present invention.
[0040] The printer status detection scheme provided in this invention includes a light emitter circuit and a light receiver circuit. The light emitter circuit includes a light emitter with an emitting state and a non-emitting state. The light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver. The resistor module has a first resistance value and a second resistance value, and the voltage across the resistor module is the output voltage value of the light receiver circuit. This scheme controls the light receiver circuit to connect to the first or second resistance value through corresponding control logic, and controls the light emitter to be in an emitting or non-emitting state, thereby acquiring the output voltage value of the light receiver circuit to detect the printer cartridge cover status and paper status based on the output voltage value. This embodiment can complete the detection of the printer cartridge cover status and paper status with a single detection module, which is beneficial in saving printer production costs compared to the existing method that requires separate dedicated cartridge cover detection modules and paper detection modules.
[0041] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the embodiments of the present invention will become readily apparent from the following description. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic diagram of a circuit structure of an optical transmitter circuit provided in an embodiment of the present invention;
[0044] Figure 2 This is a schematic diagram of a circuit structure of an optical receiver circuit provided in an embodiment of the present invention;
[0045] Figure 3 This is a flowchart illustrating a printer status detection method provided in an embodiment of the present invention;
[0046] Figure 4 This is another schematic flowchart of the printer status detection method provided in this embodiment of the invention;
[0047] Figure 5 This is a schematic diagram of the printer status detection device provided in an embodiment of the present invention;
[0048] Figure 6 This is a schematic diagram of a printer provided in an embodiment of the present invention. Detailed Implementation
[0049] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0050] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0051] Figure 1 This is a schematic diagram of a circuit structure of an optical transmitter circuit provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a circuit structure of an optical receiver circuit provided in an embodiment of the present invention; Figure 3This is a schematic flowchart of a printer status detection method provided in an embodiment of the present invention. This embodiment is applicable to situations where the status of a printer is detected. The method can be executed by a printer status detection device, which can be implemented in hardware and / or software and can be configured in a printer such as a server.
[0052] The printer provided in this embodiment includes a light emitter circuit and a light receiver circuit. The light emitter circuit includes a light emitter, which has a light-emitting state and a non-light-emitting state. The light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver. The resistance value of the resistor module includes a first resistance value and a second resistance value. The voltage value across the resistor module is the output voltage value of the light receiver circuit.
[0053] The optical transmitter circuit controls the optical transmitter to be in an emitting or non-emitting state based on a control signal. The optical receiver circuit determines the resistance value of the currently connected circuit (either a first or a second resistance value) based on the input control signal, and further combines this with the current state of the optical transmitter to generate a corresponding output voltage from the optical receiver.
[0054] When checking the printer status, the status of the printer paper tray lid can be checked, such as whether the lid is currently open. If it is open, the printer cannot work properly. If it is not open, the paper status in the paper tray needs to be checked further, such as whether the paper is out of paper, to prevent the printer from printing blanks due to a lack of paper.
[0055] This embodiment provides a solution that eliminates the need for separate dedicated lid detection and paper detection modules when detecting the printer's lid and paper status. Instead, a single module can be used to detect both the lid and paper status, resulting in cost savings for printer production.
[0056] Specifically, please refer to Figure 1 The light emitter circuit provided in this embodiment also includes a first switching element for controlling whether the light emitter is energized. The first switching element can be implemented by a common transistor, that is, when the light emitter needs to emit light, the transistor is controlled to be in a conducting (or closed) state, thereby causing the light emitter to emit light; when the light emitter does not need to emit light, the transistor is controlled to be in a disconnected (or open) state, thereby causing the light emitter not to emit light.
[0057] Furthermore, in the specific application of the optical transmitter circuit, in order to prevent the first switching element and the optical transmitter from being burned out due to excessive current in the circuit, the first switching element can be a transistor with a resistor. If it is a non-resistor transistor, a resistor can be connected in series with the base of the transistor to protect the first switching element. Optionally, a current-limiting resistor can be connected in parallel in the optical transmitter to protect the optical transmitter.
[0058] Further, referring to Figure 2, in the optical receiver circuit provided in this embodiment, the resistor module includes a first resistor, a second resistor, and a second switching element. The second switching element is used to control whether the second resistor is connected to the circuit. Specifically, when the second switching element is in the on (or closed) state, the first resistor and the second resistor are simultaneously connected to the optical receiver circuit, and the total resistance value of the resistor module is equal to the resistance value of the first resistor and the second resistor connected in parallel. When the second switching element is controlled to be in the off (or open) state, only the first resistor is connected to the optical receiver circuit, and the total resistance value of the resistor module is equal to the resistance value of the first resistor. In specific implementation, the second switching element can be implemented by a common transistor, and the optical receiver can be implemented by a phototransistor. In other embodiments, the optical receiver can also be an electronic switching component such as a MOSFET or a relay; the optical receiver can also be a photosensitive component such as a photodiode or a photoresistor. Similarly, to protect the second switching element, the second switching element can be a transistor with a resistor. If it is a non-resistor transistor, a resistor can be connected in series with the base of the transistor.
[0059] It should be noted that in the solution provided in this embodiment, the resistance values of the first resistor and the second resistor in the resistor module differ significantly. For example, the value range of the first resistor can be (200kΩ, 1MΩ), and the value range of the second resistor can be (1kΩ, 10kΩ), etc. The specific values of the first resistor and the second resistor are not limited here.
[0060] During the operation of the printer, the output voltage value (Uout) of the light receiver circuit is obtained by controlling the connection of the first resistor or the first and second resistors, and controlling the light emitter to be in a light-emitting state or a non-light-emitting state. The printer's cartridge cover status and paper status are detected based on the value of Uout.
[0061] Specifically, refer to Figure 3 The printer status detection method provided in this embodiment may include the following steps:
[0062] S110. The resistance value of the control resistor module is the first resistance value, and the light emitter is controlled to be in a non-emitting state. The first output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the on state based on the first output voltage value.
[0063] The solution provided in this embodiment allows the resistor module to be controlled to have a first resistance value by controlling the second switching element to be in the open state, so that the resistor module has a first resistance value. In this case, since the branch where the second resistor is located is an open circuit, the resistance of the resistor module is equal to the resistance value of the first resistor, that is, the first resistance value is the resistance value of the first resistor. Correspondingly, the light emitter can be controlled to be in a non-light-emitting state by controlling the first switching element to be in the open state, so that the light emitter is in a non-light-emitting state.
[0064] During this process, when the resistance of the control resistor module is set to the first resistance value and the light emitter is controlled to be in a non-light-emitting state, if the first and second switching elements are NPN transistors, that is, when low-level signals are input to the light emitter circuit and the light receiver circuit respectively, the light-emitting tube will not emit light. At this time, the first output voltage value (Uout) in the light receiver circuit is related to the first resistor.
[0065] The solution provided in this embodiment can determine whether the printer is in the on state based on the first output voltage value as follows: determine whether the first output voltage value is higher than a preset value; if so, determine that the printer is in the on state; if not, determine that the printer is not in the on state.
[0066] The reason why the printer is determined to be in the on state when the first output voltage value is higher than the preset value is that since the light emitter is not emitting light, the first output voltage value is still higher than the preset value, indicating that the light receiver has received light, resulting in a larger voltage value in the circuit. When the light received by the light receiver is not generated by the light emitter, it can be indicated that the current light is external light received when the printer is in the on state. Therefore, the printer is determined to be in the on state when the first output voltage value is higher than the preset value.
[0067] In the solution provided in this embodiment, since the resistance of the resistor module is the same as that of the first resistor, which is relatively large, even if the ambient light intensity is weak and the current flowing through the light receiver circuit is limited, there is still a large voltage difference across the resistor module. This means that even when the light intensity is weak, the first output voltage value can still be higher than the preset value. Therefore, the light receiver circuit provided in this embodiment can avoid misjudgment due to weak ambient light intensity when the cover is open.
[0068] S120. When it is determined that the printer is not in the open state, the light emitter is controlled to switch from the non-emitting state to the emitting state, the second output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the open state based on the second output voltage value.
[0069] Based on step S110, when the printer is not in the on state, the light emitter is further controlled to switch from a non-emitting state to an emitting state. That is, in this step, the first switching element is controlled to be in the closed state, so that the light emitter switches from the non-emitting state to the emitting state. In the light receiver circuit, the second switching element remains in the open state. Taking NPN transistors as an example, a high-level signal is input to the base of the first switching element, and a low-level signal is input to the base of the second switching element. At this time, the second output voltage value (Uout) in the light receiver circuit is related to the first resistor.
[0070] The solution provided in this embodiment can determine whether the printer is in the open state in step S120 based on the second output voltage value as follows: determine whether the second output voltage value is higher than a preset value; if so, determine that the printer is in the open state; if not, determine that the printer is not in the open state.
[0071] The reason why the printer is considered to be on when the second output voltage value is higher than the preset value is that when the light emitter is in the emitting state, if the printer cover is closed, theoretically the light receiver will receive the light emitted by the light emitter, causing the second output voltage value to increase. If the second output voltage value is not higher than the preset value, it indicates that the light emitted by the light emitter is not being emitted to the light receiver because the cover is open. Therefore, when the second output voltage value is higher than the preset value, it can be determined that the printer is on.
[0072] S130. When it is determined that the printer is not in the open state, the resistance value of the control resistor module is the second resistance value, the third output voltage value of the light receiver circuit is obtained, and the paper status in the printer is determined according to the third output voltage value.
[0073] Based on step S120, if the printer is not in the open state, it indicates that the printer tray cover is in the closed state. In the closed state, a printing operation is required. Before the printing operation, the paper status in the paper tray can be detected. The current paper status can include paper present and paper out (no paper). The purpose of detecting the paper status is to prevent the printer from printing blanks because there is no paper in the paper tray.
[0074] In this embodiment, the paper state can be detected by controlling the resistance of the resistor module to a second resistance value based on step S120. That is, at this time, the light emitter in the light emitter circuit is in the light-emitting state, and the access resistance of the light receiver circuit is the first resistance and the second resistance.
[0075] Specifically, in the solution provided in this embodiment, the resistance of the resistor module is controlled to a second resistance value by controlling the second switching element to be in a closed state, so that the resistance of the resistor module is the second resistance value. The current second resistance value is the parallel resistance of the first and second resistors. At this time, the third output voltage value (Uout) in the optical receiver circuit is related to the first and second resistors.
[0076] The solution provided in this embodiment determines the paper status in the printer based on the third output voltage value as follows: determine whether the third output voltage value is higher than a preset value; if so, determine that the paper status is in a paper-containing state; if not, determine that the paper status is out of paper.
[0077] The reason why the printer is out of paper is that if there is paper in the paper tray, the light receiver will not receive the light emitted by the light emitter due to the paper blocking it. Therefore, the third output voltage will not be higher than the preset value. If it is higher than the preset value, it means that there is no paper blocking the light receiver, so the light receiver can receive the light emitted by the light emitter. Therefore, it can be determined that the printer is out of paper when the third output voltage is higher than the preset value; otherwise, it is in paper condition.
[0078] In the solution provided in this embodiment, when it is determined that the printer is out of paper, the first resistor and the second resistor in the light receiver circuit are connected in parallel. At this time, the resistance value of the resistor module is the resistance value of the first resistor and the second resistor connected in parallel. Since the resistance value of the second resistor is much smaller than the resistance value of the first resistor, the parallel resistance is close to the resistance value of the second resistor. That is, the second resistance value is smaller than the first resistance value. If a third output voltage higher than the preset value is required, a higher light intensity is required. This control method can avoid misjudgment caused by the light emitted by the light generator passing through the printing paper (the printing paper cannot completely block the light, and the light receiver will be subjected to weak light at this time).
[0079] It should be noted that the first, second, and third output voltage values mentioned above are voltage values at the same location. The preset values are values obtained through experiments under the condition that the resistance, input voltage, and current of each electronic component in the transmitter and receiver circuits are constant. The specific preset values are not limited here.
[0080] Among them, based on Figure 1 and Figure 2When the provided light transmitter circuit and light receiver circuit perform their respective functions, the light transmitter circuit and light receiver circuit should be set opposite to each other in the printer so that when a high-level signal is input to the light transmitter circuit, the receiving tube in the light receiver circuit can receive the light generated by the light-emitting tube in the light transmitter circuit. Alternatively, the light transmitter circuit and light-emitting tube circuit provided in this embodiment can also be set on the same side in the printer, and a reflector can be added to enable the receiving tube in the light-emitting tube circuit to receive the light generated by the light-emitting tube in the light transmitter circuit, etc. The specific setting method of the light transmitter circuit and light receiver circuit in the printer is not limited here.
[0081] The printer status detection scheme provided in this invention includes a light emitter circuit and a light receiver circuit. The light emitter circuit includes a light emitter with an emitting state and a non-emitting state. The light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver. The resistor module has a first resistance value and a second resistance value, and the voltage across the resistor module is the output voltage value of the light receiver circuit. This scheme controls the light receiver circuit to connect to the first or second resistance value through corresponding control logic, and controls the light emitter to be in an emitting or non-emitting state, thereby acquiring the output voltage value of the light receiver circuit to detect the printer cartridge cover status and paper status based on the output voltage value. This embodiment can complete the detection of the printer cartridge cover status and paper status with a single detection module, which is beneficial in saving printer production costs compared to the existing method that requires separate dedicated cartridge cover detection modules and paper detection modules.
[0082] Figure 4 This is another schematic flowchart of the printer status detection method provided in this embodiment of the invention. The relationship between this embodiment and the above embodiments further refines the corresponding features of the above embodiments.
[0083] like Figure 4 As shown, the method may include the following steps:
[0084] S210, Control the second switching element to be in the open state so that the resistance of the resistor module is the first resistance value.
[0085] S211. Control the first switching element to be in the open state so that the light emitter is in a non-emitting state.
[0086] S212, Obtain the first output voltage value of the optical receiver circuit.
[0087] S213. Determine whether the first output voltage value is higher than the preset value.
[0088] If yes, proceed to step S214; otherwise, proceed to step S220.
[0089] S214. Ensure the printer is turned on.
[0090] After the state is opened, proceed to step S250.
[0091] S220: Control the first switching element to be in the closed state so that the light emitter switches from the non-emitting state to the emitting state.
[0092] S221. Obtain the second output voltage value of the optical receiver circuit.
[0093] S222. Determine whether the second output voltage value is higher than the preset value.
[0094] If yes, proceed to step S230; otherwise, proceed to step S214.
[0095] S230: Control the second switching element to be in the closed state so that the resistance of the resistor module is the second resistance value.
[0096] The second resistance value is the parallel resistance value of the first and second resistors.
[0097] S231. Obtain the third output voltage value of the optical receiver circuit.
[0098] S232. Determine whether the third output voltage value is higher than the preset value.
[0099] If yes, proceed to step S233; otherwise, proceed to step S234.
[0100] S233. Determine the paper status as out of paper.
[0101] S234. Determine that the paper status is "paper present".
[0102] S240, Determine whether the current time includes a motor stepping task.
[0103] The motor stepper is used to move the paper for printing.
[0104] If yes, proceed to step S241; otherwise, proceed to step S250.
[0105] S241, Perform motor stepping task.
[0106] S250, first preset interval duration.
[0107] After a first preset time interval, the above step S210 is repeated to input a low-level signal to the light transmitter circuit and the light receiver circuit, thereby entering the logic of re-determining the state of the lid.
[0108] The first preset duration can be 1 second, 3 seconds, or 5 seconds, etc. The specific selection of the first preset duration is not limited here. Preferably, the first preset duration is 1 second to prevent the user from not performing timely detection after the device changes from the open state to the closed state.
[0109] The printer status detection scheme provided in this embodiment controls the light receiver circuit to connect to a first resistance value or a second resistance value through corresponding control logic, and controls the light emitter to be in an emitting or non-emitting state, thereby acquiring the output voltage value of the light receiver circuit to detect the printer cartridge cover status and paper status based on the output voltage value. This embodiment can complete the detection of the printer cartridge cover status and paper status with a single detection module, which achieves the beneficial effect of saving printer production costs compared to the existing method that requires separate dedicated cartridge cover detection modules and paper detection modules.
[0110] Figure 5 This is a schematic diagram of a printer status detection device provided in an embodiment of the present invention. This device is suitable for executing the printer status detection method provided in an embodiment of the present invention. Figure 5 As shown, the device includes a light emitter circuit 310, a light receiver circuit 320, and a control module 330. The light emitter circuit 310 includes a light emitter with a light-emitting state and a non-light-emitting state. The light receiver circuit 320 includes a light receiver and a resistor module connected in series with the light receiver. The resistance value of the resistor module includes a first resistance value and a second resistance value. The voltage across the resistor module is the output voltage value of the light receiver circuit. The control module 330 is configured to:
[0111] The resistor module is used to control the resistance value of the resistor module to the first resistance value, and to control the light emitter to the non-light-emitting state. The first output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the on state based on the first output voltage value.
[0112] When it is determined that the printer is not in the open state, the light emitter is controlled to switch from the non-emitting state to the emitting state, the second output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the open state based on the second output voltage value;
[0113] It is also used to control the resistance of the resistor module to the second resistance value when it is determined that the printer is not in the open state, obtain the third output voltage value of the light receiver circuit, and determine the paper state in the printer based on the third output voltage value.
[0114] The printer status detection device provided in this embodiment of the invention includes a light emitter circuit and a light receiver circuit. The light emitter circuit includes a light emitter with an emitting state and a non-emitting state. The light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver. The resistance value of the resistor module includes a first resistance value and a second resistance value. The voltage across the resistor module is the output voltage value of the light receiver circuit. This solution controls the light receiver circuit to connect to the first or second resistance value through corresponding control logic, and controls the light emitter to be in an emitting or non-emitting state, thereby acquiring the output voltage value of the light receiver circuit to detect the printer cartridge cover status and paper status based on the output voltage value. This embodiment can complete the detection of the printer cartridge cover status and paper status with a single detection module, which is beneficial in saving printer production costs compared to the existing method that requires separate dedicated cartridge cover detection modules and paper detection modules.
[0115] In one embodiment, the device further includes a state determination module, wherein:
[0116] The state determination module is used to determine that the printer is in the open state when the first output voltage value is higher than a preset value; and to determine that the printer is not in the open state when the first output voltage value is not higher than the preset value.
[0117] In one embodiment, the state determination module is further configured to determine that the printer is in the open state when the second output voltage value is not higher than a preset value; and to determine that the printer is not in the open state when the second output voltage value is higher than the preset value.
[0118] In one embodiment, the paper state includes a paper-containing state and a paper-out state;
[0119] The state determination module is further configured to determine the paper state as the paper-containing state when the third output voltage value is higher than the preset value;
[0120] When the third output voltage value is not higher than the preset value, the paper status is determined to be the paper shortage status.
[0121] In one embodiment, the apparatus further includes a repetitive execution module, wherein:
[0122] The repeat execution module is configured to, if the current time includes the motor stepping task, repeatedly execute the operation of controlling the resistance of the resistor module to the first resistance value and controlling the light emitter to the non-light-emitting state after executing the motor stepping task; if the current time does not include the motor stepping task, repeatedly execute the operation of controlling the resistance of the resistor module to the first resistance value and controlling the light emitter to the non-light-emitting state after an interval of a first preset time.
[0123] In one embodiment, after determining that the printer is in the open state, the repeat execution module is further configured to repeatedly execute the operation of controlling the resistor module to be in the first resistance value state and controlling the light emitter to be in the non-emitting state after an interval of a first preset time.
[0124] In one embodiment, the optical transmitter circuit 310 further includes a first switching element for controlling whether the optical transmitter is energized; the resistor module includes a first resistor, a second resistor, and a second switching element; the second resistor is connected in series with the second switching element and then in parallel with the second resistor.
[0125] In one embodiment, the control module 330 is specifically configured to control the second switching element to be in an open state, such that the resistance of the resistor module is the first resistance value, and the first resistance value is the resistance value of the first resistor; control the first switching element to be in an open state, such that the light emitter is in the non-emitting state; further configured to control the first switching element to be in a closed state, such that the light emitter switches from the non-emitting state to the emitting state; and further configured to control the second switching element to be in a closed state, such that the resistance of the resistor module is the second resistance value, and the second resistance value is the parallel resistance value of the first resistor and the second resistor.
[0126] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is merely an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0127] This invention also provides a printer, the printer comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the printer status detection method according to any embodiment of this invention.
[0128] This invention also provides a computer-readable medium storing computer instructions that, when executed by a processor, implement the printer status detection method according to any embodiment of this invention.
[0129] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing an embodiment of the present invention. Figure 6 The printer shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0130] like Figure 6 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0131] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0132] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.
[0133] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0135] The modules and / or units described in the embodiments of the present invention can be implemented in software or hardware. The described modules and / or units can also be housed in a processor; for example, a processor may include a control module. The names of these modules do not necessarily limit the module itself.
[0136] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: a light emitter circuit and a light receiver circuit, wherein the light emitter circuit includes a light emitter having a light-emitting state and a non-light-emitting state; the light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver, the resistance value of the resistor module including a first resistance value and a second resistance value, and the voltage across the resistor module being the output voltage value of the light receiver circuit. Furthermore, the device can control the resistance of the resistor module to the first resistance value and control the light emitter to the non-emitting state, obtain the first output voltage value of the light receiver circuit, and determine whether the printer is in the on state based on the first output voltage value; when it is determined that the printer is not in the on state, it controls the light emitter to switch from the non-emitting state to the emitting state, obtains the second output voltage value of the light receiver circuit, and determines whether the printer is in the on state based on the second output voltage value; when it is determined that the printer is not in the on state, it controls the resistance of the resistor module to the second resistance value, obtains the third output voltage value of the light receiver circuit, and determines the paper state inside the printer based on the third output voltage value.
[0137] According to the technical solution of this embodiment of the invention, the optical receiver circuit is controlled to connect to a first resistance value or a second resistance value through corresponding control logic, and the output voltage value of the optical receiver circuit is obtained when the optical emitter is in a light-emitting state or a non-light-emitting state, so as to detect the printer cartridge cover status and paper status based on the output voltage value. This embodiment can complete the detection of the printer cartridge cover status and the paper status through a single detection module, which achieves the beneficial effect of saving printer production costs compared to the existing method that requires separate dedicated cartridge cover detection modules and paper detection modules.
[0138] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for detecting the status of a printer, characterized in that, The printer includes a light emitter circuit and a light receiver circuit. The light emitter circuit includes a light emitter with an emitting state and a non-emitting state. The light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver. The resistor module has a first resistance value and a second resistance value. The voltage across the resistor module is the output voltage value of the light receiver circuit. The method includes: The resistance of the resistor module is controlled to the first resistance value, and the light emitter is controlled to be in the non-light-emitting state. The first output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the on state based on the first output voltage value. When it is determined that the printer is not in the open state, the light emitter is controlled to switch from the non-light-emitting state to the light-emitting state, the second output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the open state based on the second output voltage value; When it is determined that the printer is not in the open state, the resistance of the resistor module is controlled to the second resistance value, the third output voltage value of the light receiver circuit is obtained, and the paper status in the printer is determined according to the third output voltage value.
2. The printer status detection method according to claim 1, characterized in that, The step of determining whether the printer is in the on state based on the first output voltage value includes: When the first output voltage value is higher than a preset value, it is determined that the printer is in the open state; When the first output voltage value is not higher than a preset value, it is determined that the printer is not in the open state.
3. The printer status detection method according to claim 1, characterized in that, The step of determining whether the printer is in the on state based on the second output voltage value includes: When the second output voltage value is not higher than the preset value, the printer is determined to be in the open state; When the second output voltage value is higher than the preset value, it is determined that the printer is not in the on state.
4. The printer status detection method according to claim 1, characterized in that, The paper status includes a paper-containing status and a paper-out status; Determining the paper state in the printer based on the third output voltage value includes: When the third output voltage value is higher than the preset value, the paper state is determined to be the paper-containing state; When the third output voltage value is not higher than the preset value, the paper status is determined to be the paper shortage status.
5. The printer status detection method according to claim 4, characterized in that, After determining that the paper state is the paper-containing state, the method further includes: Determine whether the current timeframe contains a motor stepping task; If the motor stepping task is included, then after the motor stepping task is executed, the operation of controlling the resistance of the resistor module to the first resistance value and controlling the light emitter to the non-light-emitting state is repeated. If the motor stepping task is not included, then after a first preset time interval, the operation of controlling the resistance of the resistor module to the first resistance value and controlling the light emitter to the non-light-emitting state is repeated.
6. The printer status detection method according to claim 2 or 3, characterized in that, After determining that the printer is in the on state, the process further includes: After a first preset time interval, the operation of controlling the resistor module to be in the first resistance value state and controlling the light emitter to be in the non-light-emitting state is repeated.
7. The printer status detection method according to claim 1, characterized in that, The optical transmitter circuit also includes a first switching element for controlling whether the optical transmitter is powered on; The resistor module includes a first resistor, a second resistor, and a second switching element; the second resistor and the second switching element are connected in series and then in parallel with the second resistor.
8. The printer status detection method according to claim 7, characterized in that, The control of the resistor module to have a resistance of the first resistance value, and the control of the light emitter to be in the non-emitting state, includes: The second switching element is controlled to be in the open state, so that the resistance of the resistor module is the first resistance value, and the first resistance value is the resistance value of the first resistor; The first switching element is controlled to be in the open state so that the light emitter is in the non-emitting state; Accordingly, controlling the light emitter to switch from the non-emitting state to the emitting state includes: The first switching element is controlled to be in the closed state, so that the light emitter switches from the non-emitting state to the emitting state; Accordingly, controlling the resistance value of the resistor module to be the second resistance value includes: The second switching element is controlled to be in a closed state, so that the resistance of the resistor module is the second resistance value, which is the parallel resistance value of the first resistor and the second resistor.
9. A printer status detection device, characterized in that, The system includes a light emitter circuit, a light receiver circuit, and a control module. The light emitter circuit includes a light emitter with an emitting state and a non-emitting state. The light receiver circuit includes a light receiver and a resistor module connected in series with the light receiver. The resistor module has a first resistance value and a second resistance value, and the voltage across the resistor module is the output voltage value of the light receiver circuit. The control module is configured to: The resistor module is used to control the resistance value of the resistor module to the first resistance value, and to control the light emitter to the non-light-emitting state. The first output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the on state based on the first output voltage value. When it is determined that the printer is not in the open state, the light emitter is controlled to switch from the non-emitting state to the emitting state, the second output voltage value of the light receiver circuit is obtained, and the printer is determined to be in the open state based on the second output voltage value. It is also used to control the resistance of the resistor module to the second resistance value when it is determined that the printer is not in the open state, obtain the third output voltage value of the light receiver circuit, and determine the paper state in the printer based on the third output voltage value.
10. A printer, characterized in that, The printer includes the printer status detection method as described in any one of claims 1-8.
Citation Information
Patent Citations
Electronic apparatus and method of controlling electronic apparatus
CN103258391A
Printer and mark detection method
CN104339892A