HDD Brushless motor hack

Sunday, April 26, 2009 7:27 AM


Hard Drives Disk have high-speed low-profile brushless motors that can be re-used, called BLDC.
In this projet i re-use a BLDC motor that i retrieved from an old HDD, the SEAGATE ST31722A. It's a 3.5 inch HDD and 1.7GB of storage capacity. The motor maximum speed is 4500 RPM (75 rotation/second) and the maximum power is reached during the seeking phase is about 6.4w.

I drive the Brushless DC motor (BLDC) without using any controller, only with a STM32F4 microcontrollers and a power stage. The signals are handled by microcontrollers.
If you want to see the video go to the bottom of this page.
Here's the characteristic of the BLDC :

S T 3 1 7 2 2 A   M E D A L I . 1 7 2 2    SEAGATE

                                                      Native|  Translation


Form                 3.5"/SLIMLINE         Cylinders        | 3303|     |

Capacity form/unform  1700/      MB        Heads           4|   16|     |

Seek time   / track  12.0/ 2.0 ms          Sector/track     |   63|     |

Controller           IDE / ATA3 ULTRA      Precompensation

Cache/Buffer           128 KB MULTI-SEGMEN Landing Zone

Data transfer rate   10.000 MB/S int       Bytes/Sector      512

                     33.300 MB/S ext DMA33

Recording method     RLL 1/7                        operating  | non-operating


Supply voltage     5/12 V       Temperature *C         5 55    |    -40 60

Power: sleep              W     Humidity     %                 |

       standby        1.0 W     Altitude    km                 |

       idle           4.4 W     Shock        g         5       |     75

       seek           6.4 W     Rotation   RPM      4500

       read/write     4.5 W     Acoustic   dBA        34

       spin-up            W     ECC        Bit   YES

                                MTBF         h     300000

                                Warranty Month        36

Lift/Lock/Park     YES          Certificates

Circuit diagram

Below the circuit diagram allowing the rotation of the BLDC motor.

The STM32F407VGT6 microcontroller have a high speed clock that reach the 168Mhz. I use it at 160Mhz to obtaint a decimal value of the period cycles (6.25ns). It makes the work easy when handling with the PWM and timers.

I choose 3 PWM outputs from the microcontroller to drive the HDD motor. those signals passes through a power stage to convert the energy levels form 3.3Volts and few milliamperes to 12Volts and few amperes. This power stage is the L298 circuit DUAL FULL-BRIDGE DRIVER.
The outputs of the L298 circuit are connected directly to the motor wires.

Below the shape of the signals which let the motor run:

These signals are square with duty ratio of 1/2 and are shifted by 1/3 of period.

Counting motor speed

To determine the number of rotation per minute i use a CYN70 circuit. this is a reflective sensor that includes an infrared emitter and phototransistor in a leaded package which blocks visible light.

As you can see in the photo above i remove the HDD head reader and i replace it by a homemade reflective sensor reader support. this new sensor reader is made with wood in such a way that the distance between the circuit and the platter is lower than 5mm as mentioned in in the CNY70 datasheet.

The principle of reflection is used to determine the motor speed. so i stick an electrical black tape onto the platter and the CNY70 sensor detect it in every rotation because of light-cutting.
The infrared light emitted by the phototransistor is reflected by the platter, but when black tape will be bellow the sensor, there will no reflexion because of the black color which absorb the light.

Principle of reflexion :

The microcontrollers use a PWM as input to calculate the time separating between two light-cutting. this value is the time that needs the motor to do a rotation.
The number of revolution per minutes RPM can be determined by dividing 60 by the PWM period value(Second).
here's an explained schema of the circuit:

The programming language used with this microcontroller is the C.

Running the motor

The motor needs to be started at a low speed and slowly accelerated to the final maximum speed (4500 RPM).
To reach the maximum speed the motor need to pass through several phases. In my cases i passes by 6 phases .
here's how the motor speed is increasing:

Decreasing the signal period means increasing the motor speed.

In the beginnig when the motor has just running at low speed we deacrease the signal period with big value . but when the motor speed is on the rise the signal period decreasing value should drop otherwise the BLDC motor may stop.

Debugging and results

The STMStudio is a real time debugger that allows sampling and visualizing in real time user's variables while the microcontrollers is running.
The screen shot bellow i took it from the debugger tools. it is diplaying in real time the motor speed versus time.

We can identify the 6 phases before reaching the maximum speed, then the motor runnig for a while at around 4500 RPM and finally the speed drop because of cutting off the power.

RPM Begin

RPM Ends

Signal period decreasing/rotation

Phase 1

60 RPM

80 RPM

3,5 ms

Phase 2

80 RPM

400 RPM

625 us

Phase 3

400 RPM

1200 RPM 

125 us

Phase 4

1200 RPM 

1845 RPM

31,25 us

Phase 5

1845 RPM

4000 RPM

1,25 us

Phase 6

4000 RPM

4615 RPM

625 ns

We note that in every rotation the signal period is decreasing and the speed is increasing.

The Signal period decreasing/rotation value drop when the motor speed is on the rise (3.5ms --> 625us -->125us --> 31.25us --> 1.25us --> 625ns). it mandatory to drop this value in order to reach the maximum speed .


You can download the code Here. The motor's rotation is handled automatically by the program inside the microcontroller and doesn't need an external intervention like push button or something like that.
If you have a different HDD motor than the one I have (different maximum speed, dimension ...) you might have to change some setting like timer period, prescaler ... to fit with your motor. The timer configuration are inside the Function.c file.
The 6 steps necessary to the motor to reach his maximum speed are represented by the steps variable inside the main.c, so you can change the length and signal period decreasing in every rotation of each phases.

The connection between the microcontroller and the HDD motor are:
PA0 (TIMER2-output) -> connected to the FIRST Brushless motor input COIL
PB4 (TIMER3-output) -> connected to the SECOND Brushless motor input COIL
PB6 (TIMER4-output) -> connected to the THIRD Brushless motor input COIL
PA1 (TIMER5-input) -> connected to the infrared sensor


I replaced the HDD platter by a propeller in order to test the BLDC's motor if it have enough power to run it.
Unfortunlly the motor doesn't reach 2000 RPM befor stopping. this kind of propeller need a more powerfull BLDC.