...when the Apollo CSM translates to dock and extract the LM, they rotate, and then all of a sudden stop once they've flipped 180 degrees and are in line with the LM. How does this work? Is the RCS hooked up to the computers / gyros that let it know its position and when to fire thrusters to decelerate and stop at a specific point?...
I don't recollect much exterior footage of the CSM actively maneuvering during S-IVB or LM proximity operations. By "all of a sudden stop" the spacecraft was controlled by the Digital AutoPilot. The CSM pilot watches the 8-ball and maybe digital attitude indicators on the DSKY. The instant he releases the ACA hand controller the DAP will halt all motion.
If you mean the visual appearance of the LM "snapping" to a stop after an attitude change (esp. as seen during the docking phase after lunar ascent on Apollo 11), this is a combination of the DAP (Digital AutoPilot) plus (a) low motion rate on the combined LM or (b) higher motion rate on the low-mass ascent stage in lunar orbit. It may also be visually exaggerated by a low frame rate on the film camera. The DAP was really a digital fly-by-wire system, the term "autopilot" is misleading.
The ascent stage rotation or pitch motion does not really stop instantly, but it can look that way. The LM RCS were located on the ascent stage, yet had enough impulse to control a fully-fueled heavy combined LM vehicle. So even the heavy vehicle - if in a slow rotation rate - will appear to stop pretty fast and if the film camera was at 10 fps or slower, that visual jerk will be magnified. The RCS are fixed-thrust at approx 100-lb force, not throttleable.
The RCS could be "blipped" for a few milliseconds so in theory using pulse-width modulation you could effect a more gradual acceleration in attitude. However the RCS were inefficient in that mode so I think the DAP would just do one big firing to achieve the rate commanded by the hand controller.
For the "J" missions the total LM weight was about 36,700 lbs. By contrast the LM ascent stage at rendezvous was only about 5,700 lbs. In the lunar orbit rendezvous phase, the RCS (sized for good control over the heavy combined LM) will initiate and halt motion on the light LM ascent stage very fast.
I think the normal RCS mode was "rate command/attitude hold". So more displacement on the ACA handgrip produced a faster rate. Then when the stick was released, the DAP system will automatically halt that motion.
Based on the info in AIAA paper 69-892 ("Manual Attitude Control of the Lunar Module" by Robert F. Stengel, 1969), the depleted ascent stage had an inertia of 4400 kg-m^2. The pitch RCS jets produced torque of 746 Nm^2. If my calculation is correct that implies a pitch acceleration of about 10 degrees per sec^2, which is *really* fast:
http://www.stengel.mycpanel.princeton.edu/AIAA69LM892.pdfI think under normal conditions the max angular attitude rate was 1 deg/sec, which could be achieved with a 1/10th sec RCS firing, which might fall between two film frames at 10 fps. If that is correct it would corroborate why the LM ascent stage attitude rates visually go from motionless to moving then "jerk" to an instant stop. It's the combination of digital control, low vehicle mass, high torque from the RCS and slow film frame rate.