Detection device, device, image forming device, detection program, detection method, preparation device, preparation program, and preparation method

JP2025036059APending Publication Date: 2025-03-14CANON KK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024069663
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-30
Filing Date
2024-04-23
Publication Date
2025-03-14

AI Technical Summary

Benefits of technology

【0007】 本開示によれば、保持部材に載置されている記録媒体の端部位置の誤検出を低減させることができる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025036059000001_ABST
    Figure 2025036059000001_ABST
Patent Text Reader

Abstract

To reduce erroneous detection of an end part position of a recording medium placed on a holding member.SOLUTION: A detection device includes: detection means which detects a change of a detection level corresponding to the strength of light detected by an optical sensor for scanning a recording medium or a holding member in a scanning direction, that is the change into a level corresponding to the holding member from a level corresponding to the recording medium, by comparing the detection level with a first threshold value level; means which determines a position of the optical sensor as a candidate of an end part position at a time when the detection means has detected the change is used as a reference, in the case where, when a delay time has elapsed in the scanning into the scanning direction from the time when the detection means has detected the change, the detection level is between a second threshold value level and the level corresponding to the holding member; and second determination means which determines the candidate as the end part position, in the case where the detection level is between a third threshold value level and the level corresponding to the holding member in a position farthest away from a threshold value distance from a position of the candidate in the scan direction.SELECTED DRAWING: Figure 8
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a detection device for detecting an edge position of a recording medium, an apparatus and an image forming apparatus including the same, a detection program, and a detection method, and further relates to a preparation device, a preparation program, and a preparation method. [Background technology]

[0002] Image forming devices that print characters, figures, images, etc. on recording media such as paper are widely used. In order to prevent the image forming device from printing on areas other than the recording media, it is necessary to detect the area where the recording media is present. Conventionally, a method for detecting the area where the recording media is present is known in which an optical sensor is mounted on a carriage and the area is detected by preliminary scanning of the carriage or preliminary transport of the recording media. Patent Document 1 discloses an image forming device that detects the start and end positions in a predetermined scanning direction of a recording medium placed on a platen by comparing the level of a signal indicating the intensity of reflected light detected by a paper width sensor that scans in a predetermined scanning direction with a threshold level. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Japanese Patent Application Publication No. 7-179248 Summary of the Invention [Problem to be solved by the invention]

[0004] Here, in the image forming apparatus disclosed in Patent Document 1, the position where the level of the detection signal indicating the intensity of the reflected light changes from a level below the threshold level to a level above the threshold level is detected as the position of the start end of the recording medium placed on the platen. Also, the position where the level of the detection signal indicating the intensity of the reflected light changes from a level above the threshold level to a level below the threshold level is detected as the position of the end end of the recording medium placed on the platen. Therefore, for example, if a frame line is arranged on the recording medium or if dust is attached to the recording medium, there is a risk of erroneous detection of the end position (i.e., the start end position or the end end position). Also, if noise is superimposed on the detection signal, a similar erroneous detection may occur.

[0005] The present disclosure has been made in consideration of the above-mentioned problems, and has an object to reduce erroneous detection of the edge position of a recording medium placed on a holding member. [Means for solving the problem]

[0006] One aspect of the present disclosure is a detection device that detects an end position of a recording medium placed on a portion of a holding member, the detection device comprising: a detection means that detects a change in a detection level corresponding to an intensity of light detected by an optical sensor that scans the recording medium or the holding member in a scanning direction, the change being from a level corresponding to the recording medium to a level corresponding to the holding member, by comparing the detection level with a first threshold level; The detection device comprises: a first determination means for determining, as a candidate for the end position, the position of the optical sensor at the time when the detection means detected the change as a reference, if the detection level is between a second threshold level and the level corresponding to the holding member when a delay time has elapsed in scanning in the scanning direction from when the detection means detected the change; and a second determination means for determining, as the end position, the candidate, if the detection level is between a third threshold level and the level corresponding to the holding member at a position away from the candidate position in the scanning direction by more than a threshold distance. Effect of the Invention

[0007] According to the present disclosure, it is possible to reduce erroneous detection of the edge position of a recording medium placed on a holding member. [Brief description of the drawings]

[0008] [Figure 1] FIG. 1 is an external perspective view of an image forming apparatus according to an embodiment; [Diagram 2] FIG. 1 is a schematic perspective view of the inside of an image forming apparatus according to an embodiment; [Diagram 3] FIG. 1 is a functional block diagram of an image forming system including an image forming apparatus and a host apparatus according to an embodiment; [Figure 4] FIG. 1 is a conceptual side view showing a manner in which reflected light is measured by an edge detection sensor according to an embodiment; [Diagram 5] FIG. 2 is a schematic plan view for explaining a manner in which an edge detection sensor provided in the image forming apparatus according to the embodiment scans a platen on which a recording medium is placed. [Figure 6] FIG. 1 is a waveform diagram for explaining the principle of end position detection according to an embodiment. [Figure 7] 11 is a diagram showing the relationship between the level of a detection signal on which noise is superimposed and a threshold level. FIG. [Figure 8] FIG. 1 is a functional block diagram showing a configuration of an end position detection unit provided in an image forming apparatus according to a first embodiment; [Figure 9] 1 is a flowchart for explaining a method for detecting an end position according to a first embodiment; [Figure 10] FIG. 1A is a diagram for explaining each end of a sheet-shaped recording medium detected by an end position detection unit provided in an image forming apparatus according to an embodiment of the present disclosure; FIG. 1B is a diagram for explaining an end and a cut position of a roll-shaped recording medium detected by an end position detection unit provided in an image forming apparatus according to an embodiment of the present disclosure. [Figure 11] FIG. 11 is a functional block diagram showing the configuration of an end position detection unit provided in an image forming apparatus according to a third embodiment; [Figure 12] 11 is a flowchart for explaining a preparation method performed by a preparation unit according to a third embodiment. [Figure 13] FIG. 13 is a diagram for explaining a first scan and a second scan in the third embodiment; [Figure 14] FIG. 1 is a conceptual diagram for explaining a scanning position correction amount; [Figure 15] 11 is a flowchart showing details of threshold level setting according to the third embodiment. [Figure 16] FIG. 13 is a conceptual diagram for explaining a first scanning position correction amount; [Figure 17] FIG. 13 is a conceptual diagram for explaining a second scanning position correction amount; [Figure 18] A flowchart for explaining a method for determining a scanning position correction amount [Figure 19] A flowchart illustrating a method for detecting edge positions during printing. [Figure 20] 13 is a flowchart showing details of threshold level setting according to the fourth embodiment. [Figure 21] FIG. 13 is a conceptual diagram for explaining threshold level setting according to the fourth embodiment; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] Hereinafter, the embodiments will be described in detail with reference to the attached drawings. Note that the following embodiments do not limit the disclosure according to the claims. Although the embodiments describe a plurality of features, not all of these features are essential to the disclosure, and the plurality of features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are given to the same or similar configurations, and duplicated descriptions may be omitted.

[0010] First Embodiment FIG. 1 is a perspective view of the appearance of an image forming apparatus according to the first embodiment.

[0011] As shown in FIG. 1, a top cover 101 of an image forming apparatus 100 is provided with a confirmation window 102 so that a user can grasp the internal state of the image forming apparatus 100.

[0012] Furthermore, the image forming apparatus 100 includes an operation display unit 103 as a user interface. A user can configure settings of the image forming apparatus 100 through the operation display unit 103.

[0013] Fig. 2 is a diagram showing the internal state exposed by removing top cover 101 of image forming apparatus 100 shown in Fig. 1. Image forming apparatus 100 includes transport rollers 208 for transporting recording medium (also called "recording medium") 200 in the direction of arrow B (sub-scanning direction), and a carriage unit 201 guided so as to be reciprocable in the width direction of recording medium 200 (direction of arrow A, main scanning direction). Usually, the main scanning direction is perpendicular to the sub-scanning direction, but this is not limited thereto, and the main scanning direction may intersect with the sub-scanning direction at an angle other than a right angle.

[0014] The image forming apparatus 100 further includes a carriage motor (not shown) for reciprocating the carriage unit 201 in the direction of the arrow A, a carriage belt 202, a recording head 203 attached to the carriage unit 201, and a cutting mechanism 215.

[0015] The carriage unit 201 is supported by a main shaft 204 extending in the main scanning direction of the carriage unit 201. The position of the carriage unit 201 along the main scanning direction can be detected by reading a linear scale 206 with an encoder sensor 205 mounted on the carriage unit 201.

[0016] When recording is performed on the recording medium 200 with the above-mentioned configuration, the recording medium 200 is conveyed by the conveying rollers 208 to a predetermined recording start position on a platen 209, which is a holding member.

[0017] Thereafter, the carriage unit 201 scans the print head 203 in the main scanning direction, and the transport roller 208 transports the print medium 200 in the sub-scanning direction, and the transport roller 208 transports the print medium 200 in the sub-scanning direction.

[0018] The carriage unit 201 is electrically connected to a main board 211 by a flexible flat cable (hereinafter referred to as "FFC") 210. The main board 211 supplies power to the print head 203, controls the print head 203, and reads the position detected by the encoder sensor 205, via the FFC 210.

[0019] In addition, the carriage unit 201 is equipped with an edge detection sensor 212. The edge detection sensor 212 is used to detect the edge of the recording medium 200 by detecting the density of the recording medium 200 and the density of the platen 209.

[0020] Here, the position of the carriage unit 201 along the main scanning direction may be used as it is as the position along the main scanning direction of the end detection sensor 212. Also, a position obtained by adding a predetermined offset to the position along the main scanning direction of the carriage unit 201 may be used as the position along the main scanning direction of the end detection sensor 212.

[0021] After printing on the roll-shaped recording medium 200 is completed, the recording medium 200 is cut by a cutter 213 .

[0022] By using the operation / display device 104 of the image forming apparatus 100 or a host device 302 such as a personal computer connected to the image forming apparatus 100 (see FIG. 3), the user can select whether or not to cut the recording medium 200.

[0023] The image forming apparatus 100 is provided with a cleaning mechanism 214 for filling the recording head 203 with ink and for removing clogging of the nozzles of the recording head 203 .

[0024] Furthermore, when carriage unit 201 is in a standby state other than during scanning, it retreats to the position of cleaning mechanism 214. This retreat location is called the home position, and the opposite side is called the away position. Note that the home position is on the right side as viewed from the front of the main body of image forming apparatus 100, and the away position is on the left side. In Figure 2, arrow A indicating the scanning direction points in the direction from the home position to the away position.

[0025] 3 is a schematic block diagram showing an example of an image forming system according to the present embodiment. In the image forming system of the present embodiment, an image forming apparatus 100 is connected to a host device 302. The image forming apparatus 100 is, for example, a large-format inkjet image forming apparatus, and is capable of recording on a continuous recording medium (for example, roll paper) 200 (see FIG. 2) while conveying the recording medium 200. The image forming apparatus 100 includes an image forming controller 303, an operation panel 304, a RAM 305, a ROM 306, a carriage unit 201, a motor group 314, and a sensor group 315. An edge detection sensor 212 is included in the functional block of the sensor group 315.

[0026] The image forming controller 303 includes a processor 308 such as a CPU, a printer engine 307, a data input unit 309, a RAM controller 310, a ROM controller 311, and an operation panel controller 316. These modules included in the image forming controller 303 are connected to each other via a system bus bridge 312. The processor 308 issues commands to each module in the image forming controller 303 to control the whole. The data input unit 309 receives input image data from the host device 302 and develops the data in the RAM 305 via the RAM controller 310. The printer engine 307 receives data stored in the RAM 305 via the RAM controller 310. The printer engine 307 then converts the received data to conform to the image data format used by the printhead 203, and transmits the converted data to the printhead 203 according to information from the sensor group 315. An example of the information from the sensor group 315 is position information of the carriage unit 201. Program data and various parameters are stored in the ROM 306, and are transmitted to the RAM controller 310 and the printer engine 307 via the ROM controller 311. In this embodiment, the image forming controller 303 has the form of an ASIC (Application Specific Integrated Circuit) sealed in a single package as a system LSI. The RAM 305 and the ROM 306 may be included in the image forming controller 303.

[0027] 4 is a side view of the end detection sensor 212 as viewed from the A direction (see FIG. 2). The end detection sensor 212 includes a light emitting element 403 such as an LED and a light receiving element 404 such as a photodiode. Light emitted from the light emitting element 403 is irradiated onto the recording medium 200 or the platen 209. The light receiving element 404 receives light that is reflected by the recording medium 200 or the platen 209 and enters the light receiving element 404, out of the light irradiated onto the recording medium 200 or the platen 209. The end detection sensor 212 outputs a detection signal indicating the intensity of the light received by the light receiving element 404. In this embodiment, the stronger the light received by the light receiving element 404, the higher the voltage level of the detection signal.

[0028] FIG. 5 is a schematic plan view showing a mode in which the edge detection sensor 212 scans the platen 209, on a part of which the recording medium 200 is placed, in the main scanning direction. A frame line 501 as shown in the figure is arranged on the recording medium 200. The area where the frame line 501 is located is called the frame line area. In this embodiment, a reflective optical sensor as shown in FIG. 4 is used as the edge detection sensor 212. In the area where the recording medium 200 is present as shown in FIG. 5 (called the "recording medium area"), the light reflectance of the recording medium 200 is high, so the light received by the light receiving element 404 is strong, and the voltage level of the detection signal (also called the "detection level") is high. In the area where the recording medium 200 is not present (called the "holding member area"), the light reflectance of the platen 209 is low, so the light received by the light receiving element 404 is weak, and the detection level is low. The recording medium area includes an area where a frame line exists (called a "frame line area"). However, since the light reflectance in the frame line area is low, the light received by the light receiving element 404 is weak and the detection level is low.

[0029] 6 is a diagram for explaining a method according to the present embodiment for detecting the end position in the main scanning direction of the recording medium 200 placed on a part of the platen 209. In the example shown in FIG. 6, a frame line is arranged on the recording medium 200.

[0030] When the edge detection sensor 212 scans the vicinity of the boundary between the recording medium area and the holding member area, the detection level is, for example, as shown in Fig. 6. The detection level is high in the recording medium area. However, the detection level is low in the frame area included in the recording medium area. The detection level is also low in the holding member area.

[0031] The first threshold level TH1 is set between the detection level in the recording medium area (excluding the frame area) and the detection level in the holding member area. For example, the first threshold level TH1 is set to the average value of the detection level in the recording medium area (excluding the frame area) and the detection level in the holding member area.

[0032] Timer interrupts occur periodically at times t601, t605, t607, t609, t613, and t615. Sensor interrupts occur at times t603 and t611. The timer interrupts are generated by a periodic timer 803 (see FIG. 8), which will be described later. The sensor interrupt occurs when the detection level passes through the first threshold level TH1 from top to bottom as shown in FIG. 6. That is, the sensor interrupt occurs when the detection level changes from a level above the first threshold level TH1 to a level below it. At time t603, the sensor interrupt occurs because the scanning position passes the start point of the frame line. The start point of the frame line here is a point corresponding to the upstream edge of the frame line along the scanning direction. At time t611, the sensor interrupt occurs because the scanning position passes the end of the recording medium 200.

[0033] Times t602, t604, t606, and t608 are times when the delay time T has elapsed from the times t601, t603, t605, and t607 when the interrupts occurred, respectively. Similarly, times t610, t612, t614, and t616 are times when the delay time T has elapsed from the times t609, t611, t613, and t617 when the interrupts occurred, respectively. The scanning positions at times t602, t604, t606, t608, t610, t612, t614, and t616 are x1, x2, ..., x8, respectively.

[0034] Regardless of whether it is a timer interrupt or a sensor interrupt, the detection level is read at a time when a delay time T has elapsed from the time when the interrupt occurred. The delay time T is the time required for processing from the time when the interrupt occurred until the detection level is read, and is, for example, several nanoseconds to several microseconds. In the example of FIG. 6, the detection levels are read at times t602, t604, t606, t608, t610, t612, t614, and t616, and the detection levels at each time are L1 to L8. These detection levels are compared with a second threshold level TH2. Here, the second threshold level TH2 is set to be higher than the first threshold level TH1. The reason for this will be described later.

[0035] The detection level L1 at time t602 is higher than the second threshold level TH2. In this case, the scanning position x1 at time t602 is determined to belong to the recording medium area.

[0036] The detection level L2 at time t604 is lower than the second threshold level TH2. Also, there is no candidate for the end position. In this case, the scanning position x2 at time t604 is determined to be the end position or the start position of the frame area. Therefore, the scanning position x2 becomes a candidate for the end position.

[0037] The detection level L3 at time t606 is lower than the second threshold level TH2. Also, there is a candidate for the end position. In this case, the scanning position x3 at time t606 is determined to belong to the frame line area or the holding member area.

[0038] Here, the movement distance x3-x2 from the scanning position at time t604 (i.e., the candidate for the end position) x2 to the scanning position at time t506 x3 is compared with the threshold distance. The movement distance x3-x2 is shorter than the threshold distance. Therefore, although the scanning position x2 may be the end position, it may also be the start position of the frame line. Therefore, the scanning position x2 is left as a candidate for the end position.

[0039] Here, the threshold distance is a distance that is set to be equal to or greater than the frame width W. For example, the threshold distance preferably has a length that is 100% to 120% of the frame width, and more preferably has a length that is 105% to 115%.

[0040] The detection level L4 at time t608 is higher than the second threshold level TH2. In this case, the scanning position x4 at time t608 is determined to belong to the recording medium area. Therefore, the scanning position x2, which is a candidate for the end position, is also determined to be the start position of the frame line, not the end position.

[0041] The detection level L5 at time t610 is higher than the second threshold level TH2. In this case, the scanning position x5 at time t610 is determined to belong to the recording medium area.

[0042] The detection level L6 at time t612 is lower than the second threshold level TH2. Also, there is no candidate for the end position. In this case, the scanning position x6 at time t612 is determined to be the end position or the start position of the frame area. Therefore, the scanning position x6 becomes a candidate for the end position.

[0043] The detection level L7 at time t614 is lower than the second threshold level TH2. Also, there is a candidate for the end position. In this case, the scanning position x7 at time t614 is determined to belong to the frame area or the holding member area.

[0044] Here, the movement distance x7-x6 from the scanning position at time t612 (i.e., the candidate for the end position) x6 to the scanning position at time t614 x7 is compared with the threshold distance. The movement distance x7-x6 is shorter than the threshold distance. Therefore, although the scanning position x6 may be the end position, it may also be the start position of the frame line. Therefore, the scanning position x6 is left as a candidate for the end position.

[0045] The detection level L8 at time t616 is lower than the second threshold level TH2. Also, there is a candidate for the end position. In this case, the scanning position x8 at time t616 is determined to belong to the frame line area or the holding member area.

[0046] Here, the moving distance x8-x6 from the scanning position at time t612 (i.e., the candidate for the end position) x6 to the scanning position at time t616 x8 is compared with the threshold distance. The moving distance x8-x6 is longer than the threshold distance. Therefore, the scanning position (i.e., the candidate for the end position) x6 is determined to be the end position.

[0047] Here, referring to FIG. 7, threshold determination when noise is superimposed on the detection signal will be described. In FIG. 7, the line marked with 0 indicates the detection level when no noise is superimposed. The detection level fluctuates in the range of approximately -3σ to 3σ due to the superimposition of noise, where σ represents the standard deviation of the noise level. At time t701, the detection level fluctuates in the negative direction due to the superimposition of noise as shown by L(t). Furthermore, at time t702, which is a delay time T after time t701, the detection level fluctuates in the positive direction due to the superimposition of noise as shown by L(t+T).

[0048] If noise is not superimposed on the detection signal, even if the first threshold level TH1 is used instead of the second threshold level TH2 at time t702, the detection level at time t702 is lower than the first threshold level TH1. Therefore, the scanning position xi at time t702 is a correct candidate for the end position.

[0049] However, if noise is superimposed on the detection signal, when the first threshold level TH1 is used instead of the second threshold level TH2 at time t702, the detection level L(t+T) at time t702 is higher than the first threshold level TH1. Therefore, the scanning position xi at time t702 is not a candidate for the end position. This is incorrect.

[0050] In this embodiment, since the second threshold level TH2 is used at time t702, even if noise is superimposed on the detection signal, the detection level L(t+T) at time t702 is lower than the second threshold level TH2. Therefore, the scanning position xi at time t702 is a correct candidate for the end position.

[0051] From another perspective, by setting the second threshold level TH2 higher than the first threshold level TH1, it is possible to avoid erroneous detection even when the delay time T is short.

[0052] Returning to FIG. 6, for example, there is a possibility that the detection level L6 becomes higher than the threshold level TH1 due to noise being superimposed on the detection signal. In such a case, if the comparison result between the detection level and the threshold level TH1 is used, the scanning position x6 at time t612 is erroneously determined to belong to the recording medium area. In other words, the scanning position x6 at time t612 is erroneously determined to be neither the end position nor the start position of the frame area. In this embodiment, the second threshold level TH2, which is compared with the detection level acquired when the delay time T has elapsed since the interrupt signal was generated, is set higher than the threshold level TH1 used to detect the change in the detection level (TH2>TH1). Therefore, it is possible to avoid erroneous determination that the scanning position x6 at time t612 is neither the end position nor the start position of the frame area. In other words, the scanning position x6 at time t612 can be correctly set as a candidate for the end position.

[0053] Explaining this diagrammatically with reference to Fig. 6, the noise margin is increased from M1 to M2, which makes it possible to avoid the above-mentioned erroneous determination when noise is superimposed on the detection signal.

[0054] 8 is a functional block diagram showing an example of an end position detection unit 801 according to this embodiment. The end position detection unit 801 detects the end position in the main scanning direction of the recording medium 200 placed on a part of the platen 209.

[0055] The end position detection unit 801 includes the end detection sensor 212, a threshold setting unit 802, a cycle timer 803, a level change detection unit 804, a scanning position acquisition unit 805, and an end position determination unit 806. Here, the threshold setting unit 802, the cycle timer 803, the level change detection unit 804, the scanning position acquisition unit 805, and the end position determination unit 806 may each be configured by hardware or by software. Configuring by software means that the processor 308 configures by reading and executing a program stored in a storage medium such as the ROM 306. Also, each of these functional blocks may be configured by a combination of hardware and software.

[0056] The end detection sensor 212 is as described with reference to Fig. 4. The end detection sensor 212 supplies a detection signal to a level change detection section 804 and an end position determination section 806.

[0057] The threshold setting section 802 supplies a first threshold signal indicating a first threshold level to the level change detection section 804. The threshold setting section 802 also supplies a second threshold signal indicating a second threshold level higher than the first threshold level to the end position determination section 806.

[0058] The periodic timer 803 periodically generates a timer interrupt signal. The timer interrupt signal generated by the periodic timer 803 is supplied to an end position determination unit 806.

[0059] The level change detection unit 804 compares the level of the detection signal (detection level) supplied from the edge detection sensor 212 with the first threshold level indicated by the first threshold signal supplied from the threshold setting unit 802. The level change detection unit 804 generates a sensor interrupt signal when the detection level changes from a level above the first threshold level to a level below the first threshold level. That is, the level change detection unit 804 detects a change in the level of a signal indicating the intensity of light detected by the edge detection sensor 212 that scans the recording medium 200 or the platen 209 in the main scanning direction, and generates a sensor interrupt signal when the change is detected. Here, the change is a change from a level corresponding to the recording medium to a level corresponding to the holding member. The sensor interrupt signal generated by the level change detection unit 804 is supplied to the end position determination unit 806. The level corresponding to the recording medium is usually a level corresponding to the recording medium itself, specifically, a level corresponding to an unprinted portion of the recording medium.

[0060] A scanning position acquisition unit 805 acquires the current scanning position of the edge detection sensor 212 in the main scanning direction from the encoder sensor 205, and generates a scanning position signal indicating the scanning position. The scanning position signal is supplied to an end position determination unit 806.

[0061] The end position determination unit 806 starts an interrupt process when a timer interrupt signal or a sensor interrupt signal is generated. In the interrupt process, the end position determination unit 806 detects the end position of the recording medium 200 based on the detection signal, the second threshold signal, and the scanning position signal.

[0062] Specifically, the end position determination unit 806 acquires the detection level indicated by the detection signal at the time (delay time) when the delay time T has elapsed since the generation of the sensor interrupt signal. Then, if the acquired detection level is closer to the level corresponding to the holding member than the second threshold level indicated by the second threshold signal, the scanning position of the end detection sensor 212 at the delay time is set as a candidate for the end position.

[0063] The end position determination unit 806 also acquires the detection level indicated by the detection signal at the time when the delay time T has elapsed since the timer interrupt signal was generated. If the acquired detection level is closer to the level corresponding to the holding member than the second threshold level indicated by the second threshold signal, the movement distance is acquired. The movement distance here is the distance traveled by the end detection sensor 212 from the delay time corresponding to the time when the sensor interrupt signal was generated to the delay time corresponding to the time when the timer interrupt signal was generated. This is equal to the distance traveled by the end detection sensor 212 from the time when the sensor interrupt signal was generated to the time when the timer interrupt signal was generated. The movement distance is compared with the threshold distance, and if the movement distance is longer than the threshold distance, the candidate is determined as the end position. The threshold distance here is set to be equal to or greater than the frame width, as described above. Details of the interrupt process will be described later.

[0064] 9 is a flowchart for explaining the end position detection method performed by end position detection unit 801. The end position detection method will be explained below with reference to this flowchart.

[0065] The end position detection method is started by an instruction from the processor 308 that controls the overall operation of the image forming apparatus 100. The end position detection method includes a step group from S901 to S904, a step group from S911 to S915, and a step group from S921 to S929. These three step groups start and are executed simultaneously. The step group from S901 to S904 is for generating a sensor interrupt signal, and is mainly executed by the level change detection unit 804. The step group from S911 to S915 is for generating a timer interrupt signal, and is mainly executed by the period timer 803. The step group from S921 to S929 is for determining the end position, and is mainly executed by the end position determination unit 808.

[0066] When all or part of the end position detection unit 801 is configured by software, the execution of each unit included in the end position detection unit 801 includes the processor 308 reading and executing a program for configuring each unit.

[0067] In S901, the level change detection unit 804 determines whether a falling edge has occurred in the detection level. A falling edge here refers to a level change in which the detection level changes from a level corresponding to the recording medium 200 to a level corresponding to the platen 209, which is a holding member. This level change is detected by comparing the detection level with the first threshold level, as described above.

[0068] In the first step group, if the level change detection unit 804 determines in S901 that a falling edge has occurred in the detection level (S901: YES), the process proceeds to S903 and generates a sensor interrupt signal. Next, in S904, the level change detection unit 804 determines whether the end position has been determined. Here, the end position being determined means that the end position has been determined by executing S929. If the end position has been determined (S904: YES), the level change detection unit 804 ends the process, and if it has not been determined (S904: NO), the process returns to S901.

[0069] If the level change detection unit 804 determines in S901 that no falling edge has occurred in the detection level (S901: NO), the process proceeds to S902, where it determines whether the end position has been determined. If the end position has been determined (S902: YES), the level change detection unit 804 ends the process, and if it has not been determined (S902: NO), the process returns to S901.

[0070] Regarding the second group of steps, in S911, the periodic timer 803 initializes the timer with a timer value, which has a time length proportional to the timer interrupt width V (FIG. 6) and is calculated by dividing the timer interrupt width V by the scanning speed.

[0071] In S912, the periodic timer 803 determines whether the timer value has elapsed. If the timer value has elapsed (S912: YES), the periodic timer 803 advances the process to S914 and generates a timer interrupt signal. Next, in S915, the periodic timer 803 determines whether the end position has been determined. If the end position has been determined (S915: YES), the periodic timer 803 ends the process, and if the end position has not been determined (S915: NO), the process returns to S911.

[0072] In S912, if the timer value has not elapsed (S912: NO), the cycle timer 803 advances the process to S913 and determines whether the end position has been determined. If the end position has been determined in S913 (S913: YES), the cycle timer 803 ends the process, and if it has not been determined (S913: NO), the cycle timer 803 returns the process to S911.

[0073] In the third step group, in S921, the end position determination unit 806 determines whether or not an interrupt signal has occurred. The interrupt signal here includes both the sensor interrupt signal generated by the level change detection unit 804 in S903 and the timer interrupt signal generated by the period timer 803 in S914.

[0074] If an interrupt signal occurs, that is, if either a sensor interrupt signal or a timer interrupt signal occurs (S921: YES), the end position determination unit 806 starts the interrupt process starting from S922. On the other hand, if an interrupt signal does not occur (S921: NO), the end position determination unit 806 returns the process to S921 and waits until an interrupt signal occurs.

[0075] In S922 , the end position determination unit 806 acquires the current position of the end detection sensor 212 indicated by the scanning position signal supplied from the scanning position acquisition unit 805 .

[0076] Next, in S923 , the end position determination unit 806 acquires the detection level indicated by the detection signal supplied from the end detection sensor 212 .

[0077] Here, S922 and S923 are executed at almost the same time, but the above-mentioned delay time T occurs between the generation of the interrupt signal and the execution of S923. For example, when an interrupt flag is used as the interrupt signal, a delay time T1 occurs between the detection of the falling edge of the detection level in S901 and the setting of the flag in S903. A period T2 occurs in order to detect the set flag in the loop of S921. Furthermore, a time T3 occurs in order to obtain the current position in S922. The delay time T is T1+T2+T3. Similarly, a delay time T4 occurs between the detection of the timer value lapse in S912 and the setting of the flag in S914. A period T2 occurs in order to detect the set flag in the loop of S921. Furthermore, a time T3 occurs in order to obtain the current position in S922. The delay time T is T4+T2+T3.

[0078] Next, in S924, the end position determination unit 806 determines whether the detection level is lower than the second threshold level. In other words, it determines whether the detection level is closer to the level corresponding to the platen 209, which is the holding member, than the second threshold level. If the detection level is equal to or higher than the second threshold level (S924: NO), the end position determination unit 806 proceeds to S928 and deletes the currently remaining end position candidates. This is because if the detection level is equal to or higher than the second threshold level, the current scanning position belongs to the recording medium area, and the end position candidates upstream of the current scanning position also belong to the recording medium.

[0079] If the detection level is less than the second threshold level (S924: YES), the end position determination unit 806 advances the process to S925 and determines whether the movement distance exceeds the threshold distance. The movement distance here is the movement distance from the candidate end position to the current position. In other words, the movement distance here is the distance from the candidate end position set in S927 (described later) executed in the interrupt process n times before the current interrupt process (n is 1 or more) to the current position acquired in S922 executed in the current interrupt process. Note that if there is no candidate end position, the movement distance itself cannot be defined, so the movement distance is considered to be zero. The threshold distance is set to be equal to or greater than the frame width as described above.

[0080] If the movement distance is equal to or less than the threshold distance (S925: NO), the end position determination unit 806 advances the process to S926.

[0081] In S926, the end position determination unit 806 determines whether or not there is a candidate for the end position. If there is no candidate for the end position (S926: NO), the end position determination unit 806 advances the process to S927, sets the current position detected in S922 of this interrupt process as a candidate for the end position, and then returns the process to S921.

[0082] On the other hand, if a candidate for the termination position exists (S926: YES), the termination position determination unit 806 bypasses S927 and returns the process to S921. In this case, the already existing candidate for the termination position remains as it is.

[0083] If the movement distance exceeds the threshold distance (S925: YES), the end position determination unit 806 proceeds to S929 and determines the currently existing candidate for the end position as the end position. This is because the movement distance exceeding the threshold distance indicates that the currently existing candidate for the end position is not the start point of the frame line.

[0084] The process performed by the end position determining unit 806 in the example shown in FIG. 6 will now be described.

[0085] In the interrupt process started by the timer interrupt signal generated at time t601, the detection level L1 is higher than the second threshold level TH2 (S924: NO), so the interrupt process ends. If there is a candidate for the end position, it is deleted (S928).

[0086] In the interrupt process started by the sensor interrupt signal generated at time t603, the detection level L2 is lower than the second threshold level TH2 (S924: YES). Then, since the travel distance cannot be defined (S925: NO) and there is no candidate for the end position (S926: NO), the current position x2 is set as a candidate for the end position (S927).

[0087] In the interrupt process started by the timer interrupt signal generated at time t605, the detection level L3 is lower than the second threshold level TH2 (S924: YES), and the moving distance x3-x2 is shorter than the threshold distance (S925: NO). And, since the end position candidate x2 exists (S926: YES), the current position x3 is not selected as the end position candidate, and the interrupt process ends. Therefore, the end position candidate x2 remains as it is.

[0088] In the interrupt process started by the timer interrupt signal generated at time t607, the detection level L4 is higher than the second threshold level TH2 (S924: NO), so the end position candidate x2 is deleted (S928), and the interrupt process ends.

[0089] In the interrupt process started by the timer interrupt signal generated at time t609, the detection level L5 is higher than the second threshold level TH2 (S924: NO), so the interrupt process ends. The end position candidate x2 has already been deleted.

[0090] In the interrupt process started by the sensor interrupt signal generated at time t611, the detection level L6 is lower than the second threshold level TH2 (S924: YES). Then, since the travel distance cannot be defined (S925: NO) and there is no candidate for the end position (S926: NO), the current position x6 is set as a candidate for the end position (S927).

[0091] In the interrupt process started by the timer interrupt signal generated at time t613, the detection level L7 is lower than the second threshold level TH2 (S924: YES), and the moving distance x7-x6 is shorter than the threshold distance (S925: NO). And, since the end position candidate x6 exists (S926: YES), the current position x7 is not selected as the end position candidate, and the interrupt process ends. Therefore, the end position candidate x6 remains as it is.

[0092] In the interrupt process started by the timer interrupt signal generated at time t615, the detection level L8 is lower than the second threshold level TH2 (S924: YES), and the moving distance x8-x6 is longer than the threshold distance (S925: YES). Therefore, the candidate x6 for the end position is determined as the end position (S929).

[0093] In the above, as shown by the arrow A (see FIG. 2), a configuration in which the end position of the recording medium 200 is detected by moving the carriage unit 201 in the direction from the home position to the away position has been described as an example. That is, a configuration in which the downstream end position along the main scanning direction of the recording medium 200 is detected has been described as an example. However, this is not limited to this, and the leading end position of the recording medium 200 can also be detected by moving the carriage unit 201 in the direction from the away position to the home position. That is, the upstream end position along the main scanning direction of the recording medium 200 can also be detected. Therefore, for example, the leading end position and the ending position of the recording medium 200 (that is, the positions of both ends) can be detected by moving the carriage unit 201 back and forth between the home position and the away position. Also, the width of the recording medium 200 can be calculated based on the positions of both ends along the main scanning direction of the recording medium 200.

[0094] The above describes a configuration for detecting the end position of the recording medium in the main scanning direction. The above paragraph also describes a configuration for detecting the leading end position of the recording medium in the main scanning direction. However, this is not limited to the above, and the end position and leading end position of the recording medium 200 in the sub-scanning direction can also be detected. For example, these detections are possible by conveying the recording medium 200 in the sub-scanning direction or the opposite direction by the conveying roller 208 while the carriage unit 201 is fixed at a predetermined position along the main scanning direction. However, in order to avoid errors in the detection position due to differences in height, it is preferable to rotate the end detection sensor 212 by 90 degrees in a plan view. That is, although FIG. 4 is a side view seen from the direction A, a similar optical path is formed when viewed from the direction B. Specifically, the end of the recording medium 200 in the sub-scanning direction (conveying direction) can be detected by conveying the recording medium 200 in the direction of the arrow B (see FIG. 2) from the position where the end detection sensor 212 detects the recording medium 200. Similarly, the leading edge in the sub-scanning direction can be detected by conveying the recording medium 200 in the direction opposite to the direction of arrow B from the position where the end detection sensor 212 detects the recording medium 200. Also, the length of the recording medium 200 can be calculated based on the positions of both ends of the recording medium 200 in the sub-scanning direction.

[0095] Therefore, the end position detection unit 801 functions as an end position detection unit. The end positions here include the leading end position and the trailing end position in the main scanning direction and the leading end position and the trailing end position in the sub-scanning direction. Similarly, the end position determination unit 806 functions as an end position determination unit.

[0096] 10(a), taking the example of the recording medium 200 being cut paper, it is possible to detect a start position 1002 and an end position 1003 in a paper width direction 1001 of the recording medium 200. Based on these, it is possible to calculate a paper width 1004 using the processor 308. Furthermore, it is possible to detect a start position 1006 and an end position 1007 in a paper height direction 1005 of the recording medium 200, and based on these, it is possible to calculate a paper height 1008 using the processor 308.

[0097] A two-dimensional printing area can also be set using the processor 308 based on a start position 1002 and an end position 1003 along the paper width direction 1001 of the recording medium 200, and a start position 1006 and an end position 1007 along the paper height direction 1005.

[0098] Also, as shown in FIG. 10B, in the case where the recording medium 200 is a roll paper, the cut position 1010 can be calculated based on the start end position 1007 along the winding direction 1005 of the recording medium 200 and the desired paper height (length) 1009. For example, the second transport position when cutting the recording medium 200 can be calculated based on the first transport position when the downstream end position detected by the end position detection unit 801 coincides with a predetermined reference position and the desired paper height along the sub-scanning direction of the recording medium 200. For example, if the position of the detection point of the end detection sensor 212 and the position of the cutter 213 are the same in the sub-scanning direction, the second transport position can be calculated by adding the paper height to the first transport position. If the position of the cutter 213 has an offset distance in the sub-scanning direction with respect to the position of the detection point of the end detection sensor 212, the second transport position can be calculated by adding the paper height to the first transport position and further correcting by adding the offset distance. For example, if the cutter 213 is an offset distance downstream from the edge detection sensor 212, the second transport position can be obtained by adding the paper height and the offset distance to the first transport position. The recording medium 200 is stopped at the second transport position, and then the recording medium 200 is cut. This makes it possible to obtain cut paper having the desired paper height from the roll paper.

[0099] <Second embodiment> Since the timer interrupt is not generated by comparing the detection level with the first threshold level, the detection level acquired in S923 executed in the interrupt process started by the timer interrupt is unlikely to be close to the first threshold level TH1. Therefore, it is not necessary to determine the second threshold level TH2 used in the interrupt process started by the timer interrupt relative to the first threshold level TH1. The second threshold level TH2' used in the interrupt process started by the timer interrupt may be freely set as long as it is a level that allows the level corresponding to the recording medium area (excluding the frame area) and the level corresponding to the holding member area to be distinguished. In other words, the second threshold level TH2' used in the interrupt process started by the timer interrupt may be made different from the second threshold level TH2 used in the sensor interrupt. For example, a third threshold level used in the interrupt process started by the timer interrupt may be introduced and the third threshold level may be made different from the second threshold level used in the interrupt process started by the sensor interrupt. In order to make them different, for example, the threshold level may be set to the second threshold level or the third threshold level in S924 depending on the type of interrupt signal that caused the interrupt. That is, if the interrupt processing is started by a sensor interrupt signal, the second threshold level may be used, and if the interrupt processing is started by a timer interrupt signal, the third threshold level may be set. In order to determine whether the interrupt processing is started by a sensor interrupt signal or a timer interrupt signal, for example, the following first and second flags may be used. That is, the first flag set in S903 and the flag set in S914 may be used. The first and second flags are referred to before proceeding from S923 to S924, and are used to determine whether to use the third threshold level instead of the second threshold level in S924. After that, the first or second flag that has been set is reset.

[0100] In the first embodiment, the second threshold level is set higher than the first threshold level in order to reduce the possibility that the end position cannot be detected due to noise being superimposed on the detection signal. However, for example, if the estimated noise level is low and the possibility of malfunction due to noise is low, the second threshold level may be made closer to the first threshold level. Conversely, if the estimated noise level is high and the possibility of malfunction due to noise is high, the second threshold level may be made farther from the first threshold level. That is, the difference between the first threshold level and the second threshold level may be adjusted according to the noise level. For example, the second threshold level may have a level difference of about three to four times the RMS of the noise with respect to the first threshold level. Also, when the interrupt process is generated by the sensor interrupt signal, if the delay time T is long, the amount of decrease in the detection level due to the lapse of the delay time T increases, so the second threshold level may be made closer to the first threshold level. Conversely, if the delay time T is short, the amount of decrease in the detection level due to the lapse of the delay time T decreases, so the second threshold level may be made farther from the first threshold level. That is, the difference between the first threshold level and the second threshold level may be adjusted according to the delay time T. Although it depends on the magnitude of the noise level and the length of the delay time T, if the noise level and the decrease in the detection level due to the lapse of the delay time T cancel each other out, the second threshold level may be set to be the same as the first threshold level, taking this into consideration.

[0101] In most cases where an interrupt is generated by a timer interrupt signal, the detection level is far from the first threshold level and also far from the second threshold level which is offset from the first threshold level, so that the processing of an interrupt generated by a timer interrupt signal is not affected by adjusting the second threshold level.

[0102] In any case, the detection method may be carried out multiple times to take into account detection errors, and the most upstream end position may be adopted, or the end position may be determined by majority vote.

[0103] In the first embodiment, the detection level at the time when the delay time T has elapsed since the level change detection unit 804 detected the level change of the detection signal is compared with the second threshold level TH2. Then, the scanning position at the time when the delay time T has elapsed since the level change detection unit 804 detected the level change of the detection signal is set as a candidate for the end position. However, this is not limited to this, and the scanning position at the time when the delay time T×α has elapsed since the level change detection unit 804 detected the level change of the detection signal may be set as a candidate for the end position. Here, α is usually equal to or greater than zero and equal to or less than 1, but it does not necessarily have to be in this range. For example, S922 and S923 may be interchanged, but in this case, α exceeds 1. To make α closer to zero, for example, S922 between S921 and S923 may be deleted, and S922 may be inserted between S901 and S903 and between S912 and S914.

[0104] <Third embodiment> The first and second embodiments are based on the premise that the detection level corresponding to the frame line present on the recording medium may fall below the first threshold level, and avoid erroneously determining the position of the frame line as the end position by signal processing. In contrast, the third embodiment checks whether or not a frame line exists on the recording medium before printing begins, and if so, adjusts the threshold level so that the detection level corresponding to the frame line does not fall below the threshold level.

[0105] 11 is a functional block diagram showing an example of an end position detection unit 801 according to this embodiment. The end position detection unit 801 detects the end position in the main scanning direction of the recording medium 200 placed on a part of the platen 209.

[0106] The end position detection unit 801 includes the end detection sensor 212, a cycle timer 803, a level change detection unit 804, a scanning position acquisition unit 805, an end position determination unit 806, and a preparation unit 1101. Here, the cycle timer 803, the level change detection unit 804, the scanning position acquisition unit 805, the end position determination unit 806, and the preparation unit 1101 may each be configured by hardware or by software. Configuring by software means that the processor 308 configures by reading and executing a program stored in a storage medium such as the ROM 306. Also, each of these functional blocks may be configured by a combination of hardware and software.

[0107] The end detection sensor 212 is as described with reference to Fig. 4. The end detection sensor 212 supplies a detection signal to the level change detection unit 804.

[0108] The preparation unit 1101 supplies a threshold signal indicating the threshold level to the level change detection unit 804. Before starting printing, the preparation unit 1101 checks whether or not a frame line exists on the recording medium by a method described later. When no frame line exists on the recording medium, the preparation unit 1101 sets a default threshold level to the level change detection unit 804 as the threshold level THp used during printing. Here, the default threshold level is, for example, an average level of the detection level corresponding to the recording medium and the detection level corresponding to the platen 209, but is not limited to this. On the other hand, when a frame line exists on the recording medium, the preparation unit 1101 adjusts the threshold level so that the detection level corresponding to the frame line does not fall below the threshold level. Then, the preparation unit 1101 sets the adjusted threshold level to the level change detection unit 804 as the threshold level THp used during printing. In order to check whether or not a frame line exists on the recording medium, the preparation unit 1101 uses a detection signal from the edge detection sensor 212, a timer interrupt signal from the cycle timer 803, and a scanning position signal from the scanning position acquisition unit 805.

[0109] In addition, the preparation unit 1101 obtains a scanning position correction amount Δx, which will be described later, and sets this in the end position determination unit 806 .

[0110] The periodic timer 803 periodically generates a timer interrupt signal when the threshold setting unit 802 checks whether or not a frame line exists on the recording medium before starting printing. The timer interrupt signal generated by the periodic timer 803 is supplied to the threshold setting unit 802. Note that, unlike the first embodiment, the timer interrupt signal is not supplied to the end position determination unit 806.

[0111] The level change detection unit 804 compares the level of the detection signal (detection level) supplied from the edge detection sensor 212 with the threshold level for printing set by the preparation unit 1101. The level change detection unit 804 generates a sensor interrupt signal when the detection level changes from a level above the threshold level for printing to a level below the threshold level for printing. That is, the level change detection unit 804 detects a change in the level of a signal indicating the intensity of light detected by the edge detection sensor 212 that scans the recording medium 200 or the platen 209 in the main scanning direction, and generates a sensor interrupt signal when the change is detected. Here, the change is a change from a level corresponding to the recording medium to a level corresponding to the holding member. The sensor interrupt signal generated by the level change detection unit 804 is supplied to the end position determination unit 806. The level corresponding to the recording medium is usually a level corresponding to the recording medium itself, specifically, a level corresponding to an unprinted portion of the recording medium.

[0112] A scanning position acquisition unit 805 acquires the current scanning position of the edge detection sensor 212 in the main scanning direction from the encoder sensor 205, and generates a scanning position signal indicating the scanning position. The scanning position signal is supplied to an end position determination unit 806.

[0113] The end position determination unit 806 starts an interrupt process when a sensor interrupt signal is generated. In the interrupt process, the end position determination unit 806 detects the end position of the recording medium 200 based on the scanning position signal and the scanning position correction amount. The scanning position correction amount will be described later.

[0114] Specifically, the end position determination unit 806 determines, as the end position, the position obtained by correcting the scanning position indicated by the scanning position signal using the scanning position correction amount at the time (delay time) when the delay time T has elapsed since the sensor interrupt signal was generated.

[0115] 12 is a flowchart for explaining a preparation method performed by the preparation unit 1101. Note that part of the method performed by the preparation unit 1101 may be performed by a control unit (not shown) that works in conjunction with the preparation unit 1101. The control unit functions by the processor 308 reading and executing a program stored in the ROM 306 or the like. The preparation method is executed before printing starts, and as a result, a threshold level THp and a scanning position correction amount Δx (Δx1 or Δx2 described later) to be used during printing are set.

[0116] In S1201, based on a command from the preparation unit 1101, the conveying rollers 208 convey the recording medium 200 to a predetermined position for preparation for printing.

[0117] In S1202, the preparation unit 1101 performs calibration. In the calibration, the amount of light emitted from the light emitting element 403, the gain of the amplifier that amplifies a signal indicating the light received by the light receiving element 404, and the offset of the signal are adjusted. In addition, in the calibration, a default threshold level TH is set. As the default threshold level, for example, a level obtained by taking a weighted average (for example, a 1:1 weighted average) of the detection level corresponding to the recording medium 200 and the detection level corresponding to the platen 209 is set.

[0118] In S1203, first, the preparation unit 1101 moves the recording medium 200 in the sub-scanning direction to a predetermined position by the conveyance roller 208 so that the edge detection sensor 212 can main-scan an area of ​​the recording medium 200 at a first predetermined sub-scanning position along the main scanning direction. As the first predetermined sub-scanning position, for example, a position a predetermined distance away from the edge of the recording medium can be selected to avoid wrinkles or stains at the edge of the recording medium. In S1203, the preparation unit 1101 then controls the carriage unit 201 to move from the away position to the home position along the scanning direction, thereby performing a first scan by the edge detection sensor 212. At this time, the recording medium 200 and the platen 209 are scanned in order. The first scan is also performed at a scanning speed V0 lower than the scanning speed V1 during printing.

[0119] The low scanning speed V0 is, for example, a speed low enough that the waveform of the intensity of the light received by the light receiving element 404 and the waveform of the detection signal output by the amplifier almost match in the linear region. In other words, it is a speed slow enough that the influence of the delay characteristic and other characteristics of the electric circuit such as the light receiving element 403 or the amplifier does not affect the relationship between the level of the detection signal and the scanning position. The level of the output signal of the light receiving element 404 increases in proportion to the ratio of the area where the reflected light from the recording medium enters to the area of ​​the detection region of the light receiving element, but when the scanning speed V0 is sufficiently low, the level of the detection signal also changes in the same manner. As shown in FIG. 13, the detection level changes in a V-shape near the frame line and decreases linearly at the end position, but when the scanning speed is sufficiently slow, it directly represents the ratio of the area where the reflected light from the recording medium enters to the area of ​​the detection region of the light receiving element. Here, the part with the frame line is considered to be a part where the recording medium does not exist.

[0120] 13, in the first scan, the preparation unit 1101 samples the scanning position and the detection signal at the time when the delay time T has elapsed from the generation time of the timer interrupt signal every time the cycle timer 803 generates a timer interrupt signal with cycle Z. Then, the preparation unit 1101 stores data indicating the sampled scanning position and data indicating the level of the detection signal in the RAM 305. In this way, the preparation unit 1101 can obtain sample values ​​of the detection level that accurately represent the light receiving intensity by the light receiving element 404 at each scanning position arranged at intervals determined by the cycle Z and the scanning speed of the first scan, as shown in FIG. 13. Note that the cycle Z of the timer interrupt signal is set to be short enough to indicate the change in the light receiving intensity in the framed region and its periphery, and the change in the light receiving intensity in the edge position of the recording medium 200 and its periphery, as shown in FIG. 13, by the sample values ​​of the detection level.

[0121] In S1204, the preparation unit 1101 determines whether or not a candidate for a frame line exists in the recording medium area based on a plurality of sample values ​​of the detection level acquired by the first scan. That is, the preparation unit 1101 determines whether or not a frame line was detected during the period when the optical sensor performs the first scan of the recording medium along the scanning direction based on a plurality of sample values ​​of the detection level acquired by the first scan. For this purpose, the preparation unit 1101 compares a plurality of sample values ​​of the detection level with a default threshold level TH. The sample values ​​are checked in the order from the home position to the away position in the scanning direction (in the order from right to left in the figure). Then, at the boundary from the holding member area (area of ​​the platen 209) into the recording medium area, the sample value changes from a level below the default threshold level TH to a level above it. If the sample values ​​are checked further upstream from this point, if there is no frame line, samples with a level above the default threshold level TH continue to the boundary on the opposite side. On the other hand, if there is a frame line, the level of some samples will be below the default threshold level TH before the boundary on the opposite side. Therefore, based on this difference, it is possible to determine whether or not there is a candidate for a frame line in the recording medium area. That is, since the area between the two boundaries between the holding member area and the recording medium area is the recording medium area, the recording medium area can be specified by detecting the two boundaries. If there is a sample in the recording medium area that has a level below the default threshold level TH, then there is a border in the recording medium area. An example will be described using FIG. 13. When the sample values ​​of the detection level are examined toward the home position side (right side in the figure) or the away position side (left side in the figure) in the scanning direction, the level of the sample in the range from sample Sv to sample Su is below the default threshold level TH. The level of sample St is above the default threshold level TH. Therefore, it can be seen that a boundary exists between sample Su and sample St. The boundary on the opposite side can be found in the same way. The range between these boundaries is the recording medium area. When the levels of the samples in the range from sample Sp to sample St in the recording medium area are examined, the level of sample Sr is below the default threshold level TH.Therefore, it is possible to determine that there is a frame line in the area including the position where the sample Sr exists. However, the level of the sample may fall below the default threshold level TH due to dust or dirt adhering to the recording medium. Therefore, even if the level of any sample in the recording medium area falls below the default threshold level TH, it cannot be determined that there is a frame line on the recording medium. Therefore, if there is a sample in the recording medium area whose level is below the default threshold level TH, it is determined that there is a frame line candidate.

[0122] If the preparation unit 1101 determines in S1204 that there are no frame line candidates in the recording medium area, the process proceeds to S1208. On the other hand, if the preparation unit 1101 determines in S1204 that there are frame line candidates in the recording medium area, the process proceeds to S1205.

[0123] In S1205, first, the preparation unit 1101 moves the recording medium 200 in the sub-scanning direction to a predetermined position by the conveyance roller 208 so that the end detection sensor 212 can main-scan the area of ​​the second predetermined sub-scanning position of the recording medium 200 along the main scanning direction. The second predetermined sub-scanning position may be different from the first predetermined sub-scanning position. However, it is preferable that the second predetermined sub-scanning position is somewhat distant from the first predetermined sub-scanning position. As the second predetermined sub-scanning position, for example, a position a predetermined distance away from the end on the opposite side to the side where the first predetermined sub-scanning position is located can be selected. In S1205, next, the preparation unit 1101 controls the carriage unit 201 to move in the scanning direction, thereby performing the second scan by the end detection sensor 212. At this time, the recording medium 200 and the platen 209 are scanned in order, as in the first scan. Also, the second scan is performed at a scanning speed lower than the scanning speed during printing, as in the first scan. It is preferable to perform the second scan at the same scanning speed as the first scan, but it is not necessary to make them the same. Also, as shown in FIG. 13, in the second scan, like the first scan, the preparation unit 1101 samples the detection signal every time the cycle timer 803 generates a timer interrupt signal at the cycle Z'. In this way, as shown in FIG. 13, the preparation unit 1101 can obtain sample values ​​of the detection level that accurately represent the light receiving intensity by the light receiving element 404 at each scanning position arranged at an interval determined by the cycle Z and the scanning speed of the second scan. It is preferable to make the cycle Z' in the second scan the same as the cycle Z in the first scan, but it is not necessary to make them the same. In the second scan, too, the preparation unit 1101 samples the scanning position and the detection signal at the time when the delay time T has elapsed from the time when the timer interrupt signal was generated every time the cycle timer 803 generates a timer interrupt signal at the cycle Z'. Then, the preparation unit 1101 stores data indicating these values ​​in the RAM 305. If the first and second scans have the same scanning speed and period, and the sample level is reduced below the default threshold level TH only due to the presence of the frame line, the first and second scans can obtain similar sample sequences.

[0124] In S1206, the preparation unit 1101 determines whether or not a candidate for a frame line exists in the recording medium area based on the multiple sample values ​​of the detection level acquired by the second scan. To this end, the preparation unit 1101 compares the multiple sample values ​​of the detection level acquired by the second scan with a default threshold level TH.

[0125] In S1204, a region at a first predetermined sub-scanning position on the recording medium 200 is main-scanned along the main scanning direction to determine whether or not there is a frame line candidate. In S1206, a region at a second predetermined sub-scanning position on the recording medium 200 is main-scanned along the main scanning direction to determine whether or not there is a frame line candidate. Therefore, if the determination result in S1204 is positive and the determination result in S1206 is positive, there is a high probability that a frame line actually exists on the recording medium. Therefore, if the preparation unit 1101 determines in S1206 that a frame line candidate exists, the process proceeds to S1207.

[0126] If the preparation unit 1101 determines in S1206 that no frame line candidate exists, the probability that a frame line actually exists on the recording medium is low, and so the processing proceeds to S1208.

[0127] In S1207, the preparation unit 1101 again determines whether or not a frame line exists on the recording medium. Referring to Fig. 13, the distance L from the edge position of the recording medium to the frame line position can be calculated using the number of samples from sample Sr to sample Su. The distance L can also be calculated by Distance L = number of samples from sample Sr to sample Su × Main scanning speed × Interrupt period Z The distance corresponding to the first scan is represented as L1, and the distance corresponding to the second scan is represented as L2. If the scanning speeds, interrupt cycles, and interrupt phases relative to the positions are different between the first and second scans, or if the recording medium is disposed at an angle, then a difference will arise between L1 and L2. However, if the absolute value of the difference between L1 and L2 is less than a predetermined value ΔL (>0), that is, abs(L1-L2)<ΔL If so, it can be determined that a border exists. Here, abs() indicates the absolute value.

[0128] In addition, whether or not a frame line exists may be determined based on whether the absolute value of the difference between the position of the sample Sr corresponding to the first scan and the position of the sample Sr corresponding to the second scan is less than a predetermined value ΔL.

[0129] Also, taking into consideration that a recording medium may have two or more border lines and that border line candidates may be generated due to noise, zero to multiple border line candidates are generated by the first scan, and zero to multiple border line candidates are generated by the second scan. In the border line determination, one or more border line candidates in the first scan are all compared with one or more border line candidates in the second scan in an exhaustive manner, and if there is at least one pair of matching candidates, it is determined that a border line is present on the recording medium.

[0130] In S1208, the preparation unit 1101 sets the threshold level THp to be used during printing. In brief, when the preparation unit 1101 determines in S1207 that the recording medium has a frame line, it obtains a threshold level TH' lower than the default threshold level TH and sets it as the threshold level THp to be used during printing. On the other hand, when the preparation unit 1101 determines in S1207 that the recording medium does not have a frame line, it sets the default threshold level TH as the threshold level THp to be used during printing. Also, when the preparation unit 1101 determines that the recording medium has a NO frame line in S1204 and when the preparation unit 1101 determines that the recording medium has a NO frame line, it sets the default threshold level TH as the threshold level THp to be used during printing. Details of S1208 will be described later.

[0131] In S1209, the preparation unit 1101 acquires the scanning position correction amount Δx. Here, the scanning position correction amount Δx will be described with reference to FIG.

[0132] As shown in FIG. 14, in the vicinity of the boundary between the recording medium area and the holding member area, as the scanning continues from the recording medium area toward the holding member area along the main scanning direction, the detection level gradually decreases. When the default threshold level TH is set as the threshold level THp during printing and scanning is performed at the scanning speed during printing, at a certain scanning position near the boundary between the recording medium area and the holding member area, a sensor interruption occurs when the detection level crosses the threshold level THp from top to bottom. The scanning position at this time can be defined as the reference boundary position.

[0133] When a threshold level TH´ (<TH) adjusted to be lower than the detection level corresponding to the frame line in the recording medium area is set as the threshold level THp during printing, the scanning position at which the sensor interruption occurs moves to a position closer to the home position than the reference boundary position. Further, when a delay time T elapses from the time t1401 when the sensor interruption occurs to the time t1402 when the scanning position is acquired, the scanning position moves further to a position from the home position. Therefore, a scanning position correction amount Δx is introduced to correct both the setting of the threshold level TH´ lower than the default threshold level TH as the threshold level THp during printing and the occurrence of the delay time T. By doing so, by correcting the scanning position x1402 acquired during printing by the scanning position correction amount Δx, the boundary position can be obtained.

[0134] Note that the rate of change of the detection level with respect to the scanning position near the boundary becomes smaller as the scanning speed is higher due to the influence of the delay characteristics of a circuit such as an amplifier. That is, when the main scanning position is on the horizontal axis and the detection level is on the vertical axis, the slope of the straight line indicating the detection level becomes gentler as the scanning speed is higher. In S1209, the scanning position correction amounts Δx1 and Δx2 are obtained in consideration of this, which will be described later.

[0135] It should be noted that frame line candidates that cannot be paired in the first and second scans may indicate dust or dirt on the recording medium. Therefore, if such frame line candidates are present, the recording medium, roll paper, may be fed and cut, and then printing preparation may be performed again. There may also be cases where no frame line candidates are generated in the first scan, and frame line candidates due to dust or dirt are generated in the second scan. In such cases, it is preferable to feed and cut the recording medium, roll paper, and then printing preparation may be performed again. Therefore, a step may be added to check whether no frame line candidates are generated in the first scan, and whether frame line candidates are generated in the second scan. Alternatively, S1204 may be omitted, and the presence or absence of a frame line and the presence or absence of dust or dirt may be determined together in S1206.

[0136] Also, if it is unlikely that a frame candidate will be generated due to dust or dirt at a scanning position where no frame exists, S1205, S1206, and S1207 may be omitted. In this case, if the answer is YES in S1204, it is immediately determined that the recording medium has a frame. In S1208, it is determined whether or not there is a frame (S1501, S2001) based on the result of the determination in S1204.

[0137] FIG. 15 is a flowchart showing details of threshold level setting according to this embodiment.

[0138] In S1501, the preparation unit 1101 judges whether or not the recording medium has a frame line. If it is judged in S1207 (see FIG. 12) that the recording medium has a frame line, the judgment in S1501 is YES, and the preparation unit 1101 advances the process to S1502. On the other hand, if it is judged in S1207 (see FIG. 12) that the recording medium does not have a frame line, the judgment in S1501 is NO, and the preparation unit 1101 advances the process to S1506. Also, if it is judged in S1204 (see FIG. 12) or in S1206 (see FIG. 12), the judgment in S1501 is NO, and the preparation unit 1101 advances the process to S1506.

[0139] In S1502, the preparation unit 1101 acquires a detection level Lf corresponding to the frame line 501. In the example of FIG. 13, the level of the sample Sr is acquired. Here, it is preferable to adopt the lowest level between the first scan and the second scan. Note that, if there are multiple frame lines on the recording medium, a detection level corresponding to each frame line is acquired, and the lowest detection level among them is adopted. The same applies to other embodiments.

[0140] In S1503, the preparation unit 1101 acquires a detection level Lp corresponding to the platen 209. In the example of Fig. 13, the level of the sample Sv is acquired.

[0141] In S1504, the preparation unit 1101 calculates a changed threshold level TH'. Specifically, the preparation unit 1101 calculates the average value of the detection level Lf and the detection level Lp as the changed threshold level TH'. TH´=(Lf+Lp) / 2

[0142] However, the preparation unit 1101 may calculate a weighted average of the detection levels Lf and Lp as the changed threshold level TH'. TH´=(Lf·α+Lp·(1-α)) / 2 Where: 0<α<1

[0143] In S1505, the preparation unit 1101 sets TH' calculated in S1504 in the level change detection unit 804 as the threshold level THp to be used during printing. THp=TH´

[0144] If it is determined in S1501 that there is no frame line, the preparation unit 1101 sets the default threshold level TH as the threshold level THp to be used during printing in the level change detection unit 804 in S1506. THp=TH

[0145] FIG. 16 is a conceptual diagram for explaining the first scanning position correction amount Δx1.

[0146] When scanning is performed at a low scanning speed V0, the scanning position acquired at time t1602, which is a delay time T after time t1601 when the detection level passes through the default threshold level TH from top to bottom, is set to the end position x1602 without offset.

[0147] When scanning is performed at the scanning speed V1 during printing, the scanning position obtained at time t1604, which is the delay time T after time t1603 when the detection level passes through the changed threshold level TH' from top to bottom, is the end position x1604 with offset.

[0148] Therefore, before printing starts, the difference between the end position x1602 without offset and the end position x1604 with offset is calculated as the first scanning position correction amount Δx1, and this is used to calculate the end position without offset during printing.

[0149] The scanning position correction amount Δx1 increases as the difference between the default threshold level TH and the changed threshold level TH' increases, and the scanning position correction amount Δx1 increases as the difference between the scanning speed V0 and the scanning speed V1 increases.

[0150] FIG. 17 is a conceptual diagram for explaining the second scanning position correction amount Δx2.

[0151] When scanning is performed at a low scanning speed V0, the scanning position acquired at time t1702, which is a delay time T after time t1701 when the detection level passes through the default threshold level TH from top to bottom, is set to the end position x1702 without offset.

[0152] When scanning is performed at the scanning speed V1 during printing, the scanning position obtained at time t1704, which is a delay time T after time t1703 when the detection level passes through the default threshold level TH from top to bottom, is the end position x1704 with offset.

[0153] Therefore, before printing starts, the difference between the end position x1702 without offset and the end position x1704 with offset is calculated as the second scanning position correction amount Δx2, and this is used to calculate the end position without offset during printing.

[0154] FIG. 18 is a flowchart for explaining a method for determining the scanning position correction amount, that is, details of S1209.

[0155] In S1801, the preparation unit 1101 determines whether or not the changed threshold level TH' has been set as the threshold level THp during printing.

[0156] If the preparation unit 1101 sets the changed threshold level TH' as the threshold level THp during printing, the determination is YES in S1801 and the process proceeds to S1802. On the other hand, if the preparation unit 1101 does not set the changed threshold level TH' as the threshold level THp during printing, the determination is NO in S1801 and the process proceeds to S1808. Here, the case where the changed threshold level TH' is not set as the threshold level THp during printing refers to the case where the default threshold level TH is set as the threshold level THp during printing.

[0157] In S1802, the preparation unit 1101 sets the default threshold level TH in the level change detection unit 804.

[0158] In S1803, based on an instruction from the preparation unit 1101, scanning is performed at a low scanning speed V0.

[0159] In S1804, the preparation unit 1101 obtains the end position x1602 without offset.

[0160] In S 1805 , the preparation unit 1101 sets the changed threshold level TH′ in the level change detection unit 804 .

[0161] In S1806, based on an instruction from the preparation unit 1101, scanning is performed at the scanning speed V1 during printing.

[0162] In S1807, the preparation unit 1101 acquires the end position x1604 with offset.

[0163] In S1808, the preparation unit 1101 obtains the first scanning position correction amount Δx1 by the following formula. Δx1=x1604-x1602

[0164] In S1809, the preparation unit 1101 sets the default threshold level TH in the level change detection unit 804.

[0165] In S1810, based on an instruction from the preparation unit 1101, scanning is performed at a low scanning speed V0.

[0166] In S1811, the preparation unit 1101 obtains the end position x1702 without offset.

[0167] In S1812, based on an instruction from the preparation unit 1101, scanning is performed at the scanning speed V1 during printing.

[0168] In S1813, the preparation unit 1101 acquires the offset end position x1704.

[0169] In S1814, the preparation unit 1101 obtains the second scanning position correction amount Δx2 by the following formula. Δx2=x1704-x1702

[0170] The process proceeds from S1808 or S1814 to S1815. When the process proceeds from S1808 to S1815, the preparation unit 1101 sets the first scanning position correction amount Δx1 as the scanning position correction amount Δx in the terminal position determination unit 806. When the process proceeds from S1814 to S1815, the preparation unit 1101 sets the second scanning position correction amount Δx2 as the scanning position correction amount Δx in the terminal position determination unit 806.

[0171] Instead of using the method shown in FIG. 18, a table storing the amount of scanning position correction for each combination of two scanning speeds and two threshold levels may be stored in advance in ROM 306 or the like, and this table may be referenced. Here, the combination of two scanning speeds and two threshold levels is the combination (V0, V1, TH, TH') in the example of FIG. 16. In the example of FIG. 16, it is the combination (V0, V1, TH, TH). The combination (V0, V1, TH, TH') can include the combination (V0, V1, TH, TH). In contrast to this, in the example of FIG. 17, a table storing the amount of scanning position correction for each combination (V0, V1, TH) may be used.

[0172] FIG. 19 is a flowchart illustrating a method for detecting an edge position during printing.

[0173] In S1901, the level change detection unit 804 determines whether a falling edge has occurred in the detection level. The falling edge here refers to a falling edge in which the detection level passes through the threshold level THp during printing from top to bottom. Here, the default threshold level TH or an adjusted threshold level TH' is set in the level change detection unit 804 by the preparation unit 1101 before printing starts as the threshold level THp during printing.

[0174] In S1902 , the end position determination unit 806 acquires the current position of the end detection sensor 212 indicated by the scanning position signal supplied from the scanning position acquisition unit 805 .

[0175] In S1903, the end position determination unit 806 obtains the end position without offset by correcting the current position acquired in S1902 with the scanning position correction amount Δx. Note that the first scanning position correction amount Δx1 or the second scanning position correction amount Δx2 is set in the end position determination unit 806 as the scanning position correction amount Δx by the preparation unit 1101 before the start of printing.

[0176] <Fourth embodiment> In the fourth embodiment, like the third embodiment, before starting printing, it is checked whether or not a border line is present on the recording medium, and if so, the threshold level is adjusted so that the detection level corresponding to the border line does not fall below the threshold level.

[0177] The end position detection unit according to this embodiment is similar to the end position detection unit 801 according to the third embodiment shown in Fig. 11. The preparation method according to this embodiment is basically similar to the preparation method according to the third embodiment shown in Fig. 12. However, the fourth embodiment differs from the third embodiment in the method of setting the threshold level.

[0178] Fig. 20 is a flowchart showing details of the threshold level setting method (S1208) according to this embodiment. Fig. 21 is a conceptual diagram for explaining the threshold level setting according to this embodiment.

[0179] In S2001, the preparation unit 1101 judges whether or not the recording medium has a frame line. If it is judged in S1207 that the recording medium has a frame line, the judgment in S2001 becomes YES, and the preparation unit 1101 advances the process to S2002. In steps S2002 and after, the optical sensor scans the recording medium multiple times in the scanning direction at the same scanning speed as the scanning speed during operation, while changing the provisional threshold level for each scan. In this way, a detection level corresponding to the frame line when the optical sensor scans the recording medium in the scanning direction at the same scanning speed as the scanning speed during operation is obtained, and a changed threshold level TH' is calculated based on this.

[0180] On the other hand, if a NO judgment is made in S1204, if a NO judgment is made in S1206, or if a judgment is made in S1207 that the recording medium does not have a border, the judgment in S2001 becomes NO, and the preparation unit 1101 proceeds to S2009.

[0181] In S2002, the preparation unit 1101 sets a default threshold level TH as an initial value of a provisional threshold level THt (see S2002 in FIG. 21). THt=TH

[0182] In S2003, the carriage unit 201 is moved in the scanning direction under the control of the preparation unit 1101, whereby normal scanning is performed by the edge detection sensor 212 at the scanning speed during printing.

[0183] In S2004, the preparation unit 1101 determines whether or not a frame line has been detected by the normal scanning in S2003. If the detection level corresponding to the frame line is lower than the provisional threshold level THt at that time when the normal scanning is performed in S2003, the frame line is detected.

[0184] If a frame line is detected, the preparation unit 1101 makes a YES determination in S2004 and advances the process to S2005.

[0185] In S2005, the preparation unit 1101 reduces the provisional threshold level THt by ΔTH (see S2005 in FIG. 21 ), THt = THt - ΔTH The process returns to S2003.

[0186] If a frame line is not detected in the normal scanning in S2003, the preparation unit 1101 makes a NO determination in S2004 and advances the process to S2006.

[0187] In S2006, the preparation unit 1101 obtains the detection level Lp corresponding to the platen 209 (see S2006 in FIG. 21).

[0188] In S2007, the preparation unit 1101 obtains the changed threshold level TH' by the following formula (see S2007 in FIG. 21). TH´=(THt+Lp) / 2

[0189] However, the preparation unit 1101 may calculate the weighted average of the provisional threshold level THt and the detection level Lp as the changed threshold level TH'. TH´=(THt·α+Lp·(1-α)) / 2 Where: 0<α<1

[0190] If S2004 does not result in YES even once, the initial value of the temporary threshold level THt set in S2002 is used as is to obtain the changed threshold level TH'. If S2004 results in YES only once, the level obtained by subtracting ΔTH only once from the initial value of the temporary threshold level THt set in S2002 is used to obtain the changed threshold level TH'. If S2004 results in YES n times, the level obtained by subtracting ΔTH stepwise n times from the initial value of the temporary threshold level THt set in S2002 is used to obtain the changed threshold level TH'.

[0191] In S2008, the preparation unit 1101 sets TH' obtained in S2007 in the level change detection unit 804 as the threshold level THp to be used during printing. THp=TH´

[0192] If it is determined in S2001 that there is no frame line, the preparation unit 1101 sets the default threshold level TH as the threshold level THp to be used during printing in the level change detection unit 804 in S2009. THp=TH

[0193] 21 shows the modified threshold level TH' obtained in the third embodiment for reference. The modified threshold level TH' obtained in the third embodiment is as shown by the reference symbol 2101. The modified threshold level TH' obtained in the third embodiment is the average value of a level 2103 near the deepest level of the frame line sampled from a detection level 2102 formed when scanning is performed at a scanning speed V0 and a detection level Lp of the platen.

[0194] In contrast, the changed threshold level TH' obtained in this embodiment is as shown by the reference symbol 2104. The changed threshold level TH' obtained in this embodiment is the average value of the detection level Lp of the level platen, which is slightly lower than the deepest level 2106 of the detection level 2105 formed when scanning is performed at the scanning speed V1.

[0195] Therefore, in comparison with the third embodiment, according to this embodiment, it is possible to set a higher modified threshold level TH'. In particular, it is possible to set a substantially maximum modified threshold level TH' while satisfying the condition that frame lines are not detected during scanning during printing.

[0196] In some configurations, when the threshold level is lowered, it becomes necessary to increase the amplification degree of the amplifier that amplifies the signal obtained by photoelectric conversion to generate the detection level. If the amplifier is located at the middle stage or later and noise is mixed in at the input section of the amplifier, the mixed noise will be greatly amplified as the amplification degree increases, and there is a possibility that the detection accuracy of the edge position will decrease. In this embodiment, it is possible to suppress such a decrease in the detection accuracy of the edge position.

[0197] It is preferable that the scanning speed in S2003 is the same as the scanning speed during printing, but this is not essential. For example, the scanning speed in S2003 may be set to a speed several percent to several tens of percent lower than the scanning speed during printing.

[0198] In addition, in S2002, the preparation unit 1101 may set a level higher than the default threshold level TH as the initial value of the provisional threshold level THt. However, even in this case, the provisional threshold level THt when the result of S2004 is NO is the same as when the default threshold level TH is set as the initial value of the provisional threshold level THt.

[0199] Furthermore, in the above method, the provisional threshold level is gradually lowered, but conversely, the provisional threshold level may be gradually raised from a low level. For example, a detection level Lf corresponding to the frame line 501 acquired in S1502 based on, for example, a low-speed first or second scan is set as the initial value of the provisional threshold level. After that, scanning at the scanning speed during printing is repeated while gradually raising the provisional threshold level. If a provisional threshold level that detects the frame line can be found in a certain scan, the provisional threshold level one step before is set as the changed threshold level TH', and this is set as the threshold level THp during printing.

[0200] Furthermore, a threshold level slightly below the detection level Lf may be found using the principle of a successive conversion type A / D converter, and this may be set as the changed threshold level TH' and as the threshold level THp during printing.

[0201] <Fifth embodiment> In the third and fourth embodiments, the end position of the recording medium is detected by the method described with reference to Fig. 19. However, this is not limited to the above, and the third and fourth embodiments may be modified so as to detect the end position of the recording medium by the method according to the first or second embodiment, rather than the method described with reference to Fig. 19. In this case, the threshold level THp during printing according to the third and fourth embodiments is used as the first threshold level TH1 in the first or second embodiment.

[0202] Sixth embodiment The sixth embodiment can be constructed based on the third to fifth embodiments by applying the same modifications as those made when constructing the second embodiment based on the first embodiment.

[0203] <Other embodiments> In the above embodiment, the case where the stronger the light received by the light receiving element 404, the higher the voltage of the detection signal is explained as an example. However, this is not limited to the above, and even if the stronger the light received by the light receiving element 404, the lower the voltage of the detection signal is, the end position of the recording medium can be detected by the same principle. In other words, by inverting the magnitude relationship of the threshold level so as to correspond to the waveforms obtained by inverting the waveforms in Figures 6 and 7, the end position of the recording medium can be detected by the same principle. Also, the threshold level may be set so as to correspond to the waveforms obtained by inverting the waveforms in Figures 13, 14, 16, 17, and 21.

[0204] In the above embodiment, the case where the intensity of light received by the light receiving element 404 is indicated by a voltage has been described as an example. However, this is not limited to the above, and the intensity of light received by the light receiving element 404 may be indicated by a current. In this case, the value of the current corresponds to the detection level. For example, the current of the detection signal may be increased as the intensity of the light received by the light receiving element 404 increases, or vice versa.

[0205] In the above embodiment, an example has been described in which the edge detection sensor 212 scans the recording medium 200 or the platen 209 along the main scanning direction or the sub-scanning direction. However, this is not the only case, and even if the edge detection sensor 212 scans the recording medium 200 or the platen 209 along a direction that has a predetermined angle in a plan view with respect to the main scanning direction, the end position of the recording medium can be detected using a similar principle.

[0206] In the above embodiment, the edge detection sensor 212 has been described as including the light emitting element 403 and the light receiving element 404. However, this is not a limitation, and the light emitting element 403 may be omitted. In this case, the light receiving element 404 receives light that is reflected by the recording medium 200 or the platen 209 and enters the light receiving element 404 out of the light that is incident on the recording medium 200 or the platen 209 from the outside.

[0207] In the above embodiment, an example has been described in which the upstream end and downstream end in the scanning direction and the upstream end and downstream end in the sub-scanning direction are all detected using an end position detection unit 801 having a configuration as shown in Fig. 8 or 11. However, this is not limited to the above, and the upstream end and downstream end in the scanning direction and parts of the upstream end and downstream end in the sub-scanning direction may be detected by an end position detection unit having a different configuration.

[0208] In the above embodiment, an example has been described in which an image forming apparatus detects the end position of a recording medium during printing. However, this is not limited to the above, and the above embodiment can be applied to a case in which an image forming apparatus detects the end position of a recording medium during the operation of another function. The above embodiment can also be applied to a case in which a device other than an image forming apparatus detects the end position of a recording medium. The above embodiment can also be applied to a case in which an end position of another object is detected instead of the end position of a recording medium. For example, the above embodiment can be applied to a case in which an image reading device detects the end position of a reading target.

[0209] The above-mentioned embodiment can also be realized by executing the following process. That is, software (programs) that realize the functions of the above-mentioned embodiment are supplied to a system or device via a network or various storage media, and a computer (CPU, MPU, etc.) of the system or device reads and executes the program. The program may be executed by one computer, or may be executed by multiple computers in cooperation with each other. It is not necessary to realize all of the above-mentioned processes by software, and some or all of the processes may be realized by hardware such as ASIC. The CPU is not limited to one that performs all the processes by one CPU, and multiple CPUs may perform processes while appropriately coordinating with each other. The functions of the above-mentioned embodiment are not only realized by executing the program code read by the computer. It also includes a case where an OS running on a computer performs some or all of the actual processes based on the instructions of the program code, and the functions of the above-mentioned embodiment are realized by the processes.

[0210] <Technical Features of the Present Disclosure> The present disclosure includes the following configurations, programs, and methods.

[0211] [Configuration 1] A detection device that detects an end position of a recording medium placed on a portion of a holding member, a detection means for detecting a change in a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member in a scanning direction, the change being from a level corresponding to the recording medium to a level corresponding to the holding member, by comparing the detection level with a first threshold level; a first determination means for determining, when the detection level is between a second threshold level and a level corresponding to the holding member when a delay time has elapsed in scanning in the scanning direction from when the detection means detects the change, the position of the optical sensor at the time when the detection means detects the change as a reference, as a candidate for the end position; a second determination means for determining the candidate as the end position when the detection level is between a third threshold level and a level corresponding to the holding member at a position away from the candidate position in the scanning direction by a threshold distance; A detection device comprising:

[0212] [Configuration 2] the time when the detection means detects the change is taken as a reference time, the time being between the time when the detection means detects the change and the time when the delay time has elapsed since the detection means detected the change; 2. The detection device according to claim 1.

[0213] [Configuration 3] a means for periodically acquiring the detection level to acquire the detection level at a position that is farther away from the candidate position in the scanning direction than the threshold distance, 3. A detection device according to configuration 1 or 2.

[0214] [Configuration 4] the delay time is a time required from when the detection means detects the change to when the detection level is acquired; A detection device according to any one of configurations 1 to 3.

[0215] [Configuration 5] The threshold distance has a length equal to or greater than the width of a frame line disposed on the recording medium. A detection device according to any one of configurations 1 to 4.

[0216] [Configuration 6] the first threshold level to the third threshold level are set between a level corresponding to the recording medium and a level corresponding to the holding member; A detection device according to any one of configurations 1 to 5.

[0217] [Configuration 7] 7. The detection apparatus of claim 6, wherein the second threshold level is between the first threshold level and a level corresponding to the recording medium.

[0218] [Configuration 8] the second threshold level has a difference from the first threshold level according to an estimate of a level of noise superimposed on the signal indicating the detection level; 8. The detection device according to configuration 7.

[0219] [Configuration 9] The second threshold level has a difference from the first threshold level according to the length of the delay time. A detection device according to configuration 7 or 8.

[0220] [Configuration 10] 7. The detection apparatus of claim 6, wherein the second threshold level is the same as the first threshold level.

[0221] [Configuration 11] 11. The detection apparatus of any one of configurations 6 to 10, wherein the third threshold level is the same as the second threshold level.

[0222] [Configuration 12] 11. The detection device of any one of configurations 6 to 10, wherein the third threshold level is different from the second threshold level.

[0223] [Configuration 13] The optical sensor; a means for causing the optical sensor to scan the recording medium and the holding member in sequence; Further comprising: A detection device according to any one of configurations 1 to 12.

[0224] [Configuration 14] detects at least one of an upstream end position in a main scanning direction of the recording medium, a downstream end position in the main scanning direction of the recording medium, an upstream end position in a sub-scanning direction of the recording medium, and a downstream end position in the sub-scanning direction of the recording medium as an end position of the recording medium; 14. A detection device according to any one of configurations 1 to 13.

[0225] [Configuration 15] a first detection device that detects an upstream end position of the recording medium in a main scanning direction; a second detection device that detects a downstream end position of the recording medium in a main scanning direction; Equipped with At least one of the first detection device and the second detection device is the detection device according to any one of configurations 1 to 13. Device.

[0226] [Configuration 16] a third detection device that detects an upstream end position of the recording medium in a sub-scanning direction; a fourth detection device that detects a downstream end position of the recording medium in the sub-scanning direction; Equipped with At least one of the third detection device and the fourth detection device is the detection device according to any one of configurations 1 to 13. Device.

[0227] [Configuration 17] A detection device according to any one of configurations 1 to 13, which detects an upstream end position of the roll-shaped recording medium in a sub-scanning direction; a means for determining a conveying position when the recording medium is cut, based on at least a conveying position when the upstream end position detected by the detection device coincides with a predetermined reference position and a desired length of the recording medium along the sub-scanning direction; An apparatus comprising:

[0228] [Configuration 18] A detection device according to any one of configurations 1 to 13, An image forming controller; a recording head that performs recording on the recording medium based on data supplied from the image forming controller; An image forming apparatus comprising:

[0229] [Program 1] A program for causing a computer to function as a detection device for detecting an end position of a recording medium placed on a part of a holding member, the program comprising: a detection means for detecting a change in a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member in a scanning direction, the change being from a level corresponding to the recording medium to a level corresponding to the holding member, by comparing the detection level with a first threshold level; a first determination means for determining, when the detection level is between a second threshold level and a level corresponding to the holding member when a delay time has elapsed in scanning in the scanning direction from when the detection means detects the change, the position of the optical sensor at the time when the detection means detects the change as a reference, as a candidate for the end position; a second determination means for determining the candidate as the end position when the detection level is between a third threshold level and a level corresponding to the holding member at a position away from the candidate position in the scanning direction by a threshold distance; A program that makes a computer function as a

[0230] [Method 1] A method for detecting an end position of a recording medium placed on a portion of a holding member, comprising the steps of: a detection step of detecting a change in a detection level corresponding to an intensity of light detected by an optical sensor that scans the recording medium or the holding member in a scanning direction, the change being from a level corresponding to the recording medium to a level corresponding to the holding member, by comparing the detection level with a first threshold level; a first determination step of determining, when the detection level is between a second threshold level and a level corresponding to the holding member when a delay time has elapsed in scanning in the scanning direction from when the change is detected by the detection step, the position of the optical sensor at the time when the change is detected by the detection step as a reference as a candidate for the end position; a second determination step of determining the candidate as the end position when the detection level is between a third threshold level and a level corresponding to the holding member at a position away from the candidate position in the scanning direction by a threshold distance; The detection method includes the steps of:

[0231] [Configuration 19] A preparation device for preparing to detect an end position of a recording medium placed on a portion of a holding member, comprising: an input means for inputting a signal indicating a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member along a scanning direction; a determination means for determining whether or not a frame line is present on the recording medium based on whether or not a time occurs during a period in which the optical sensor scans the recording medium along the scanning direction, when the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member; and a setting means for setting a threshold level used for detecting the end position during operation, when the discrimination means discriminates that the recording medium has a frame line, to a level between the detection level corresponding to the frame line and the detection level corresponding to the holding member; Equipped with Preparation equipment.

[0232] [Configuration 20] the detection level corresponding to the frame line is the detection level corresponding to the frame line acquired when the discrimination means executes scanning by the optical sensor to discriminate whether or not a frame line exists on the recording medium; 20. The preparation apparatus of claim 19.

[0233] [Configuration 21] The detection level corresponding to the frame line is the detection level corresponding to the frame line when the optical sensor scans the recording medium along the scanning direction at the same scanning speed as the scanning speed during operation. 20. The preparation apparatus of claim 19.

[0234] [Configuration 22] and a means for acquiring the detection level corresponding to the frame line when the optical sensor scans the recording medium along the scanning direction at the same scanning speed as the scanning speed during operation by causing the optical sensor to scan the recording medium along the scanning direction a plurality of times at the same scanning speed as the scanning speed during operation while changing a temporary threshold level for each scan. 22. The preparation apparatus of claim 21.

[0235] [Configuration 23] a means for calculating a scanning position correction amount for correcting the edge position detected by comparing the detection level obtained by scanning at a scanning speed during operation with the threshold level set by the setting means, the threshold level being used to detect the edge position during operation, by comparing the detection level obtained by scanning at a scanning speed slower than the scanning speed during operation with a default threshold level; A preparation device according to any one of configurations 19 to 22.

[0236] [Configuration 24] the setting means sets a default threshold level as a threshold level used for detecting the edge position during operation when the determining means determines that the frame line does not exist on the recording medium. A preparation device according to any one of configurations 19 to 23.

[0237] [Configuration 25] a means for calculating a scanning position correction amount for correcting the edge position detected by comparing the detection level obtained by scanning at a scanning speed during operation with the threshold level set by the setting means, the threshold level being used to detect the edge position during operation, by comparing the detection level obtained by scanning at a scanning speed slower than the scanning speed during operation with a default threshold level; 25. The preparation apparatus of claim 24.

[0238] [Configuration 26] The threshold level used to detect the end position during operation, the threshold level set by the setting means, when the discrimination means discriminates that the frame line is present on the recording medium, the level is between the detection level corresponding to the frame line and the detection level corresponding to the holding member, When the determining means determines that the frame line does not exist on the recording medium, the threshold level is a default. 26. The preparation apparatus of claim 25.

[0239] [Configuration 27] the discrimination means discriminates whether or not a frame line is present on the recording medium based on the positions of one or more frame line candidates obtained by scanning the recording medium or the holding member along the scanning direction with the optical sensor at a first position in the direction intersecting the scanning direction, and the positions of one or more frame line candidates obtained by scanning the recording medium or the holding member along the scanning direction with the optical sensor at a second position in the direction intersecting the scanning direction. A preparation device according to any one of configurations 19 to 26.

[0240] [Configuration 28] The default threshold level is set between a detection level corresponding to the recording medium and a detection level corresponding to the holding member. A preparation device according to any one of configurations 19 to 27.

[0241] [Configuration 29] the discrimination means discriminates whether or not a frame line is present on the recording medium based on whether or not a time occurs in which the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member during a period in which the optical sensor scans the recording medium along the scanning direction at a scanning speed slower than a scanning speed during operation. A preparation device according to any one of configurations 19 to 28.

[0242] [Configuration 30] A preparation device according to any one of configurations 19 to 29; An image forming controller; a recording head that performs recording on the recording medium based on data supplied from the image forming controller; An image forming apparatus comprising:

[0243] [Program 2] A program for causing a computer to function as a preparation device for preparing to detect an end position of a recording medium placed on a part of a holding member, the program comprising: an input means for inputting a signal indicating a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member along a scanning direction; a determination means for determining whether or not a frame line is present on the recording medium based on whether or not a time occurs during a period in which the optical sensor scans the recording medium along the scanning direction, when the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member; and a setting means for setting a threshold level used for detecting the end position during operation, when the discrimination means discriminates that the recording medium has a frame line, to a level between the detection level corresponding to the frame line and the detection level corresponding to the holding member; A program that makes a computer function as a

[0244] [Method 2] 1. A method for preparing to detect an edge position of a recording medium placed on a portion of a holding member, comprising: an input step of inputting a signal indicating a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member along a scanning direction; a determining step of determining whether or not a frame line is present on the recording medium based on whether or not a time occurs during a period in which the optical sensor scans the recording medium along the scanning direction, when the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member; a setting step of setting a level between the detection level corresponding to the frame line and the detection level corresponding to the holding member as a threshold level used for detecting the end position during operation when it is determined in the determining step that the frame line exists on the recording medium; having How to prepare.

Claims

1. A detection device that detects an end position of a recording medium placed on a portion of a holding member, a detection means for detecting a change in a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member in a scanning direction, the change being from a level corresponding to the recording medium to a level corresponding to the holding member, by comparing the detection level with a first threshold level; a first determination means for determining, when the detection level is between a second threshold level and a level corresponding to the holding member when a delay time has elapsed in scanning in the scanning direction from when the detection means detects the change, the position of the optical sensor at the time when the detection means detects the change as a reference, as a candidate for the end position; a second determination means for determining, when the detection level is between a third threshold level and a level corresponding to the holding member at a position away from the position of the candidate in the scanning direction by a threshold distance or more, that the candidate is determined to be the end position; A detection device comprising:

2. the time when the detection means detects the change is taken as a reference time, the time being between the time when the detection means detects the change and the time when the delay time has elapsed since the detection means detected the change; The detection device of claim 1 .

3. a means for periodically acquiring the detection level to acquire the detection level at a position that is farther away from the candidate position in the scanning direction than the threshold distance, The detection device of claim 1 .

4. the delay time is a time required from when the detection means detects the change to when the detection level is acquired; The detection device of claim 1 .

5. The threshold distance has a length equal to or greater than the width of a frame line disposed on the recording medium. The detection device of claim 1 .

6. the first threshold level to the third threshold level are set between a level corresponding to the recording medium and a level corresponding to the holding member, The detection device of claim 1 .

7. 7. The sensing device of claim 6, wherein the second threshold level is between the first threshold level and a level corresponding to the recording medium.

8. the second threshold level has a difference from the first threshold level according to an estimate of a level of noise superimposed on the signal indicating the detection level; The detection device of claim 7.

9. The second threshold level has a difference from the first threshold level according to the length of the delay time. The detection device of claim 7.

10. 7. The sensing device of claim 6, wherein the second threshold level is the same as the first threshold level.

11. 7. The sensing device of claim 6, wherein the third threshold level is the same as the second threshold level.

12. The sensing device of claim 6 , wherein the third threshold level is different from the second threshold level.

13. The optical sensor; a means for causing the optical sensor to scan the recording medium and the holding member in sequence; Further comprising: The detection device of claim 1 .

14. detects at least one of an upstream end position in a main scanning direction of the recording medium, a downstream end position in the main scanning direction of the recording medium, an upstream end position in a sub-scanning direction of the recording medium, and a downstream end position in the sub-scanning direction of the recording medium as an end position of the recording medium; Detecting device according to any one of claims 1 to 13.

15. a first detection device that detects an upstream end position of the recording medium in a main scanning direction; a second detection device that detects a downstream end position of the recording medium in a main scanning direction; Equipped with At least one of the first detection device and the second detection device is a detection device according to any one of claims 1 to 13. Device.

16. a third detection device that detects an upstream end position of the recording medium in a sub-scanning direction; a fourth detection device that detects a downstream end position of the recording medium in a sub-scanning direction; Equipped with At least one of the third detection device and the fourth detection device is the detection device according to any one of claims 1 to 13. Device.

17. The detection device according to claim 1 , which detects an upstream end position of the roll-shaped recording medium in a sub-scanning direction; a means for determining a conveying position when the recording medium is cut, based on at least a conveying position when the upstream end position detected by the detection device coincides with a predetermined reference position and a desired length of the recording medium along the sub-scanning direction; An apparatus comprising:

18. A detection device according to any one of claims 1 to 13; An image forming controller; a recording head that performs recording on the recording medium based on data supplied from the image forming controller; An image forming apparatus comprising:

19. A program for causing a computer to function as a detection device for detecting an end position of a recording medium placed on a part of a holding member, the program comprising: a detection means for detecting a change in a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member in a scanning direction, the change being from a level corresponding to the recording medium to a level corresponding to the holding member, by comparing the detection level with a first threshold level; a first determination means for determining, when the detection level is between a second threshold level and a level corresponding to the holding member when a delay time has elapsed in scanning in the scanning direction from when the detection means detects the change, the position of the optical sensor at the time when the detection means detects the change as a reference, as a candidate for the end position; a second determination means for determining, when the detection level is between a third threshold level and a level corresponding to the holding member at a position away from the position of the candidate in the scanning direction by a threshold distance or more, that the candidate is determined to be the end position; A program that makes a computer function as a

20. A method for detecting an end position of a recording medium placed on a portion of a holding member, comprising the steps of: a detection step of detecting a change in a detection level corresponding to an intensity of light detected by an optical sensor scanning the recording medium or the holding member in a scanning direction, the change being from a level corresponding to the recording medium to a level corresponding to the holding member, by comparing the detection level with a first threshold level; a first determination step of determining, when a delay time has elapsed in scanning in the scanning direction from when the change is detected by the detection step and the detection level is between a second threshold level and a level corresponding to the holding member, a position of the optical sensor at a time when the change is detected by the detection step as a reference, as a candidate for the end position; a second determination step of determining the candidate as the end position when the detection level is between a third threshold level and a level corresponding to the holding member at a position away from the candidate position in the scanning direction by a threshold distance; The detection method includes the steps of:

21. A preparation device for preparing to detect an end position of a recording medium placed on a portion of a holding member, comprising: an input means for inputting a signal indicating a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member along a scanning direction; a determination means for determining whether or not a frame line is present on the recording medium based on whether or not a time occurs during a period in which the optical sensor scans the recording medium along the scanning direction, when the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member; and a setting means for setting a threshold level used for detecting the end position during operation, when the discrimination means discriminates that the recording medium has a frame line, to a level between the detection level corresponding to the frame line and the detection level corresponding to the holding member; Equipped with Preparation equipment.

22. the detection level corresponding to the frame line is the detection level corresponding to the frame line acquired when the discrimination means executes scanning by the optical sensor to discriminate whether or not a frame line exists on the recording medium; 22. The preparation apparatus of claim 21.

23. The detection level corresponding to the frame line is the detection level corresponding to the frame line when the optical sensor scans the recording medium along the scanning direction at the same scanning speed as the scanning speed during operation.

22. The preparation apparatus of claim 21.

24. and a means for acquiring the detection level corresponding to the frame line when the optical sensor scans the recording medium along the scanning direction at the same scanning speed as the scanning speed during operation by causing the optical sensor to scan the recording medium along the scanning direction a plurality of times at the same scanning speed as the scanning speed during operation while changing a temporary threshold level for each scan.

24. The preparation apparatus of claim 23.

25. a means for calculating a scanning position correction amount for correcting the edge position detected by comparing the detection level obtained by scanning at a scanning speed during operation with the threshold level set by the setting means, the threshold level being used to detect the edge position during operation, by comparing the detection level obtained by scanning at a scanning speed slower than the scanning speed during operation with a default threshold level; 22. The preparation apparatus of claim 21.

26. the setting means sets a default threshold level as a threshold level used for detecting the edge position during operation when the determining means determines that the frame line does not exist on the recording medium.

22. The preparation apparatus of claim 21.

27. a means for calculating a scanning position correction amount for correcting the edge position detected by comparing the detection level obtained by scanning at a scanning speed during operation with the threshold level set by the setting means, the threshold level being used to detect the edge position during operation, by comparing the detection level obtained by scanning at a scanning speed slower than the scanning speed during operation with a default threshold level; 27. The preparation apparatus of claim 26.

28. The threshold level used to detect the end position during operation, the threshold level set by the setting means, when the discrimination means discriminates that the frame line is present on the recording medium, the level is between the detection level corresponding to the frame line and the detection level corresponding to the holding member, When the determination means determines that the frame line does not exist on the recording medium, the threshold level is a default.

28. The preparation apparatus of claim 27.

29. the discrimination means discriminates whether or not a frame line is present on the recording medium based on the positions of one or more frame line candidates obtained by scanning the recording medium or the holding member along the scanning direction with the optical sensor at a first position in the direction intersecting the scanning direction, and the positions of one or more frame line candidates obtained by scanning the recording medium or the holding member along the scanning direction with the optical sensor at a second position in the direction intersecting the scanning direction.

22. The preparation apparatus of claim 21.

30. The default threshold level is set between a detection level corresponding to the recording medium and a detection level corresponding to the holding member.

22. The preparation apparatus of claim 21.

31. the discrimination means discriminates whether or not a frame line is present on the recording medium based on whether or not a time occurs in which the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member during a period in which the optical sensor scans the recording medium along the scanning direction at a scanning speed slower than a scanning speed during operation.

22. The preparation apparatus of claim 21.

32. A preparation device according to any one of claims 21 to 31; An image forming controller; a recording head that performs recording on the recording medium based on data supplied from the image forming controller; An image forming apparatus comprising:

33. A program for causing a computer to function as a preparation device for preparing to detect an end position of a recording medium placed on a part of a holding member, the program comprising: an input means for inputting a signal indicating a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member along a scanning direction; a determination means for determining whether or not a frame line is present on the recording medium based on whether or not a time occurs during a period in which the optical sensor scans the recording medium along the scanning direction, when the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member; and a setting means for setting a threshold level used for detecting the end position during operation, when the discrimination means discriminates that the recording medium has a frame line, to a level between the detection level corresponding to the frame line and the detection level corresponding to the holding member; A program that makes a computer function as a

34. 1. A method for preparing to detect an edge position of a recording medium placed on a portion of a holding member, comprising the steps of: an input step of inputting a signal indicating a detection level corresponding to the intensity of light detected by an optical sensor that scans the recording medium or the holding member along a scanning direction; a determining step of determining whether or not a frame line is present on the recording medium based on whether or not a time occurs during a period in which the optical sensor scans the recording medium along the scanning direction, when the detection level becomes a level between a default threshold level and the detection level corresponding to the holding member; a setting step of setting a level between the detection level corresponding to the frame line and the detection level corresponding to the holding member as a threshold level used for detecting the end position during operation when it is determined in the determining step that the frame line exists on the recording medium; having How to prepare.

Citation Information

Patent Citations

  • Recorder

    JP1995179248A