# Patent

## Title
System and method for controlling the speed of a tape drive

## Abstract

A control system and method for operating a system comprising a host computer, a buffer, a tape drive and a tape is provided. The method includes writing data to the tape while the tape is traveling at a first speed; stopping the tape; determining an optimum second speed to drive the tape to travel; and, thereafter driving the tape to travel at the second speed while writing data to the tape.

## Background
FIELD OF THE INVENTION
The present invention relates to tape drives. More particularly, the present invention relates to control of the speed of a tape drive.
BACKGROUND OF THE INVENTION
High-density recording on multiple tracks of a magnetic tape is known. In certain arrangements, parallel tracks extend along a longitudinal direction of the magnetic tape. The magnetic tape is moved transversely across a read/write head and data is recorded or read.
Many conventional tape drives are used to back up data stored on the hard disc drive of a computer system. Generally the speed at which the hard disc system can deliver data differs from the speed at which the tape drive can record data and in such cases a data buffer is used. The data is read from the hard disc drive or “host” computer and stored on the data buffer and then the data is transmitted from the data buffer to be recorded on the tape drive.
When a data buffer is used, repositions and under runs of the tape drive are important parts of the operation. They are invoked by the tape drive when the data buffer becomes empty so there is no more data to be written to the tape. At this time the tape is moving at a certain speed and must slow down and stop. Then the tape direction is reversed to cause the tape to go back some distance so that the read/write heads precede the location where writing of data was stopped. The tape then is ready to speed up in the forward direction and rewriting can be started from the last place it ended. This can be called the append process.
The reposition operation is the motion that begins at the time when the drive is slowed down to stop and the tape moves backward to reposition the magnetic head ahead of a particular position on the tape such as the last place the data was written. The time it takes from the point of start of ramp down to final rest position is defined as the reposition time. The under run operation is a combination of two physical motions, reposition followed by a ramp up motion to restart the writing process.
Commonly in conventional drive design, the reposition and under run operations are done by speed control and moving the tape back far enough during reposition so that if the drive was commanded to rewrite it has plenty distance to move during the ramp up part of the process such that it is ready to append to the data at the appropriate location on the tape.
A conventional tape drive system is shown in FIG. 1. This system comprises a tape drive 12 connected to a host computer 10 by a cable 16, and an associated tape cartridge 14. The tape drive 12 includes a receiving slot 22 into which the tape cartridge 14 is inserted. The tape cartridge 14 comprises a housing 18 containing a length of magnetic tape 20. The tape drive 12 is preferably compatible with the associated host computer, and can assume any one of a variety of cartridge or cassette linear formats.
A typical configuration of the tape drive 12 is schematically shown in FIG. 2. The tape drive 12 in FIG. 2 comprises a deck 24 including movable parts, and a control card 26 including various circuits and buses. The deck 24 includes a head assembly 28 which contacts the tape 20 of the tape cartridge inserted into the tape drive 12 to read and write data and read a servo pattern, and motors 34 and 36 for respectively rotating a supply reel 30 and a take-up reel 32. For a tape cartridge 14 of a dual reel type, both of the reels 30 and 32 are included in the tape cartridge 14. For a tape cartridge 14 of a single reel type, however, only the supply reel 30 is included in the tape cartridge 14 while the take-up reel 32 is provided in the tape drive 12. Although not shown in FIG. 2, the deck 24 additionally includes a mechanism for moving the head assembly 28 across the width of the tape 20, a mechanism for holding the inserted tape cartridge, and a mechanism for ejecting the inserted tape cartridge.
The control card 26 includes a microprocessor (MPU) 38 for the overall control of the tape drive 12; a memory 42, a servo control unit 44, a data flow unit 46 and an interface control unit 48 all of which are connected to the MPU 38 via an internal bus 40; a motor control unit 50 and a head control unit 52 which are connected to the servo control unit 44, and a data buffer 54 which is connected to the data flow unit 46. While the memory 42 is shown as a single hardware component in FIG. 2, it is actually preferably constituted by a read only memory (ROM) storing a program to be executed by the MPU 38, and a working random access memory (RAM). The servo control unit 44 manages speed control for the motors 34 and 36 and position control for the head assembly 28 by transmitting the respective control signals to the motor control unit 50 and the head control unit 52. The motor and head control units 50 and 52 respond to these control signals by physically driving the motors 34, 36 and positioning the head assembly 28, respectively.
The head assembly 28 includes servo heads which read data from servo tracks or bands on the tape 20. Control card 26 utilizes data from the servo tracks to generate a position error signal (PES), and the PES is used by the servo control unit 44 to cause the head control unit 52 to position the head assembly 28. In some conventional designs the head assembly 28 includes a voice coil motor (VCM) 56 which receives electrical signals from the head control unit 52 and positions the head assembly 28 according to the received signals.
The data flow unit 46 compresses data to be written on the tape 20, decompresses data read from the tape 20 and corrects errors, and is connected not only to the data buffer 54 but also to the interface control unit 48. The interface control unit 48 is provided to communicate data to/from the host computer 10 via the cable 16. The data channel unit 54 is essentially a data modulating and demodulating circuit. That is, when data is written to the tape 20, it performs digital-analog conversion and modulation for data received from the data flow unit 46, and when data is read from the tape 20, it performs analog-digital conversion and demodulation for data read by the head assembly 28.
It can now be understood that the speed of the tape is an important parameter in read/write operations. The maximum data transfer rate of a tape drive is normally specified under ideal conditions where a host computer is used which has a data transfer rate equal to the data transfer rate of the tape drive. In actual applications this is generally not the case and the tape drive can be used with a variety of computers having different transfer rates, which therefore affects the overall system transfer rate. For instance, a fast, state of the art tape drive when used with a slow host can actually result in very slow overall system performance due to the fact that the drive must frequently do repositioning in order to wait for the slow host.
In order to improve system performance, variable speed tape drives are sometimes used. However, the current systems to control the speed of the drives suffer from certain shortcomings.
Accordingly, it is an object of the present invention to provide a system and method to optimize the speed of tape drives.
SUMMARY OF THE INVENTION 
The present invention includes a method for operating a system comprising a host computer, a buffer, a tape drive and a tape. The method includes writing data to the tape while the tape is traveling at a first speed; stopping the tape; determining an optimum second speed to drive the tape to travel; and, thereafter driving the tape to travel at the second speed while writing data to the tape.



BRIEF DESCRIPTION OF THE DRAWINGS
The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate one or more embodiments of the present invention and, together with the detailed description, serve to explain the principles and implementations of the invention.
In the drawings:
FIG. 1 is a view of a conventional tape drive system.
FIG. 2 is a block diagram showing an exemplary arrangement of a control card and tape drive according to the prior art.
FIG. 3 schematically illustrates the under run and reposition operations.
FIG. 4 is a table showing example parameters for a tape drive system.
FIG. 5 is a table showing back up times,
FIG. 6 is a table showing repositioning times.
FIG. 7 is a table showing number of under runs.
FIG. 8 is a graph showing rate error as a function of data set count.



DETAILED DESCRIPTION
Embodiments of the present invention are described herein in the context of a system and method for tape drive control. Those of ordinary skill in the art will realize that the following detailed description of the present invention is illustrative only and is not intended to be in any way limiting. Other embodiments of the present invention will readily suggest themselves to such skilled persons having the benefit of this disclosure. Reference will now be made in detail to implementations of the present invention as illustrated in the accompanying drawings. The same reference indicators will be used throughout the drawings and the following detailed description to refer to the same or like parts.
In the interest of clarity, not all of the routine features of the implementations described herein are shown and described. It will, of course, be appreciated that in the development of any such actual implementation, numerous implementation-specific decisions must be made in order to achieve the developer's specific goals, such as compliance with application- and business-related constraints, and that these specific goals will vary from one implementation to another and from one developer to another. Moreover, it will be appreciated that such a development effort might be complex and time-consuming, but would nevertheless be a routine undertaking of engineering for those of ordinary skill in the art having the benefit of this disclosure.
In accordance with the present invention, the components and process steps may be implemented using various types of operating systems, computing platforms, computer programs, and/or general purpose machines. For example, the calculations and algorithms described below could be carried out in an MPU such as the MPU 38 shown in FIG. 2. In addition, those of ordinary skill in the art will recognize that devices of a less general purpose nature, such as hardwired devices, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), or the like, may also be used without departing from the scope and spirit of the inventive concepts disclosed herein.
FIG. 3 schematically illustrates the under run and reposition operations. The upper part of FIG. 3 shows the relative quantity of data in the data buffer 54 (on the vertical axis Y) as a function of time (on the horizontal axis X.) The lower part of FIG. 3 illustrates the speed of the tape (on the vertical axis Y1) as a function of the position on the tape (on the horizontal axis X1). Beginning at the left of the Figure it can be seen that there is data in the data buffer 54, the tape is traveling forward at a speed V0, and the tape drive is writing data from the buffer 54 to the tape 20. Then when the data buffer 54 becomes empty, the time is TA, and the tape is at the append position 60. At this time the data flow unit 46 instructs the servo control 44 and motor control unit 50 to slow the tape down and stop the tape at stop point 62. The motor control unit 50 then commences the reposition operation which causes the tape to travel in the reverse direction until the tape reaches maximum reverse speed at point 64 and then slows down to stop as indicated at reposition point 66. The motor control unit 50 keeps the tape stopped until the buffer contains sufficient data, at which time the servo control unit 44 instructs the motor control unit to accelerate the tape in the forward direction until the tape reaches the next tape speed V1 as indicated at ramp-up end point 70. When the tape then reaches the append position 60, or at some predetermined distance thereafter, data is again written to the tape from the buffer 54.
It should be understood that the next tape speed V1 can be the same as the prior speed V0 or different from the prior tape speed V0. In some applications it is desirable to always use the same tape speed, in which case V1 is always equal to V0. However, we have developed a system and method to optimize the tape speed, in which case V1 is not necessarily the same as V0. With reference to FIG. 3, if V1 is less than V0, then ramp-up end point 70 is lower than V0 and ramp-up end point 70 precedes the append position 60. On the other hand, if V1 is equal to V0, then ramp-up continues from point 66, through point 70 and up to end point 71, as indicated by the dashed line 72, and writing begins at the append point 60.
Simulation
We have developed a computer simulation of a tape drive and computer system using the Matlab-Simulink modeling tool. It should be understood that others could use other tools such as C programming to accomplish comparable simulations. Also, it should be understood that comparable data and tables could be determined based on experiments with computers and tape drives.
We ran our simulation under a variety of conditions to develop data to compile tables for a variety of host and tape drive systems. As one example we used the parameters shown in Table I (FIG. 4) in a set of simulations to compile the data shown in shown in FIGS. 4–6 (Tables II, III and IV, respectively). The “Values” shown in the right most column of Table I are typical for many computer systems and tape drives.
The following definitions apply to terms used in Tables I-IV:

    
    
        Repo-to-Repo Time: This is the time that it takes to empty out a saturated buffer, i.e. the time between one reposition operation and the next succeeding reposition operation.
        Total Write Time: This data tells us the total time that it took to write a predefined dataset number to the tape.
        Number of Under Runs: The total number of under runs that the drive had to do during the writing of the tape.
    
    


The following explains Tables II, III and IV:

    
    
        Table II shows the back up time, for a given host rate in Mb/sec and a tape speed, Vt, in m/sec, i.e. how long it takes to write a full wrap of data, in seconds. Full wrap is a run from bot to eot. Table III is the actual repo-to-repo time for each case. Table IV is the number of detected under runs for each case.
        In Table II “ideal speed” is the ideal tape speed in m/sec—the speed that corresponds to the theoretical maximum transfer rate for a given host rate. For instance, for a host rate of 13 MB/s and Max Tape speed of 5.916 m/s and Max Transfer Rate of 34 MB/s, the ideal speed is 2.3 m/s (which is between Vt of 2.077 and 2.5 shown in Table II.)
        Ideal time is the time takes to run the full wrap at ideal speed.
        Times indicated by an asterisk in Table II are determined with reference to Table IV. In Table IV certain times correspond to zero under runs, and those times are identified in Table II with an asterisk. For example, in Table IV for the host rate of 20 Mb/sec the corresponding speed Vt is 3.5 m/sec. Thus in Table II the time of 163.9, which corresponds to the speed of 3.5 m/sec, is shown with an asterisk.
        Error is the delta time between the ideal time and the times indicated with an asterisk. For example, for a host rate of 20 Mb/sec, the time of 163.9 is indicated by an asterisk; the ideal time is 156.2 sec; and the error is −7.66 sec.
    
    


The following example can now be understood. For instance, when Host Rate is 13 MB/s and the drive is running at 3.5 m/s speed, we generate 26 under runs (Table IV) and 6.32 sec delta time between the under runs (Table II). This number of under runs will result in a total time for a full wrap of data of 260.8 sec. (Table II). Since the ideal time at this host rate is 240.4 sec (Table II) the system will suffer drastically causing a time delay of 20.4 seconds.
We have found that the optimum tape speed is a speed slightly higher than the ideal tape speed so that we can achieve 1 to 2 under runs over the full wrap and therefore we are able to detect host rate increases as well as run at nearly ideal speeds. In other words, it might appear to be desirable to run that tape at the ideal speed. However, if one were to do so then zero under runs would be achieved and we would not be able to account for increases in the Host Rate. This can be understood from the following example. Let us assume that the Host Rate is 20 MB/s and the drive running at 3.5 m/s; so that zero under runs occur, as indicated in Table IV. Now, if the Host rate increases to e.g. 30 Mb/sec, zero under runs will still occur, and the drive would continue to operate at 3.5 m/sec. Thus it can be seen that the Host-Drive system will not perform optimally since the Host will frequently fill the buffer which in turn requires that the Host stop filling the buffer until the drive is able to catch up. Frequently stopping and starting the Host results in a relatively slow overall system transfer rate.
Turning again to the example above, with Host Rate of 13 MB/s and the drive running at 3.5 m/s speed the optimum speed is of 2.3 m/s that will result of 1 to 2 under runs over the full wrap.
Graph I
Turning now to Graph I (FIG. 8) the graph shows Transfer Rate Error vs. Data Set Count. The Data Set Count is defined as the number of data sets that are written to the tape from the start of the tape to the beginning of the first under run. The Transfer Rate Error is defined as the difference between the drive Transfer rate and the Host Transfer Rate.
We created Graph I experimentally. However, similar graphs could be created using computer simulations.
Now, having Graph I we determine an equation describing the graph. In this particular case, the equation, Equation 1 in this example, is Y=3780.6 X−1.027 
Actual Operation
Having this information, we can now optimize the tape speed during operation of a tape drive—host computer system, as follows.
For example, assume that we have a tape drive and host system with the parameters given in Table I, and the tape has been traveling at the rate of 6 m/sec. and the drive has a transfer rate of 34 Mb/sec. Our system continuously monitors the number of data sets being written. When the buffer becomes empty a reposition operation is initiated, and the system determines the number of data sets which have been written since the immediately preceding under run. In this case let us assume that that number of data sets is 220. Now the system uses Equation 1 or Graph I to determine the Transfer Rate Error, which in this case is approximately 8 Mb/sec. Knowing this information the system estimates that the host transfer rate was 34 minus 8=26 Mb/sec. Then the system utilizes Tables II and IV. For the given host rate of 26 Mb/sec it can be seen that the ideal tape speed is about 4.5 m/sec since at that speed there would be zero under runs. Accordingly the system selects the next higher tape speed above 4.5 m/sec., if a discrete speed system is being used. In this example, the next higher tape speed is 5.1 m/sec as shown in Tables II and IV. However, if a variable speed drive system is in use, the system selects the appropriate higher speed to achieve one or two overruns, which in this example would be about 4.6 m/sec.
While embodiments and applications of this invention have been shown and described, it would be apparent to those skilled in the art having the benefit of this disclosure that many more modifications than mentioned above are possible without departing from the inventive concepts herein. The invention, therefore, is not to be restricted except in the spirit of the appended claims.

## Claims

1. A method for operating a system comprising a host computer, a buffer, a tape drive and a tape, the method comprising:
writing data to the tape while the tape is traveling at a first speed;
stopping the tape;
determining an optimum second speed to drive the tape to travel; and,
thereafter driving the tape to travel at the second speed while writing data to the tape;

wherein the optimum second speed is determined based on a calculated ideal speed and the optimum second speed is greater than the ideal speed.

2. A method according to claim 1 wherein the step of determining an optimum second speed to drive the tape to travel comprises determining a relationship between the host computer rate, the speed of the tape and a number of under runs of the tape.

3. A method accordingly to claim 1 wherein the tape drive writes data sets to the tape and the step of determining an optimum second speed to drive the tape to travel comprises monitoring a number of data sets being written while the tape is traveling at the first speed.

4. A method according to claim 1 wherein stopping the tape occurs when the buffer becomes empty, and the tape is repositioned and an under run is done after stopping the tape.

5. A method according to claim 4 wherein the step of determining an optimum second speed to drive the tape to travel comprises determining a number of data sets which have been written to the tape since an immediately preceding under run.

6. A method according to claim 1 wherein the tape is driven to travel through a complete wrap, and the optimum second speed is determined so that at least one under run will occur during the complete wrap of the tape.

7. A method for operating a system comprises a host computer, a buffer, a tape drive and a tape, the method comprising:
simulating an operation of the system to develop data correlating the tape speed, the data rate of the host, and back up time;
writing data to the tape while the tape is traveling at a first speed;
stopping the tape;
determining an optimum second speed to drive the tape to travel based on the simulation of the operation of the system; and,
thereafter driving the tape to travel at the second speed while writing data from the buffer to the tape;
wherein the optimum second speed is determined based on a calculated ideal speed and the optimum second speed is greater than the ideal speed.

8. A control system for controlling a tape drive system comprising a host computer, a buffer, a tape drive and a tape, the control system comprising:
tape drive control means to control the tape drive to drive the tape to travel at a first speed and a second speed while data is written to the tape and to stop the tape between travel at the first speed and at the second speed; and,
speed determination means for determining an optimum second speed to drive the tape to travel, said speed determination means being coupled to said tape drive control means;
wherein the optimum second speed is determined based on a calculated ideal speed and the optimum second speed is greater than the ideal speed.

9. A control system according to claim 8 wherein the speed determination means comprises relationship determining means for determining the relationship between the host computer rate, the speed of the tape and a number of under runs of the tape.

10. A control system according to claim 8 wherein the tape drive control means is configured to control the tape drive to write data sets to the tape and the speed determination means comprises monitoring means for monitoring a number of data sets being written while the tape is traveling at the first speed.

11. A control system according to claim 8 wherein tape drive control means is configured to stop the tape when the buffer becomes empty and to accomplish repositioning and under run motions after stopping the tape.

12. A control system according to claim 11 wherein the speed determination means is configured to determine a number of data sets which have been written to the tape since an immediately preceding under run.

13. A control system according to claim 8 wherein said speed determination means comprises estimating means for estimating the host transfer rate occurring while the tape is traveling at the first speed.

14. A control system according to claim 13 wherein the speed determination means comprises relationship determining means to determine a relationship between a data set count and a transfer error rate.

15. A control system for controlling a tape drive system comprising a host computer, a buffer, a tape drive and a tape, the control system comprising:
simulating means for simulating a operation of the tape drive system to develop data correlating the tape speed, a data rate of the host, and back up time;
tape drive control means to control the tape drive to drive the tape to travel at a first speed and a second speed while data is written to the tape and to stop the tape between travel at the first speed and at the second speed; and,
speed determination means for determining an optimum second speed to drive the tape to travel based on the data correlating the tape speed, the data rate of the host, and back up time, said speed determination means being coupled to said tape drive control means;
wherein the optimum second speed is determined based on a calculated ideal speed and the optimum second speed is greater than the ideal speed.