Abstract: An improved cryogenic compressor with piston position sensing is disclosed. Precision optical encoders using incremental or absolute encoding are incorporated into a compressor to allow for accurate position sensing of moving elements within the compressor. Appropriate electronic circuitry is used to interpret the position data to allow the user modify the frequency and stroke of the piston within the compressor. The invention may be used in systems with multiple compressor pistons or for position data for balance weights or displacers in a cryogenic refrigeration system.