Abstract:
A method for detecting power loss on a data storage device (DSD) includes: as part of a device initialization of the DSD, measuring a rotational speed of a spindle of a rotating media; comparing the measured spindle rotational speed to a threshold rotational speed value; and based on the comparison, determining whether the device initialization has been triggered due to a power-on reset of the DSD.

Description:
BACKGROUND 
     1. Technical Field 
     Apparatuses and methods consistent with the present inventive concept relate to detecting loss of power in a data storage device (DSD), and more particularly to detecting power loss in a DSD based on rotational speed of a spindle of a rotating media. 
     2. Related Art 
     When connected to a host system, a DSD may experience failures related to power loss events. For example, a write splice, whereby a write operation to the DSD storage media is interrupted part way through the operation, may occur as a result of a sudden power loss (i.e., a power glitch or power drop-out). The power loss may be due to faulty power supplies, unstable voltage supply lines, defective or loose connectors, etc. The power loss may be only milliseconds in duration but may be severe enough to cause the DSD to initiate power-on reset (PoR). 
     Users of the host system (e.g., laptop computers, desktop computers, factory test equipment, etc.) may not be aware of the power loss since the DSD will automatically reconnect and reinitialize. In order to provide feedback to host system users, power loss events should be counted. Features currently exist that detect low power supply voltages to prevent the write operations from occurring; however, an abrupt power loss will not be logged as an event. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       Aspects and features of the present inventive concept will be more apparent by describing example embodiments with reference to the accompanying drawings, in which: 
         FIG. 1  is a block diagram illustrating a data storage device (DSD) according to various embodiments; 
         FIG. 2  is a graph illustrating a relationship of spindle rotational speed with respect to time from power loss for a DSD according to various embodiments; 
         FIG. 3A  is a flow chart illustrating a method according to various embodiments; 
         FIG. 3B  is a flow chart illustrating a method according to various embodiments; 
         FIG. 4A  is a flow chart illustrating a method of operation of an apparatus according to various embodiments; and 
         FIG. 4B  is a flow chart illustrating a method of operation of an apparatus according to various embodiments. 
     
    
    
     DETAILED DESCRIPTION 
     While certain embodiments are described, these embodiments are presented by way of example only, and are not intended to limit the scope of protection. The methods and systems described herein may be embodied in a variety of other forms. Furthermore, various omissions, substitutions, and changes in the form of the example methods and systems described herein may be made without departing from the scope of protection. 
     Overview 
     Sudden power loss due to, for example faulty power supplies, unstable voltage supply lines, defective or loose connectors, etc., may be only milliseconds in duration but may be severe enough to cause the DSD to initiate a PoR. Rotational speed of a spindle driving rotating media may differ during DSD device initialization between a power-up of a DSD from standstill and rotational speed of the spindle caused by sudden power loss. The difference in spindle rotational speed may be used to differentiate DSD initiated resets from sudden power loss events. 
     Detecting Power Loss Through Spindle Speed 
       FIG. 1  is a block diagram illustrating a data storage device (DSD)  100  according to various embodiments. Referring to  FIG. 1 , the DSD may include storage media  110 , a spindle  120 , a motor  130 , a rotational speed sensor  140 , a power supply  150 , a control unit  160 , a power-loss counter  170 , a PoR counter  180 , and nonvolatile storage  190 . 
     The spindle  120  may be connected to the motor  130  and the storage media  110  to cause the storage media  110  to rotate. The rotational speed sensor  140  may sense a rotational speed of the spindle  120  and provide a signal to the control unit  160 . One of ordinary skill in the art will appreciate that the rotational speed sensor  140  may be any type of rotational speed sensor known to those in the art without departing from the scope of the present inventive concept. 
     The control unit  160  may determine the rotational speed of the spindle  120  based at least in part on the signal from the rotational speed sensor  140 . The control unit  160  may control overall operation of the DSD  100  and its components. The control unit  160  may be, for example, but not limited to, a microcontroller, microprocessor, or other programmable device. The control unit  160  may include internal storage  162 , for example, but not limited to, volatile and/or nonvolatile storage. The control unit  160  may include a threshold value counter  164 . 
     The power-loss counter  170  may be incremented to count power loss events determined by the control unit  160 . The power-loss counter  170  may be implemented as part of the control unit  160  or may be implemented as circuitry separate from the control unit  160 . One of ordinary skill in the art will appreciate that the power-loss counter  170  may be implemented as hardware, software, firmware, or a combination thereof without departing from the scope of the present inventive concept. 
     The PoR counter  180  may be incremented to count power-on reset events. The PoR counter  180  may be implemented as part of the control unit  160  or may be implemented as circuitry separate from the control unit  160 . One of ordinary skill in the art will appreciate that the PoR counter  180  may be implemented as hardware, software, firmware, or a combination thereof without departing from the scope of the present inventive concept. 
     The nonvolatile storage  190  may store programs necessary for operation of the DSD  100  that are executed by the control unit  160 , as well as application data and system data, for example, but not limited to, data generated by the power-loss counter  170  and/or PoR counter  180 . 
     The power supply  150  may provide electrical power for the DSD. 
       FIG. 2  is a graph  200  illustrating a relationship of spindle rotational speed (Y axis, in rotations per minute (RPM)) with respect to time from power loss (X axis, in milliseconds) for a DSD according to various embodiments. Referring to  FIGS. 1 and 2 , during normal operation, the spindle  120  will rotate at a substantially constant operational rotational speed  210  (5,400 RPM in the example shown). Spindle  120  rotational speed  220  may decrease when electrical power is removed from the DSD  100 . One of ordinary skill in the art will appreciate that the illustrated line  210  representing operational rotational speed of the spindle  120  and the illustrated curve  220  representing rotational speed of the spindle  120  are only exemplary, and various operational rotational speeds and spindle rotational speeds may apply to various embodiments without departing from the scope of the present inventive concept. 
     Rotational speed  220  of the spindle  120  may differ during DSD  100  device initialization when the initialization is caused by a cold boot (i.e., a DSD  100  powering up from standstill) as compared to when the initialization is caused by a reset caused by sudden power loss. Sudden power loss may result in higher rotational speed  220  of the spindle  120  at an initial point of DSD  100  device initialization. For example, as shown in  FIG. 2 , the rotational speed only decreases slightly, for example, to about 5,000 RPM about 55 ms from power loss. So if a DSD experiences a power glitch or interruption of short duration, when power is restored and the DSD undergoes an initialization, the rotational speed may still be relatively high and close to the operational speed. Thus, rotational speed  220  of the spindle  120  may be measured during an initial portion of the DSD  100  device initialization path to determine the cause of the initialization. The DSD  100  device initialization path is normally only taken only once during a PoR of the DSD  100  or during DSD  100  initiated resets. Device initialization caused by DSD  100  initiated resets may be differentiated from device initialization caused by PoR of the DSD  100 , through measuring the rotational speed. During device initialization caused by DSD  100  initiated resets, system variables may be preserved and may be evaluated to determine that device initialization was caused by a DSD  100  initiated event. 
       FIG. 3A  is a flow chart illustrating a method  300  according to various embodiments. Referring to  FIGS. 1-3A , as part of a device initialization of the DSD  100 , rotational speed of the spindle  120  may be measured ( 305 ). For example, the rotational speed sensor  140  may sense the rotational speed of the spindle  120  and transmit a signal proportional to the rotational speed to the control unit  160 . The control unit  160  may determine the rotational speed of the spindle  120  based on the signal received from the rotational speed sensor  140 . 
     The control unit  160  may compare the measured rotational speed of the spindle  120  to a threshold rotational speed value ( 310 ). The threshold rotational speed value may be determined based on a rotational speed difference of the spindle  120  from an operational rotational speed  210  of the spindle  120  (see  FIG. 2 ), and may be stored in the nonvolatile storage  190  and/or the internal storage  162  of the control unit  160 . For example, a threshold rotational speed value of 5,000 RPM may be used. The threshold rotational speed value may be adjustable via a value stored in the nonvolatile storage  190  and/or the internal storage  162  of the control unit  160 . Based on the comparison of the measured rotational speed of the spindle  120  to the threshold rotational speed value, the control unit  160  may determine if the DSD  100  device initialization was triggered by PoR of the DSD  100  ( 315 ). Following up on the example set forth above, a measured rotational speed over the threshold rotational speed value of 5,000 RPM may indicate that the device initialization was triggered by PoR. 
       FIG. 3B  is a flow chart illustrating a method  350  according to various embodiments. Referring to  FIGS. 1, 2 and 3B , as part of a device initialization of the DSD  100 , rotational speed of the spindle  120  may be measured ( 355 ). For example, the rotational speed sensor  140  may sense the rotational speed of the spindle  120  and transmit a signal proportional to the rotational speed to the control unit  160 . The control unit  160  may determine the rotational speed of the spindle  120  based on the signal received from the rotational speed sensor  140 . 
     The control unit  160  may compare the measured rotational speed of the spindle  120  to a threshold rotational speed value ( 310 ). The threshold rotational speed value may be determined based on a rotational speed difference of the spindle  120  from an operational rotational speed  210  of the spindle  120  (see  FIG. 2 ), The threshold rotational speed value may be adjustable via a value stored in the nonvolatile storage  190  and/or the internal storage  162  of the control unit  160 . The control unit  160  may determine if the measured rotational speed of the spindle  120  is equal to or greater than a threshold rotational speed value ( 365 ). 
     If the control unit  160  determines that the measured rotational speed of the spindle  120  is equal to or greater than a threshold rotational speed value ( 365 —Y), the control unit  160  may determine that the DSD  100  device initialization was triggered by a power loss event ( 370 ). The control unit  160  may increment a count of the power-loss counter  170  ( 370 ) indicating that the DSD  100  device initialization was triggered by the power loss event. 
     The control unit  160  may cause the count of the power-loss counter  170  to be stored in the nonvolatile storage  190 . Alternatively or additionally, the control unit  160  may cause the count of the power-loss counter  170  to be stored on the rotating storage media  110 . 
     If the control unit  160  determines that the measured rotational speed of the spindle  120  is not equal to or greater than a threshold rotational speed value ( 365 —N), the control unit  160  may determine that the DSD  100  device initialization was triggered by a PoR event ( 380 ). The control unit  160  may increment a count of the PoR counter  180  ( 385 ) indicating that the DSD  100  device initialization was triggered by the PoR event. In other embodiments, if the measured rotational speed is equal to the threshold, the  365 -N path is taken instead. 
     In addition to detecting device initialization caused by PoR, measuring rotational speed may also be useful for estimating the duration of the power loss/interruption, as further illustrated by  FIGS. 4A and 4B .  FIG. 4A  is a flow chart illustrating a method of operation  400  of an apparatus, for example, but not limited to, the DSD  100 , according to various embodiments. Referring to  FIGS. 1, 2 and 4A , as part of a device initialization of the DSD  100 , rotational speed of the spindle  120  may be measured ( 405 ). For example, the rotational speed sensor  140  may sense the rotational speed of the spindle  120  and transmit a signal proportional to the rotational speed to the control unit  160 . The control unit  160  may determine the rotational speed of the spindle  120  based on the signal received from the rotational speed sensor  140 . 
     The control unit  160  may compare the measured rotational speed of the spindle  120  to a plurality of successively lower threshold rotational speed values corresponding to successively longer time durations ( 410 ). The threshold rotational speed values may be determined based on rotational speed differences of the spindle  120  from an operational rotational speed  210  of the spindle  120  (see  FIG. 2 ), and may be stored in the nonvolatile storage  190  and/or the internal storage  162  of the control unit  160 . The threshold rotational speed values may be adjustable via values stored in the nonvolatile storage  190  and/or the internal storage  162  of the control unit  160 . Based on the comparison of the measured rotational speed of the spindle  120  to the successively lower threshold rotational speed values, the control unit  160  may determine a power loss duration for a power loss event ( 415 ). As shown in  FIG. 2 , there is a relationship (e.g., curve  220 ) between the rotational speed and the duration of power loss. Such a relationship may be determined by characterization of the DSD based on observation under a power loss condition. Thus, once such relationship is known/characterized, a series of threshold rotational speed values may be set accordingly, with corresponding power loss durations set based on the relationship (e.g., stored as a look up table or as a function). In one embodiment, when the successive comparisons as described above are made, the first comparison at which the measured rotational speed exceeds or equals to a threshold rotational value of the series, may indicate an approximate power loss duration. 
       FIG. 4B  is a flow chart illustrating a method of operation  450  of an apparatus, for example, but not limited to, the DSD  100 , according to various embodiments. Referring to  FIGS. 1, 2 and 4B , as part of a device initialization of the DSD  100 , rotational speed of the spindle  120  may be measured ( 455 ). For example, the rotational speed sensor  140  may sense the rotational speed of the spindle  120  and transmit a signal proportional to the rotational speed to the control unit  160 . The control unit  160  may determine the rotational speed of the spindle  120  based on the signal received from the rotational speed sensor  140 . 
     The control unit  160  may initialize the threshold value counter  164  ( 460 ). The control unit  160  may compare the measured rotational speed of the spindle  120  to a minimum threshold rotational speed value ( 465 ). If the control unit  160  determines that the measured rotational speed of the spindle  120  is less than a minimum threshold rotational speed value ( 465 —Y), the control unit  160  may determine that the DSD  100  device initialization was triggered by a PoR event and may increment a count of the PoR counter  180  ( 470 ) indicating that the DSD  100  device initialization was triggered by the PoR event. 
     If the control unit  160  determines that the measured rotational speed of the spindle  120  is not less than a minimum threshold rotational speed value ( 465 —N), the control unit  160  may compare the measured rotational speed of the spindle  120  to a threshold speed value corresponding to the count of the threshold value counter  164  ( 480 ). 
     If the control unit  160  determines that the measured rotational speed of the spindle  120  is not greater than the threshold speed value corresponding to the count of threshold value counter  164  ( 480 —N), the control unit  160  may increment the count of the threshold value counter  164  ( 485 ). The control unit  160  may compare the measured rotational speed of the spindle  120  to a next threshold speed value corresponding to the threshold value counter  164  ( 475 ). The control unit  160  may repeat compare ( 475 ), determine ( 480 ), and increment ( 485 ) operations for successively lower threshold rotational speed values corresponding to successively longer time durations that correspond to the count of the threshold value counter  164 . As illustrated in  FIG. 2 , the rotational speed of the spindle  120  decreases with increasing time duration from power loss. The successively lower threshold rotational speed values and the minimum threshold rotational speed value may be determined based on rotational speed differences of the spindle  120  from an operational rotational speed  210  of the spindle  120  (see  FIG. 2 ), and may be stored in the nonvolatile storage  190  and/or the internal storage  162  of the control unit  160 . 
     If the control unit  160  determines that the measured rotational speed of the spindle  120  is greater than a threshold speed value corresponding to the count of the threshold value counter  164  ( 480 —Y), the control unit  160  may store a time duration corresponding to a threshold speed value immediately preceding the threshold speed value corresponding to the count of the threshold value counter  164  ( 490 ). The control unit  160  may increment the count of the power-loss counter  170  ( 495 ). 
     The control unit  160  may cause the time duration and the count of the power-loss counter  170  to be stored in the nonvolatile storage  190 . Alternatively or additionally, the control unit  160  may cause the time duration and the count of the power-loss counter  170  to be stored on the rotating storage media  110 . 
     One of ordinary skill in the art will appreciate that the operations described with respect to  FIGS. 3A, 3B, 4A, and 4B  may be implemented as a non-transitory computer readable medium having stored therein instructions for executing the described operations. 
     While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the protection. The methods and systems described herein may be embodied in a variety of other forms. Various omissions, substitutions, and/or changes in the form of the example methods and systems described herein may be made without departing from the spirit of the protection. 
     The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the protection. For example, the example systems and methods disclosed herein can be applied to hard disk drives, hybrid hard drives, and the like. In addition, other forms of storage, for example, but not limited to, DRAM or SRAM, battery backed-up volatile DRAM or SRAM devices, EPROM, EEPROM memory, etc., may additionally or alternatively be used. As another example, the various components illustrated in the figures may be implemented as software and/or firmware on a processor, ASIC/FPGA, or dedicated hardware. Also, the features and attributes of the specific example embodiments disclosed above may be combined in different ways to form additional embodiments, all of which fall within the scope of the present disclosure. 
     Although the present disclosure provides certain example embodiments and applications, other embodiments that are apparent to those of ordinary skill in the art, including embodiments which do not provide all of the features and advantages set forth herein, are also within the scope of this disclosure. Accordingly, the scope of the present disclosure is intended to be defined only by reference to the appended claims.