Why do fans spin backwards slightly after they (should) stop? Today, I've decided to observe my PC fan as I shut the computer down. The fan slowly lost angular momentum over time. What I've found really interesting is the fact that the momentum vector change did not stop at the zero vector, but instead flipped its orientation and "went to the negatives", albeit very small in the absolute value compared to the powered spin; this caused the fan's angle to deviate by a few degrees (opposite to the powered spin rotation) compared to the observed angle when momentum was equal to the zero vector.
If I let $\overrightarrow{L}$ be the momentum vector, $\overrightarrow{L}_0$ be the momentum vector at $t_0$ (= poweroff time), and $\overrightarrow{L}(t) = y(t) * \overrightarrow{L}_0$ (with $y_0 = y(t_0) = 1$), then these are the plots of $y$ through the course of time.
Expected fan poweroff behavior:

Observed fan poweroff behavior:

Can anyone explain why may this happen?
 A: Your PC is a box with limited vents for air to enter/exit.  Especially if these clog up with dust, the fan could create a noticeable pressure differential between inside and outside of the box.  After the fan turns off, that equalizes, forcing some air backward through the fan, and causing it to rotate backward.  Maybe.
Another possibly, as pointed out in comments, and since you report much less than a full rotation backward, is that the DC motor running the fan likes to be in certain orientations and not others when it is unpowered, due to alignment of the permanent magnet with other motor parts. As the fan slows down, at some point it passes one of these preferred orientations but lacks the momentum to make it over the hump to the next one, and rotates back.
A: On balance, I think @nielsneilsen's answer is likely the correct one.  But there is another possibility.
Is there a control loop in play?
Almost universally, practical control systems for hitting a desired position, velocity, flow rate or whatever use a PID control loop, sometimes omitting the P or D element depending on the application.  Other control techniques exist, but a PID controller has a number of advantages.

*

*It's very well understood.

*It's very simple to configure.

*It hits the target value without much error.

*It doesn't need a particularly complicated implementation, and can even be built with old-school analogue electronics if you want.

*It remains stable over a fairly wide range of actuator/sensor tolerances, so you don't need to tune each widget individually, making production easy.

*The ramp-up/down time is easily configurable, which can be useful where (as with a motor) a rapid change of output produces a current spike.

One standard feature of a PID controller though is that in order to get the position/velocity/whatever to settle rapidly to where you want, you have some overshoot.

If you have a speed controller on the motor, and it uses a PID loop to govern speed, then stopping the motor will naturally give a small speed in the opposite direction before it comes back to zero.
A: Did the fan really rotate backwards, or merely appear to?  You may be looking at a Wagon-Wheel Effect.  Basically, when a wheel or propeller rotates at a certain speed, particularly if you're using fluorescent lighting, which has a natural flicker to it that isn't always obvious, the object can appear to stop or rotate in the opposite direction.  All the blades of the fan are basically indistinguishable, so between one flicker of the light and the next, one blade has taken the position of the previous, or slightly behind it, making it appear that the blades are moving backwards.  When the fan is at full speed, you can't really see much more than a blur, but as it gets slower, it hits these "wagon-wheel" speeds that coincide with the frequency of your flickering fluorescent lights, and appears to spin in reverse for a bit.
You can also get the effect by filming the wheel/propeller with a camera, since the frame rate of the camera will produce the same effect as a flickering fluorescent does to the naked eye (at different speeds obviously.)
You might be able to tell the difference by using a sharpie to make a mark on one blade, and watching the mark as it spins down.  However, this can still display the effect at certain speeds if the fan makes a complete almost-360° rotation between one flicker and the next, but obviously the fan must be moving much faster for this than it does to get the effect between just one blade and the next.
A: I also think the effect is cogging. This torque is position dependent and its periodicity per revolution depends on the number of magnetic poles and the number of teeth on the stator. Cogging torque is an undesirable component for the operation of such a motor. It is especially prominent at lower speeds, with the symptom of jerkiness.
Cogging torque results in torque as well as speed ripple; however, at high speed the motor moment of inertia filters out the effect of cogging torque.
A: The overshoot behavior you noticed is called cogging and occurs when the magnet arrangement in the motor "catches" the rotating magnetic core of the motor during shutdown and jerks it back to one of the local strong spots in the field.
You can demonstrate this yourself by carefully rotating the fan blade around with your finger when the motor is off. You will notice there are certain rotation angles where the fan wants to come to rest and others which it wants to avoid. If the motor passes one of the preferred spots but fails to rotate far enough to "climb the hill" and snap forward into the next cog spot, the motor will very briefly rotate backwards a fraction of a turn and go "boing-oing-oing-oing" as it settles into that cog position.
A: Hi Reading this is interesting.
The reason that the fan goes backwards is simple.
It is a Direct Current motor which has a capacitor across the power terminals to keep the power factor near to unity. A motor is a wound component which will produce a lagging current so a capacitor is added to bring that current nearer to unity (A capacitor creates leading current).
When the power is switched off, the capacitor will discharge through the motor in reverse polarity, making it run backwards for a short while..
A: Now this may be the dumbest idea in history, so at least read this for the potential entertainment value.
I have espoused the theory that this motion occurs because of the compressability and momentum of air. Of course I agree with the cogging effect on motors with permanent magnets, but i believe this to be a different force.It seems the more efficient the fan, the more air the blades affect, and the more prominent the backward motion after the stopping point. Ceiling fans with non-permanent magnet A/C motors do this very visibly.
I have not observed this motion on non-bladed rotating masses. The idea is based on the assumption that there is a tiny bit of air compression on the leading edge of a rotating blade, and a tiny bit of vacuum on the trailing edge. When the fan stops, the air pressure differential pulls it back a tiny bit, and if the fan is free enough, it will reverse a little.
A: I just have guesses.
Is there any sort of spring in the motor, or anything spring like? For example a fan belt could stretch if it was trying to turn a stiff bearing. You might discover this by trying to spin the fan by hand and seeing if it turns the other way when it stops.
Another source of springiness could be electrical. A power smooths variations in input power. When you turn off the power, the power supply uses energy in an inductor or capacitor to keep going for a bit.
The fan is controlled by a feedback system. When the power is turned off, perhaps the input to the feedback system drops to $0$, telling the feedback system to set the fan speed to $0$. The fan is still spinning, so perhaps the feedback system uses the last bit of power from the power supply to slow the fan. Perhaps it overshoots. You might see this with an oscilloscope.
A: (Answering for completeness, although this isn't the specific case that you observed where the fan only spins less than one rotation.)
It's possible that it does it deliberately. In 2011 MSI released a graphics card which automatically "de-dusted" its fan to improve cooling. It did that by spinning backwards at full power for about 30 seconds on start-up. It's possible that this idea has made its way into other parts of computer hardware or other fans, and it would functionally work to do the de-dusting on/after shutdown (although startup or intermittently during normal running are better ideas and more likely). However, this would result in certainly more than 1 full rotation, since the de-dust spin should be fast enough to dislodge dust.
