I've taken apart a few mirrors in hopes that I can retrofit a memory mirror to my Toyota Solara. I've learned a lot on how they work and will share some of what I found.
Here's a video explaining how mirrors with position memory work:
A brief summary of the video:
Memory mirrors allow different drivers to recall the position of the mirror, and are often used in combination with a memory seat system.
Here's a basic mirror out of a Toyota Camry. It uses a ball joint in the center and two spiraling gears to control the X and Y axis independently.
When you open the casing, you see two 12V DC motors with a spiral gear train attached.
There is no memory function in these mirrors, and therefore this is called an open loop control system, where the position of the mirror is not feedback to a control system.
Here's a mirror motor out of an Acura TL, with memory. Notice how many more wires are coming out of the housing.
When you open it up, you see a very similar gear train system with spiral gears that move up and down to control the motor about the ball joint.
However, there are two pegs, one for each axis, that move up an down against a board in the housing. These are linear potentiometers. The peg bottoms have contacts on them that slide against contacts printed on the board. The tops of the pegs attach to the mirror base.
The potentiometer is always reading a resistance, which goes back to a computer control unit. The resistance corresponds to a position of the mirror within its allowable range of motion.
Here is the mirror motor out of a Toyota Avalon, with memory. The pivot point is in the middle, with two rack style gears sticking upward to control the mirror, contrary to the ones in the Camry and Acura mirrors.
On the inside, the two DC motors are only a few degrees apart and not orthogonal.
This means that one motor is the X axis, and the other motor is the X-Y axis. To move the mirror in the X direction, both motors move. To move in the Y direction, it will be the adjacent component of the right triangle formed between the axis:
If you look closely underneath the circuit board you'll see a tiny gear that's attached to the gear train of the motor. The motor spins this little gear, which turns a potentiometer on the underside of this circuit board.
Here's a closer look underneath that circuit board once de-soldered. The spiral gear inside the potentiometer moves a contact along the inside surface of the board.
A resistance corresponding to position is read by the computer and the position of the mirror is known. This type of mirror is more reliable than the one found in the Acura because it ties directly and internally with the drive-train, as opposed to being attached to the mirror base.
Since there is always feedback in a position memory system from the potentiometers reading a resistance value, the position of the mirror is always monitored by the computer. This is called a closed loop control system.
The computer gets inputs from the mirror switch, as well as the set switches and transmission for reverse tilt option. It then sends power to the corresponding motors until the correct resistance value (and hence position) is reached, as determined by the potentiometers.
Finally, modern control systems use a Proportional, Integral Derivative controller (or a PID controller) to prevent overshoot and oscillation (green line), steady state error (red line). Ideally you want a nice smooth, quick and accurate response (blue line).