15

I remember reading an answer about a computer that, in the event of a power failure, would write the important parts of the memory to disk - using the momentum of the still-spinning drive to do so. This was an early form of hibernation and, if this worked how I am imagining, a far superior version to today's.

What I can't work out is how this could possibly work. Unless the drive contains a generator I see no way that the computer could have enough power to read the memory (unless it contained a backup battery, which I don't think was the case), although writing is still plausible if the drive's still running.

How can a computer hibernate "using the momentum of the disk drive"?

  • I can't re-find the answer. I think it was on a question about hibernation, but searching for "hibernate" returns no results. If anyone has a link to it, please post it as a comment. – wizzwizz4 Nov 5 '16 at 18:39
  • 3
    This sounds rather implausible with anything like modern hard drives (there's some discussion on halfbakery.com), but perhaps with early drives where the platters were big enough to act as flywheels... (The hard part is that using a disk to generate power would slow it down quickly, but you need it to be spinning at something close to the usual speed to be able to write to it! Unless the emergency circuitry handled the slowdown...) – Stephen Kitt Nov 5 '16 at 22:20
  • 2
    Is it possible you are mis-remembering something? The PDP-11 had a power-failure interrupt, and the interrupt handler could indeed write key information to disk. But while it is true that the momentum of the still-spinning drive made this possible, the PDP-11 did not use that momentum to power the CPU. Rather, the power supply of the computer had very large capacitors which could run the computer for a few milliseconds without external power, which was long enough to write data as long as the disk was already spinning (there was not enough power in the capacitors to spin up a disk). – Ken Gober Nov 6 '16 at 13:54
  • @KenGober PDP-11... That rings a bell; I think that's the computer I'm remembering. If you have time, could you write up an answer with this information? – wizzwizz4 Nov 6 '16 at 14:04
  • @Stephen Kitt: Rotational energy is Erot=0.5*J*w². That means between an old-time harddisk rotating with about 150rpm and a current one with 15.000rpm, there is the factor 10.000 from w², which you have to take into account when considering the difference in rotational mass J. – Janka Nov 7 '16 at 17:10
15

Any real attempt to use the momentum of the spinning disk to generate power would cause the disk to come to a halt very quickly. In essence, this is the principle behing regenerative braking of electric vehicles. Otherwise, you would have a perpetual motion machine.

However, there certainly were computers that used the momentum of a disk that was spinning to be able to write to it.

There were various generations and configuations of the DEC PDP-11, both in terms of the CPU and the disk drives. They had one common feature, that disk writes (and for that matter tape deck writes) were cached. The disk controller held an amount of RAM, writes to the drive by the CPU went into this RAM buffer. The buffer was written to the physical drive when it reached a defined threshold.

The configuration of these drives and the threshold at which writing occured could be changed by the System Manager, or other privileged account. In the process control uses, for which I used to use these computers, increasing the write frequency reduced the risk of data loss due to power failure at the expense of disk speed.

The drives also contained their own power supplies, with large capacitors. If the power failed, an interrupt would cause the disk controller to write the contents of the RAM buffer to the drive before the drive span down and the memory was lost.

There is good information about the configuration of various generations of PDP-11 disks here.

This was not a guaranteed fail-safe mechanism. Sometimes data was lost. However, the system did successfully prevent data loss most of the time.
The later MicroVAX computers also had this system and would very rarely lose data on power loss - in my experience.
(Of course, the VAX-FT could survive all sorts of failures - but that was a different animal.)

The system wasn't intended to hibernate the computer, in the way that a modern laptop can hibernate. It just prevented the loss or corruption of open files, including the page file and swap file.

9

Any electrical motor can, with the right driver circuit, act as a generator.

The easiest case which does not need any outer circuit at all (it's all built in) is a shunted DC motor, it acts as a voltage source as long it is rotating. That one is called Counter-Electromotive Force. How many volts depends on the motor characteristic and the speed. When the voltage applied from outside is higher than the internal voltage, it's working as a motor and it's torque in rotation direction is driving the load. When the outside voltage is smaller than the internal, it's working as a generator and the torque works in the opposite direction of the rotation direction – it's braking the load.

At constant speed, there is an equilibirum between inside voltage and outside voltage and no current flows. (Of course, that only applies to a drive without losses.)

For a harddisk drive, things are more complicated as those usually are synchronous AC motors, but the principle stays the same.

  • Would it be possible for the "right driver circuit" to be located outside of the drive, or would a custom drive be required? Could a drive act as a generator whilst simultaneously and, if not, why wouldn't this be required? (Thanks for the quick answer, by the way!) – wizzwizz4 Nov 5 '16 at 19:33
  • Ah, I think that's a misunderstanding about the word "drive". By drive, EE people usually mean motor+load. Because you can not calculate them separatedly. Not the hard disk device. And of course, the hard disk device has to have this right driver circuit inside. What the original claim probably says it the RAM buffers in the hard disk devices can still be written, only with the power the drive rotation supports. – Janka Nov 5 '16 at 19:40
  • The original claim was something about hibernating the computer, as far as I know. (I think I read it on Retrocomputing, but it's not in the search results for "drive is:answer" nor in the deleted answers list.) – wizzwizz4 Nov 5 '16 at 19:43
  • I don't think this answer accurately addresses the question. Taking any extra energy from the rotating mass seems rather speculative. Writing to the disk as it starts to spin down seems quite plausible. Sources to justify the answer? – Sean Houlihane Nov 7 '16 at 13:40
  • I tried to explain, you often cannot avoid the motor acting as a generator when outer voltage is smaller than the CEMF. That's true for example for the mechanically commutated DC motor and for the sychronous AC motor. The asynchronous AC motor can do this too, but that one in addition has a brake-only mode of operation, in which it consumes outside energy for braking. Useful for emergency-braking of vehicles. So, you cannot avoid the generator/brake mode from the driving circuit. You can only make the braking smooth by limiting its current. For example to zero by lifting the terminals. – Janka Nov 7 '16 at 16:42
9

The PDP-11 had a 'power fail' trap that would be invoked when a problem with AC power was detected by the power supply. The system then had 2ms of runtime (powered by capacitors in the power supply, not disk momentum) to save volatile data. Typically, this was limited to the contents of the CPU registers (including the program counter and stack pointer) and possibly certain device registers as well. 'Main' memory was not originally considered volatile because it used magnetic cores that would retain their content even without power, and in any event 2ms was not enough time to write more than a tiny fraction of main memory anywhere.

I suppose it would also have been theoretically possible to write the CPU registers to a dedicated track on a drum memory device. It could not have been a moving-head disk because head seeks take much longer than 2ms. Also, an entire drum track would have been needed because 2ms is not even enough time to wait for the drum to rotate to a specific position; you would have required the ability to start writing at whatever position the drum happened to be in when the power fail trap occurred. I do not know whether DEC produced any drum devices that had such a write-anywhere ability (or the ability to quickly determine where the drum was currently positioned, which is effectively the same thing).

In any event, saving registers in core memory seems like a much better idea. 2ms is not a lot of time (I would guess fewer than 1000 instruction executions), and writing to core is much faster than writing to a drum. Plus, you needed to have core memory anyway to make a power failure survivable, so there was little point in designing a solution that required you to have both core and drum memory. Far easier (and cheaper) to just allocate a few words of core to save your registers.

When power was restored, that same 'power fail' trap would be invoked again, and the power fail handler would then be able to re-initialize I/O devices, restore registers from wherever they had been saved, and resume normal operation.

5

From that I remember, the old type hard drives were very sensitive to the unexpected power loss - the machine I used (SM-4) required to power them down manually before switching off the main power supply. The main problem was the need to move the heads into parking position before the drive comes to halt. Otherwise loss of the results of the currently running execution is just the smallest of the problems you have afterwards.

The drive momentum was used to provide the energy to move the heads into parking position. This did not help to save any data but in most of cases prevented drive and head damage during the unexpected power loss.

  • This is true. With early drives you had to issue a park heads command before powering off. It was more important on drives with removable platters. – Chenmunka Nov 21 '16 at 9:16
  • @h22 This reminds me of the Amiga's disk-detection clicking noise patches; these would often move the write head past its physical limits, expecting that the drive would not move the head but would return data anyway. – wizzwizz4 Nov 21 '16 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.