APPARATUS FOR INDEXING AN ORIGIN OF A MOVING MEMBER

Abstract: Disclosed herein is an origin indexing apparatus applicable to a printer. A moving member, such as a printing head (38) mounted on a carriage (36), is moved by a step motor (83) which rotates in stepwise by sequentially changing excited phase of a predetermined number K. An initially set origin (P7) of such a moving member is exactly indexed or identified in later origin indexing operation according to the relationship between a phase difference between excited phases of the step motor at the time of initial setting of the origin and the origin indexing operation and the number of phases K of the pulse motor.

Description: BACKGROUND OF THE INVENTION The present invention relates to an apparatus for indexing the origin of a moving member to be driven with a pulse motor. This apparatus is applicable to the indexing of the origin of a carriage on a printer or typewriter. The position of carriages on some of the conventional printers and typewriters is controlled incrementally by open-loop control using a pulse motor. In this incremental position control system, the origin of the carriage must be set in order to know its present position. To this effect, the arrival of the carriage at a predetermined position on the path of its movement is detected with the combination of a contactor and a limit switch or of a light-shielding element and a photointerrupter which are provided at said predetermined position and on the carriage. When the detector consisting of a light-shielding element and a photointerrupter (or a contactor and a limit switch) outputs an origin signal, the position of the carriage at that time is indexed as the origin of the carriage. The above described detector depends on a mechanical contactor for detecting the position of the moving carriage as relative to the fixed frame, so in the face of temperature changes or mechanical vibrations, the subtle relationship between the excitation phases of a pulse motor and the timing of detection of an origin signal will vary and in each origin indexing operation, the excitation phase of the pulse motor, or its rotational angle, occurring at the time when the origin signal is detected varies and fails to attain a constant value. In order to solve these problems and to ensure more precise origin indexing by matching the origin to the excitation phase at all times of origin indexing operations, a method depending on the principle depicted in Fig. 5(a) has been proposed (US-A-4394696). In this method, a four-phase excitation pulse motor is allowed to rotate counterclockwise toward the origin until an origin signal is produced, and thereafter, the motor is rotated with excitation being performed up to the first specified phase, say, phase D, and a position P7 corresponding to said specified excitation phase D is indexed as the origin. As already pointed out, the relationship between the origin signal as an output from the detector and the excitation phase is subject to change on account of temperature changes or mechanical vibrations. Therefore, depending upon the timing of origin signal detection with respect to the specified excitation phase D which corresponds to the origin P7, the origin indexing position determined by the system described above might shift by one cycle of excitation, i.e. by four steps, either leftward or rightward with respect to the origin P7, leading to erroneous indexing of position P3 or P11 as the origin. For instance, if position P7 is assumed to be the true origin in Fig 5(a), it can be correctly indexed if the origin signal is detected within the range leftward of position P11 and rightward of position P7. On the other hand, if the origin signal is detected within the range leftward of position P7 and rightward of position P3, the latter position P3 is indexed as the origin, which is deviated by 4 steps leftward of the true origin P7. This means that if the timing of origin signal detection in the vicinity of position P7 changes even slightly to the left of position P7, an error of 4 steps can occur in the precision of origin indexing. The true origin P7 can also be indexed if the origin signal is detected within the range leftward of position P11 and rightward of position P7. However, if the origin signal is detected within the range leftward of position P15 and rightward of position P11, the latter position P11 is indexed as the origin, which is deviated by 4 steps rightward of the true origin P7. This means that if the timing of original signal detection in the vicinity of position P11 changes even slightly to the right of position P11, an error of 4 steps can occur in the precision of origin indexing. As described above, the prior art methods of origin indexing have had the disadvantage of low precision of indexing operations that result from the instability in the origin indexing position. SUMMARY OF THE INVENTION The present invention has been accomplished in order to solve the aforementioned problems of the prior art. Accordingly, an object of the present invention is to improve the precision of indexing the origin of a moving member to be driven with a pulse motor. Generally, the above-stated object of the present invention is attained by an origin indexing apparatus having the composition shown in Fig. 1. This apparatus comprises a detector that outputs an origin signal when a moving member to be controlled has reached a predetermined position and a drive unit that drives a pulse motor stepwise by sequentially changing excited states of a predetermined number K. The apparatus allows the pulse motor to rotate in one direction by means of the drive unit and indexes the origin on the basis of the excited state in which an origin signal from the detector is detected. The apparatus of the present invention further includes: a first detection means that detects the excited state in which an origin signal is produced from the detector while the pulse motor is rotated in one direction; a storage means that stores as a reference excited state the excited state detected by the first detection means; a second detection means that activates the first detection means at the time of origin indexing and detects the difference in phase between an indexing excited state, which is the excited state detected by the first detection means, and the reference excited state already stored in the storage means; and an origin indexing means which, according to the relationship between the phase difference detected by the second detection means and the predetermined number K, indexes one of the following three positions as the origin, a center position satisfying a predetermined relationship with the indexing excited state, the center position minus K steps, or the center position plus K steps. While a reference value for origin indexing can be set by several methods, it is preferred to use as a reference excited state the excited state in which an origin signal is detected at the time origin indexing first effected after power is supplied to the apparatus. This reference excited state is stored in the storage unit. The excited state in which an origin signal is detected in subsequent executions of an origin indexing mode is detected as an indexing excited state. The phase difference between this indexing excited state and the reference excited state is detected and according to the relationship between the detected phase difference and the number of excited states K, one of the following three positions is indexed as the origin: a center position satisfying a predetermined relationship with the indexing excited state, the center position minus K steps, or the center position plus K steps. Since the origin is corrected by K steps with respect to the center position according to the timing of origin signal detection, erroneous origin indexing that might occur on account of the already described improper timing of origin signal detection can be prevented. BRIEF DESCRIPTION OF THE DRAWINGS In the drawings: Fig. 1 is a block diagram showing the concept of the present invention; Fig. 2 is a perspective view showing the mechanism of a typewriter furnished with origin indexing apparatus according one specific embodiment of the present invention; Fig. 3 is a block diagram showing the composition of an electronic control unit to be installed in the typewriter shown in Fig. 2; Fig. 4 is a flowchart showing the sequence of steps of processing with CPU in the electronic control unit shown in Fig. 3; and Fig. 5 is an illustration showing the procedures of origin indexing. DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described hereinafter with reference to a specific embodiment thereof. Fig. 2 is a perspective view showing the mechanism of the printing section of a typewriter. As shown, a carriage 36 supports a print head 38 for driving an impression hammer 33, a paper holder 37 for guiding the sliding or turning of paper along a platen 35, and a character wheel 39. The carriage 36 is guided with guide bars 40 and 41 and is moved horizontally by means of a timing belt 42. The timing belt 42 is driven with a pulse motor (CR motor) 83 via a pulley 43. A light shield 31 is provided on the bottom of the rear end of the carriage 36, and a photointerrupter 32 is provided in the passage of travel of the light shield 31 on the position of origin at the left end of a frame 34. When the carriage 36 moving leftward reaches the position of origin, the light shield 31 blocks photocoupling of the photointerrupter 32 and an origin signal that renders it nonconductive is produced. Fig. 3 shows an electronic control system C of the typewriter. A central processing unit (CPU) 20 is connected to a keyboard 1 via an input interface 23. CPU 20 is also connected to ROM 21, RAM 22, I/0 interfaces 24, 25, 26 and input interface 27 via an address bus, a data bus and a control bus. ROM 21 contains in it a program memory 210 with a storage of control program which, upon receiving a data input from the keyboard 1, drives the printing section for producing a printed document. RAM 22 backed up with a battery contains in it a column counter 220 for storing the present horizontal position of the carriage 36, an origin setting flag 221 for storing the execution of an origin indexing mode as the initial setting after power supply to the typewriter (this indexing is hereinafter referred to as the "initial origin indexing"), and an origin counter 222 for storing the number of steps from the position corresponding to the reference excited state in which an origin signal is detected at the time of initial origin indexing to the origin which is a position corresponding to the first ensuing specified excited state (this number of steps is hereinafter referred to as the "number of reference steps"). I/0 interfaces 24, 25 and 26 are connected to drive units 80, 82 and 84, respectively. The drive units are respectively connected to an LF motor 81 for paper feeding, a pulse motor (CR motor) 83 for moving the carriage 36, and a printing mechanism drive source 85 for causing such phenomena as the striking of the impression hammer 33, the lifting and feeding of an ink ribbon (not shown), and the rotation of the character wheel 39. The input interface 27 is connected to the photointerrupter 32 for outputting an origin signal. The mechanism of the action of the origin indexing apparatus according to the embodiment under discussion is described hereinafter with reference to the flowchart shown in Fig. 4 and the illustration given in Fig. 5. This embodiment accomplished excitation by a one-phase excitation method which sequentially excites one of the four phases A, B, C and D are shown in Fig. 5(a). If excitation proceeds in the forward order of A, B, C and D, the pulse motor 83 rotates clockwise to cause rightward movement of the carriage 36. If excitation proceeds in the reverse order of D, C, B and A, the pulse motor 83 rotates counterclockwise to cause leftward movement of the carriage 36. The phase D is assigned as the first specified excitation phase that follows the detection of an origin signal from the photointerrupter 32, and the origin corresponds to phase D excitation. Fig. 5(a) shows the relationship between the rotational positions, P0-P18, of the pulse motor 83 and the respective excitation phases. The rotational position of the pulse motor 83 is in one-to-one correspondence with the position of the carriage 36 and positions P0-P18 are also indicative of the position of the carriage 36. In the embodiment under discussion, initial origin indexing is executed in order to set the reference value for the first origin following power supply to the typewriter. (1) Initial origin indexing When power is supplied to the typewriter, the main program (not shown) is activated to instruct initial origin indexing as initial setting, whereupon the origin indexing program shown in Fig. 4 is executed. In step 100, the pulse motor 83 is rotated counterclockwise by one step and the carriage 36 is moved toward the photointerrupter 32 by one step. In the next step 102, checking is made as to whether an origin signal has been detected from the photointerrupter 32. If the result is negative, the sequence returns to step 100 and the pulse motor 83 is further rotated counterclockwise by one step and the carriage 36 is moved leftward by one more step. Processing of step 100 is repeated and the carriage 36 is moved leftward until an origin signal is detected from the photointerrupter 32 in step 102. When it is found that an origin signal has been detected in step 102, the sequence goes to step 104 and counter I which counts the number of reference steps, or the number of steps from the present excitation phase (namely, the excitation phase in which an origin signal is detected and which is hereinafter referred to as the "reference excitation phase") to the first ensuing specified excitation phase D, is initialized to zero. In the next place, the sequence goes to step 106, wherein checking is made as to whether the present excitation phase is the specified phase D. If the result is negative, the sequence goes to step 108, wherein the number of steps to the specified excitation phase D which appears the first time after excitation in the reverse order is counted and stored in counter I. If the present excitation phase is found to be phase D in step 106, or if the counting of the number of steps is completed in step 108, the sequence goes to step 112 in which checking is made as to whether the origin setting flag 221 which indicates the completion of the initial origin indexing has been set to ON state. The origin setting flag 221 is reset by initialization of the main program at the time power is supplied to the typewriter. Therefore, at the time of initial origin indexing, the origin setting flag 221 is found to be in OFF state and the sequence goes to step 113, wherein reverse excitation is effected by I steps and the motor is rotated counterclockwise by I steps to bring the carriage 36 to a position corresponding to the first ensuing specified excitation phase D. In the next step 114, counter I in the present state shows the number of reference steps, which is stored in the origin counter 222. In the next step 116, the origin setting flag 221 which indicates the completion of initial origin indexing is set to ON state, and in subsequent step 118 the column counter 220 is cleared to zero. The position of carriage 36 corresponding to the present specified excitation phase D is initially indexed as the origin. As a result, the program under discussion is completed. As shown in Fig. 5(b), when an origin signal is detected at rotational position P8 following excitation of phase A, rotational position P7 corresponding to subsequently specified excitation phase D is initially indexed as the origin. The number of reference steps for this case is one. In a like manner, as shown in Fig. 5(c), when an origin signal is detected at rotational position P10 following excitation of phase C, rotational position P7 corresponding to subsequent specified excitation phase D is initially indexed as the origin. The number of reference steps for this case is three. In the way described above, the origin is initially indexed at rotational position P7 as the reference value for origin indexing and subsequent origin indexing (the origin indexing following the initial origin indexing is hereinafter referred to as "routine origin indexing") is controlled in such a way as to ensure exact indexing of the origin P7. (2) Routine origin indexing If, after the initial origin indexing, the program for origin indexing is re-addressed in response to such events as the opening of the cover on the typewriter, processing is started with step 100. As already mentioned, the pulse motor 83 is rotated counterclockwise and the carriage 36 is moved leftward until an origin signal is detected from the photointerrupter 32. If it is found that an origin signal is detected in the next step 102, the sequence goes to step 108 through steps 104 and 106. In step 108, the number of steps from the excitation phase in which an origin signal is detected (the excitation phase in which an origin signal is detected at the time of routine origin indexing is hereinafter referred to as the "indexing excitation phase") to D phase which is the first subsequent specified excitation phase (the number of steps occurring at the time of routine origin indexing is hereinafter referred to as the "number of indexing steps") is stored in counter I. If the present excitation phase is found to be phase D in step 106, counter I counts zero and the sequence goes to step 112 wherein checking is made as to whether the origin setting flag 221 is set to ON state. In routine origin indexing, the initial origin indexing has already been completed with the origin setting flag 221 being set to ON state. Therefore, the sequence goes to step 120. In step 120, the number of reference steps is read from the origin counter 222 into a register R. In the next step 122, the difference between the number of reference steps and that of indexing steps (this difference is hereinafter referred to as "indexing deviation Δ") is computed from the contents of counter I and register R. The sequence then goes to step 124, in which checking is made as to whether the absolute value of indexing deviation Δ is smaller than half the number of excitation phases (K/2). If the result is positive, the sequence goes to step 125 and excitation is effected by I steps in the reverse order and the pulse motor is rotated counterclockwise by I steps, with the position corresponding to the specified excitation phase D being indexed as the origin. Thereafter, the sequence goes to step 118 in which the column counter 220 is cleared to zero which indicates the origin. If the absolute value of indexing deviation Δ is found to be equal to or greater than K/2 in step 124, the sequence goes to step 126, in which checking is made as to whether the indexing deviation Δ is equal to or greater than zero or whether Δ ≧ K/2 in consideration of the previous judgment made in step 124. If the result is positive, the sequence goes to step 128, in which the pulse motor 83 is excited by (4 - I) steps in the forward order to rotate clockwise by (4 - I) steps and the carriage 36 is moved rightward by (4 - I) steps. The sequence then goes to step 118, wherein the column counter 220 is cleared to zero and the present rotational position of the pulse motor 83 being excited in the specified excitation phase D is indexed as the origin. If, in step 126, the absolute value of indexing deviation Δ is found to be smaller than zero, or Δ ≦ - K/2 in consideration of the previous judgment made in step 124, the sequence goes to step 130 wherein the pulse motor 83 is excited by (4 + I) steps in the reverse order to rotate counterclockwise by (4 + I) steps and the carriage 36 is moved leftward by (4 + I) steps. The sequence then goes to step 118, in which the column counter 220 is cleared to zero and the present rotational position of the pulse motor 83 being excited in the specified excitation phase D is indexed as the origin. The present invention is further described with reference to the case shown in Fig. (5b). The relationship between the indexing excitation phase and the reference excitation phase is subject to change for various reasons but it is supposed here that the variation in the indexing excitation phase will not exceed one cycle of the reference excitation phase. If, as shown in Fig. 5(b), an origin signal is detected at position P8 during initial origin indexing and if an origin signal is detected during routine origin indexing in the region U which is leftward of position P7 and rightward of P6 within the range of one-cycle variation (P6-P10), the conventional apparatus will index the rotational position of pulse motor 83 at position P3 that corresponds to phase D which is to be excited next. In the embodiment of the present invention being discussed, counter I counts three indexing steps in step 120 and the indexing deviation computed in step 122 is 2 (since the number of reference steps is 1). Since the condition Δ ≧ K/2 (K = 4) is met, the sequence goes to step 128 in which the pulse motor 83 is excited in the forward order by (4 - I) steps in step 128 so as to rotate clockwise by (4 - I) steps and the rotational position of the pulse motor 83 is set to the origin P7 which is 4 steps rightward of position P3. Subsequently, the column counter 220 is set to zero and position P7 is indexed as the true origin that has been initially indexed. If an origin signal is detected outside the region U within the range of variation shown in Fig. 5(b), the absolute value of indexing deviation Δ will be smaller then K/2 since the number of indexing steps is 0, 1 or 2 whereas the number of reference steps is 1. Therefore, after an origin signal is detected, the pulse motor 83 is rotated counterclockwise by I steps in step 125 until position P7 that corresponds to the first subsequently excited phase D, thereby enabling the indexing of the true origin P7 that is as initially indexed. The present invention is hereunder described with reference to the case shown in Fig. 5(c). If an origin signal is detected at position P10 during initial origin indexing, the origin occurs at position P7 and the number of reference steps is 3. If an origin signal is detected during routine origin indexing in the region V which is rightward of position P11 and leftward of position P12 within the range of variation, position P11 corresponds to phase D which is the specified phase to be first excited following the detection of the origin signal and the conventional apparatus will index the rotational position of the pulse motor 83 at this position P11. In the embodiment of the present invention being discussed, the number of indexing steps counted by counter I in step 120 is 1 or 0, so the indexing deviation Δ computed in step 122 is - 2 or - 3. Since the condition Δ ≦ - K/2 is met, the results of checking made in steps 124 and 126 will be both negative and in step 130, the pulse motor 83 is excited in the reverse order by (4 + I) steps to rotate counterclockwise by (4 + I) steps and the carriage 36 moves leftward by (4 + I) steps until it stops at the point of origin P7. In step 118, the column counter 220 is set to zero and the position P7 which was initially indexed is correctly indexed as the origin for routine origin indexing mode. If an origin signal is detected outside the region V within the range of variation shown in Fig. 5(c), the absolute value of indexing deviation Δ will become smaller than K/2 since the number of indexing steps is 3 or 2 whereas the number of reference steps is 3. Therefore, after an origin signal is detected, the pulse motor 83 is rotated counterclockwise by I steps in step 125 until position P7 that corresponds to the first subsequently excited phase D is reached, thereby enabling the indexing of the true origin P7 that was initially indexed. As will be apparent from the foregoing explanation, the origin to be indexed after the initial indexing according to the present invention is in exact correspondence to the initially indexed origin irrespective of variations in the relationship between the timing of origin signal detection and excitation phases, so origin indexing can be accomplished with improved precision at all times of operation. The embodiment described above assumes that the photointerrupter 32 is positioned in such a way that a position within the range of four steps (i.e., corresponding to the total number of excitation phases) from the position at which an origin signal from the photointerrupter 32 was detected in initial origin indexing mode. Alternatively, the position of the photointerrupter 32 may be shifted in the rightward direction in such a way that origin P7 will coincide with the position to which the pulse motor 83 has rotated from the position of origin signal detection by more than four steps in the same direction in which the motor rotated until the origin signal was detected. In this alternative case, a position rightward of P7 will be indexed if origin indexing is performed in the same manner as in the already described embodiment. Therefore, the correct origin to be indexed should be shifted leftward (i.e., advanced) with respect to said rightwardly indexed position by a distance corresponding to the amount by which the photointerrupter 32 is shifted rightwardly with respect to the position at which it is disposed in the above described embodiment. If such a control is performed, the origin P7 to be indexed is always advanced with respect to the position where an origin signal from the photointerrupter 32 is detected. Therefore, during positioning of the carriage 36 at the origin P7, the carriage 36 will in no case have to be returned after detection of an origin signal in the direction opposite to that in which it has been moved and the operator may simply move it in the direction in which it has been moved for the purpose of detecting an origin signal. This is effective not only in reducing the burden on the pulse motor 83 but also in shortening the time required to complete the positioning of the carriage 36 at intended origin P7. According to the present invention, a reference excited state in which an origin signal is detected during initial indexing of the reference origin is stored, and an indexing excited state in which an origin signal is detected during execution of an origin indexing mode following the initial origin indexing is detected. The phase difference between the indexing excited state and the reference excited state is also detected, and on the basis of the relationship between the detected phase difference and the number of excited states K, one of the following three positions is indexed as the origin, a center position satisfying a predetermined relationship with the indexing excited state, the center position minus K steps, or the center position plus K steps. The present invention designed in this way has the advantage that the true origin that was initially indexed as a reference can always be indexed in subsequent routine operations in spite of variations in the relationship between the timing of origin signal detection and a specific excitation phase. As a result, the origin of a moving member to be driven with a pulse motor can be indexed with improved precision.

Claims: 1. In an origin indexing apparatus for indexing an origin of a moving member (36), including a detector (31, 32) for detecting a position of the moving member (36) and outputting an origin signal when the moving member (36) has reached a predetermined position, a multi-phase, rotatable pulse motor (83) for moving the moving member (36), said pulse motor (83) being rotated stepwise by sequentially exciting one of K phases (A, B, C, D) of the pulse motor, and a driving unit (82) for driving the pulse motor (83), wherein origin indexing of the moving member (36) is performed on the basis of an excitation phase (D) at which the origin signal from the detector (31, 32) is produced, CHARACTERIZED BY a first detection means for detecting said excitation phase (D) at which the origin signal is produced from said detector (31, 32) while said pulse motor (83) is being rotated in a predetermined direction; a storage means (22) for storing as a reference excitation phase an excitation phase (D) detected by said first detection means at a specific time instant; a second detection means for detecting a phase difference between said reference excitation phase stored in said storage means (22) and an indexing excitation phase, said indexing excitation phase being detected by said first detection means at the time of said origin indexing after said specific time instant; and an origin indexing means for indexing one of the following three positions as said origin on the basis of said phase difference and said predetermined number K: a center position corresponding to a specified excitation phase that follows said indexing excitation phase while said pulse motor (83) is being rotated in said predetermined direction, a position downstream from said center position by a distance corresponding to K phases and a position upstream from said center position by a distance corresponding to K phases of said pulse motor. 2. An origin indexing apparatus according to claim 1, wherein said first detection means detects said excitation phase as a number of steps from a first position corresponding to the excitation phase at which said origin signal is produced from said detector (31, 32) to a second position corresponding to said specified excitation phase of said pulse motor (83), said storage means (22) storing the number of steps as said reference excitation phase, and said second detection means detects said phase difference in terms of the number of steps corresponding to a difference between the number of steps detected as said indexing excitation phase by said first detection means (31, 32) and the number of steps stored in said storage means (22). 3. An origin indexing apparatus according to claim 2, wherein said origin indexing means comprises: a first origin indexing means for indexing as the origin said second position if an absolute value of the number of said steps detected by said second detection means is smaller than K/2; a second origin indexing means for indexing as the origin a position obtained by subtracting K steps from said second position if the number of said steps detected by said second detection means is equal to or greater than K/2; and a third origin indexing means for indexing as the origin a position obtained by adding K steps to said second position if the number of said steps detected by said second detection means is equal to or smaller than - K/2. 4. An origin indexing apparatus according to claim 3, wherein said moving member (36) is a printing head of a printer movable along an axial direction of a platen (35). 5. An origin indexing apparatus according to claim 1, wherein said center position corresponds to said specified excitation phase that appears for the first time subsequently to said indexing excitation phase while said pulse motor (83) is being rotated in said predetermined direction. 6. An origin indexing apparatus according to claim 1, wherein said storage means (22) stores the excitation phase detected by said first detection means (31, 32) when said origin signal is produced for the first time after initial power supply.

Inventors: FUJIWARA, TAKASHI, OHARA, KIYOTAKA
Applicants: BROTHER KOGYO KABUSHIKI KAISHA
Application year: 1988
Main classification: B41J19
IPC codes: B41J19, G05B19, G05D3