How to use disk drive stepper-motors
Written by Tomi Engdahl
Why to use components from old disk drives
You might ask why use components from old disk drives.
The answer is that disk-drives have many expensive components
and you can get old bad disk-drives freely or very cheaply.
They are good sources for following components with not
1. Small stepper motors and controllers
2. Optical sensors or microswitches
3. Accurately speed-regulated DC-motor
4. Useful accurate mechanic parts for small projects
Disk drive interface description
Power connector pinout
Normal floppy disk drives use normally +12V and +5V power supplies. They can load each power-line with current of less than 100 mA up to even more than 1 A. That depens on the model of the disk drive. Here is the power connector pinout when you look the CEE-type connector on the drive back:
_______ / \ | 1 2 3 4 | |_________| Pin Function 1 +5 V 2 Ground 3 Ground 4 +12 V
Shugart disk-drive interface
The following table shows signals of the most commonly used floppy disk drive computers. The pinout is somehow de-facto and the use of certain signals may be different in various systems. This interface is used in both PC and Amiga computers, but the use and handling of various signals are different. Anyway those signals are always TTL-level signals.
Pin Function 1 GND 2 High density select 4 Head load / In Use, Eject 6 Drive select 3 8 Index pulse + 10 Drive select 0 / Motor on A 12 Drive select 1 / Drive select B 14 Drive select 2 / Drive select A 16 Motor On / Motor on B 18 Direction 20 Step 22 Write data 24 Write enable 26 Track Zero + 28 Write Protect + 30 Read Data + 32 Select Head 34 Disk Changed + / Ready + 3-33 Odd pins are GND
PC/AT disk drive signals
PC/AT computers use those disk drive signals in the following way. In this system the drives are jumpered to be type A or B depending the situation. Usually PC and AT systems use a special cable which changes singal positions of drive A and B motor on and select signals between disk drive connectors. This makes it possible to have both drives to be jumpered as drive A and one drive works in this way as A and another as B.
Pin Function Direction 1 GND 2 High density sel ??? 8 Index pulse from drive 10 Motor on A to drive 12 Drive select B to drive 14 Drive select A to drive 16 Motor On B to drive 18 Direction to drive 20 Step pulse to drive 22 Write data to drive 24 Write enable to drive 26 Track Zero from drive 28 Write Protect from drive 30 Read Data from drive 32 Select Head to drive 34 Disk Changed ??? 3-33 Odd pins are GND
How to use disk-drive stepper motor
What kind of stepper motors there are in disk drives ?
Floppy disk drives use stepper motors for controlling read/write head position. Even early hard disk drives also used steppers, but nowadays hard drives have replaced the teppers with voice-coil servo motors.
The stepper motors used in 5 1/4" floppy disk drives usually move the read/drite head using wheel and spring mechanism which works quite well. According one informatin source those stepper motors used in disk drives were usually 200 or 400 steps per revolution models. 200 steps per revolution models are are used in standard density (40 track per disk) drives. High-density floppy-drives have 80 tracks and they use 400 steps per revolution stepper motors. One other information source says that in the old disks steppers each step was 3.6 degrees meaning that it takes 100 steps to fully rotate, in the HD drives each step was 1.8 degrees i.e. 200 steps. I have not have calcualted the exact step number myself, so I am not completely sure which of those is correct (mybe there could be different motors used on different drivers, there has been different kind of drive mecnanics)
Whatever type you have, those motors are very useful for your own projects. Stepper motors usually use +12V power, but some new low-power drives use +5V power source for driving steppers.
Small 3 1/2" floppy disk drives usually use screw-type mechanics, where motor rotates the screw-like axle, which moves the read/write head. This type of mechanics makes it possible to make smaller drives and depends on th screw characteristics the motor can have bigger steps. Those motors are usually driven from +5V source, because many modern 3 1/2" drives use only +5V power-supply.
How to use those motors in your own projects
Stepper motors are quite useful for robotics, plotter and control projects. Stepper motors are accurate way of making desired mechanical movements. Stepper-motors are not very powerful or fast (about 300 steps/sec).
You can build your own controller or use ready-made controllers with them. You just have to identify the type, wiring and operating voltage of the stepper motors to be able to use them. Unfortunately stepper motors are not the easiest motor types to control and ready-made controllers are usually quite expensive. If you want to make your own controller for a stepper motor takenfrom a disk drive then take a look at http://www.doc.ic.ac.uk/~ih/doc/stepper/.
When you have just taken the motor out of the disk drive, you might have thought that there must be also a stepper controller inside the disk drive electronics. You are right that there is a controller, which is capable to drive the motor. It is quite easy to send signals to that controller using PC parallel port and small program.
How to use controller in disk-drive electronics
The controller in the disk drive electronics can be succesfully
used in the following way:
1. The electronics needs +5V to operate and usually +12V for motors
2. If the disk-drive has function to automatically got to track zero on powerup, you have to disable that option unless you want to use that option and the track zero detectio in your project. This option can be found from modern disk-drives, but old drives does not have it. Sometimes there is jumper for enabling and disabling this option.
3. Make sure that the electronics does not need to detect the disk in the drive to be able to move the stepper motor. This sensor can be easily easily make to give electronics the info that the disk is in drive. You only have to put some tape or glue to the sensor to make it think that disk is always in the drive. You can also accomplish this by cutting one wire or adding one extra wire to bypass the sensor.
4. Use drive select signal to select the drive electronics. Then use direction and step pulse signals to control the steper motor.
Disk drive interface stepper motor control signals
The following signals are used to control the disk drive stepper motor controller circuit. First you have to select the drive by connecting the correct drive select signal to ground. Then you use the direction signal to select the direction which you want the motor to take step. The stepping is controlled using step pulse signal, which is normally high. One low going pulse at step pulse line makes the motor to take the one step. Make sure that pulse signals are longer than 1 microsecond and you are not sending then faster than the motor can take steps.
Pin Function Direction 1 GND 12 Drive select B to drive 14 Drive select A to drive 18 Direction to drive 20 Step pulse to drive 26 Track Zero from drive 3-33 Odd pins are GND
There are limitations hiw fast pulses those disk drives can take. Limitations are basically electromechanical (how fast the stepper motor can react), but sometimes electronics can limit it. For disk drives like NEC FD1155C (High density) floppy drive it seems that the minimum cycle time required for the step pulse is 6 ms using 50% duty cycle. And for NEC FD1053 (Low density) step cycle pulse must not be less than 10 ms. For the direction signalt it seems that the drive sample the direction signal at positive flank of the step signal. Do not thake those as absolute guarantes, but as general guidelines where to start experimenting.
PC parallel port to stepper-motor interface
This is a simple example how to control disk drive stepper motor using PC parallel port. I expect that the drive is jumpered to be as drive A. The parallel port pin numbers are according the 25 pin connector numbering which is in the the back of your PC.
Connect parallel port pin 20 (ground) to disk drive connector pins 17 and 19 (ground). Connect disk drive connector pin 14 (drive select A) to disk drive connector 17 (ground). Connect parallel port pin 2 (D0) to disk drive connector pin 20 (step pulse). Connect parallel port pin 3 (D1) to disk drive connector pin 18 (direction).
Parallel port (25 pin) Disk drive (34 pin) 2 ------------------------- 20 3 ------------------------- 18 +--- 14 20 ---------------------+--- 17 +----19
In this way you have made a cable with which you can easily control the stepper motor using parallel port datapins D0 and D1. Those pins can be easily controlled in your software by directly writing to parallel port hardware. You can't use the DOS, BIOS or other operating system functions, because this interface does not generate the handshaking signals those routines need.
Directly controlling the parallel port is very easy. First you have to read the I/O address from the BIOS data area. LPT1 I/O address is the 16-bit word which can be found from memory address 0008h at segment 0040h. Then you simply write the data you want send to parallel port data pins to this I/O address. The writing can be easily done using following commands in different languages: out in assembler, outp in borland c and port in pascal. You can find more programming details from my Parallel port interfacing made easy article. You can also try Floppystepper C++ source code for DOS from Circuit Cookbook Archive.
Using stepper motor as constantly rotatating motor
Stepper motors can be also used as contantly rataing moros in applications where a slower speed that is easily avaialble using direct drive DC motor is needed or the speed has to be very accurately adjusted.
Disk drive stepper motor can be used as freely rotating motor quite easily by using the stepper motoro controller from the disk drive. You just need to activate drive select line and then select the rotation direction using direction pin. Then all you need is to send constant clock signal to the step pin (or adjustable if you want). Suitable oscillator can be quite easily made using for example 555 timer IC or from oscillator built out of TTL logic gates. If you build a small board with 555 chip (giving suitable clock pulses at frequency you need, from few Hz to few hundred Hz) and few sitches to ocntrol other signals (one controlling if clock from 555 gets to disk drive, other controlling direction, third maybe drive select). With this kind of controller you can start, stop, step front/back, spin... No big deal. No code needed!
Using the stepper motors without the disk drive electronics
Disk drive stepper motors consist two coils which move the motor to the desired direction when a current is applied to those coils in correct order. The following signals will make the stpper motor to run to one direction. To get the motor to run to other direction you must invert the polarity of the signals of one of the coils (two phase wires).
Coil 1 signals
.......... ....... Phase 1 .....| |.........| Phase 2 ..... ......... |..........| |.......
Coil 2 signals
........ ......... Phase 3 .| |........| |.... . ........ .... Phase 4 |........| |.........|The signals can be presented also in binary format. The common sequence (1 means current flowing, 0 means open circuit):
Phase1 00110011 Phase2 11001100 Phase3 01100110 Phase4 10011001Douglas W. Jones has put a a project on the web how to control stepper motors using printer port and some simple electronics under name A Worked Stepping Motor Example. It a part of Control of Stepping Motors tutorial.
How to use disk drive rotating motor
Disk drive motors are quite nice motors quite accurate speed control system. Disk drive motors rotate the disk at 300 or 360 rpm speed. Standard drives use 300 rpm, but high-density drives use 360 rmp or selectable speed 300/360 rpm motors.
Motor control signals in disk drive interface
You can make the disk drive motor to spin when you enable both drive select and motor on signals by pulling those signals to low logical state. This can be easily done by connecting both signals to signal ground.
The high-density signal might have something to do with selecting the speed of the motor in disk drives with two-speed (300/360 rmp) motors. I have not needed and figured out this yet.
Pin Function Direction 1 GND 2 High density sel ??? 10 Motor on A to drive 12 Drive select B to drive 14 Drive select A to drive 16 Motor On B to drive 3-33 Odd pins are GND
Other useful components from disk drives
Disk drives are also quite nice source for other components also. When you take the motors out of the disk drive, you can easy take other components also. Usually there are optical sensors or microswiches in disk drive to sense the write protect tab. Those components are useful sensors in you stepper-motor controlled robotics circuits. Many direct drive rotating motors use hall-sensors for sensing rotating speed. This can be quite useful component if you can figure out how it is connected.
How about using hard disk stepper motors ?
Many older hard disk also had stepper motors for controlling read/drite head motion. Many modern disk drive drive motors use voice-coil control systems, which makes another story.
In my experiments I have used ST506/412 interface hard disk drives. Those are the original IBM PC/AT hard disks (usually called MFM disks) which needed a controlling card. The modern ATA/IDE drives are basically the same drives, but the controller electronics is integrated to disk drive electronics, which makes them more complicated and harder to control.
Basically hard disk drive has same basic elements as the floppy disk drive: read/write-head, head moving motor, disk rotation motor, sensors and controller electronics. You can use those differents componens at their own or use the controlling electronics provided by the hard disk drive electronics. Stepper motors are same types as used in floppy drives, though the number of steps/revolution might be higher. The drive rotating motor is same type of drushless DC motor as used in modern floppy drives, but those run at much higher speed (about 3000-3600 rmp).
ST506/412 hard disk interface
ST506/412 hard disk interface is something like a modified floppy disk drive interface. The physical interface in ST506/412 consists of two connectors: 34 pin control connector and 20 pin data connector. The control connector carried all disk drive control information and data connector carries the data. The controller cable goes to two hard drive control interfaces (up to four can be supported), but each hard disk drive has it's own data cable.
Control connector pinout
All control connector signals are TLL level signals. They are active when set to low state (0 V).
Pin Function Direction 2 Reduced write current to drive 4 Head select 2^2 to drive 6 Write gate to drive 8 Seek complete from drive 10 Track 0 from drive 12 Write fault from drive 14 Head select 2^0 to drive 16 reserved 18 head select 2^1 to drive 20 Index from drive 22 Ready from drive 24 Step to drive 26 Drive select 1 to drive 28 Drive select 2 to drive 30 Drive select 3 to drive 32 Drive select 4 to drive 34 Direction in to drive Pins 1-33 all odd pins are ground
Pin Function Direction 1 Drive selected from drive 3 reserved 4 reserved 7 reserved 9 reserved 10 reserved 13 +MFM Write data to drive 14 -MFM Write data to drive 17 +MFM Read data from drive 18 -MFM Read data from drive Pins 2,4,6,8,11,12,15,16,19 and 20 are ground pins.
Using hard disk drive head actuators
Originally, head positioning was controlled by a stepper motor that rotated in either direction by reacting to stepper pulses and moving the head assembly back and forth by means of a "rack and pinion" or by spooling and unspooling a band attached to the actuator arms. Each pulse moved the assembly over the surface in predefined steps or detents. Each step represented a track location and data was expected to be under the head.
Stepper motor controlled head actuators are not suitable for current drive densities and is prone to alignment problems caused by friction, wear and tear, heat deformation, and lack of feedback information needed for correcting positioning error. Nowadays the hard disks use voice coil actuators which are harder to use by experimenters.
I have made some experiments of using also hard disk drive stepper motor and controller electronics in my own projects. The stepper motor is easy to connect same type of step and ditection signals as disk drives. You can get more information from disk drive chapters. The only difference to disk drive system is that the disk drive electronics can buffer the movement signals, so that the controller stores the movement pulses and executes the muvement after the controller has received the last movement pulse.
Stepper motor control pins in ST506/412 interface
The following signals from control connector are needed for using stepper motor controller in hard disk drive electronics. Most important signals for stepper motor control are Direction and Step signals. The direction signals works so that low logic level moves the read/write head inward (towards the center of the disk) of the disk and high logic level moves the head outward. Step signal is active low pulse signal. Drive select signal must be activated (pulled low) and Write gate must be deactivated (pulled hight) to make the drive to take the stepper motor control signals. Seek complete, Ready and Track 0 provide some extra status information.
Pin Function Direction 6 Write gate to drive 8 Seek complete from drive 10 Track 0 from drive 22 Ready from drive 24 Step to drive 26 Drive select 1 to drive 28 Drive select 2 to drive 30 Drive select 3 to drive 32 Drive select 4 to drive 34 Direction to drive 1-33 all odd pins are ground
Procedure to control hard disk stepper motor using ST506/412 interface
I have used the following procedure for controlling hard disk drive stepper motors (taken from DP8466 Design Guide):
1. Deactivate the WRITE GATE line (pin 6) 2. Activate the DRIVE SELECT line (pin 26,28,30 or 32) 3. Wait for READY and SEEK COMPLETE signal to be true. 4. Select the direction with DIRECTION signal. (pin 34) 5. Send the movement pulses using STEP line. (pin 24)
Experimenting with voice coil head actuators
Voice coil actuator controls the movement of a coil toward or away from a permanent magnet based upon the amount of current flowing through it. Voice coil actuators used in hard disk systems have an acceleration to current transfer function.
The armatures are attached to this coil and move in and out over the surface with it. Servo controlled voicecoil actuator a very precise method, but also very sensitive. Any variation in the current can cause the head assembly to change position and there are no pre-defined positions. Inherently this is an analog system, with the exact amount of movement controlled by the exact amount of current applied.
The actual position of the coil is typically determined by servo (or indexing) information, which is written to the drive by the manufacturer. Precise location of the data track (of which there are 6000 to 10000 per inch) depends on an "embedded servo" which is a special pattern written on the disk at the time of manufacture. The result is that the track is divided into servo fields, id fields , and data fields. Location is adjusted to different tracks by reading and reacting to these control signals. When the servo informatioin is read, a Position Error Signal (POS) is generated, which indicates how far from track center you are. A complex feedback system converts this error to a current into the voice coil, and the head moves back toward track center.
Because of this construction the hard disk drive must be in quite well working condition so that the voice coil head controllin mechanism would work. Voice coil positioners always need feedback, and carefully designed loop filters. If the disk drive sort of works and has an interface you know, then you can try the controlling as you would control the disk drive stepper motor (easy with ST506/412 interface).
Playing with damaged servo mechanism
If the hard disk is so damaged that the controlling mechanism does not work anymore, then it is very hard to accurately control the voice coil servo anymore. But there is one experiment you can make with voice coils.
You can control a voice coil using a normal audio amplifier and a music source. First find the wires going to the voice coil. The check the resistance of the voice. If it is 4 ohms or more, then you can try to drive it directly using an audio amplifier. Replace the speaker with the voice coil and start to play music. The voice coil will move back and forth and you might even hear some sound form the music. Be careful with the experimenting, because the voice coil can be burhed down easily with excessive power put to voice coil. And remeber also that you can damage your amplifier if make mistakes with the connections.
You can try to convert the voice coil to sort of current to position transfer function by adding some mechanism which tries to center the actuator whn no current is applied (you can try springs or small pices of soft rubber).
Most drives have several platters that are separated by disk spacers and clamped to a rotating spindle that turns the platters in unison. A direct drive, brushless DC spindle motor is built into the spindle or mounted directly below it. The spindle and the platters, are rotated at a constant speed, usually 3,600 RPM, though newer models have increased that to 4800, 5400, or 7,200
The spindle motor receives control signals through a closed loop feedback system that stabilizes to a constant rotation speed. Control signals come from information written onto the surface(s) during manufactur. Older drives have used magnetic hall or coil type sensors for sensing the rotating speed.
Hard disk motors typically start rotating then the power is applied to the hard disk. First they accelerate the spindle to the full speed. If the servo controlling can't work properly or something other goes wrong in the hard disk they will typically stop rotating the spindle.
Where I got all this information
I have got most of this information in this documents from numerous some articles usenet newsgroups alt.comp.hardware.homebuilt and sci.electronics. I have also used some reference books to check some facts and get more detailed information. The ideas how to use those motors in your own projects is my ideas. I have used parts from old disk drives in many of my electronics projects (most have been only some simple experiments).
If you are looking for ready made source code for disk drive stepper motor controlling, it is a good idea to check Interfacing a Junk Disk 5-1/4 inch Drive with a Parallel Port paper by Towanda L. Malone. That paper is available at http://www.eng.morgan.edu/~malone/dskdrv/dskdrv.html.
Reference book list
- Thom Hogan, the Programmer's PC Sourcebook, Microsoft Press, 1988
- DP8466 Disk Data Controller Design Guide / User's Manual, National Semiconductor Corp, 1985
- Tandon 386 Engineer Quick Reference 5b
- TECHNICIANS' GUIDE TO PC HARD DISK SUBSYSTEMS by Nicholas Majors