Basically, compressor in refrigeration system have following main function
1. Remove low temperature and low pressure refrigerant vapors from cooling coil through suction line.
2. Compress refrigerant vapors by increasing the pressure and temperature resulting in an increase of boiling point of refrigerant.
3. Discharge the refrigerant vapors of high temperature and pressure to condenser through discharge line.
Compression of refrigerant gas may be accomplished by any one of several different means such as positive displacement (reciprocating, rotary, gear types) and centrifugal (centrifugal compressor). The common type of compressors in use are
1. Reciprocating compressor
2. Rotary compressor
3. Centrifugal compressor
4. Screw compressor
5. Scroll compressor
Positive displacement reciprocating compressor is the most commonly used compressor used today. All reciprocating compressors consist of one or more cylinders suitably valved for suction and discharge of the refrigerant gas and containing reciprocating pistons for compression. Downward stroke of piston is responsible for suction of refrigerant gas from suction line and upward stroke of piston compress the gas and discharge it to discharge line through discharge valve 
. Reciprocating compressors are commonly used for small capacities but lower evaporator temperature.Rotary compressor:
Here, an eccentric driven rotor revolves within a housing in which suction and discharge passages are separated by means of sealing blade. When the rotating eccentric first passes this blade and the suction opening, the compressor suction is very small. As the eccentric rotates, this crescent shaped space becomes increasingly larger and thereby draws in a charge of suction gas. When the eccentric again passes the blade, the gas charge is cut off from the suction inlet, compressed and discharged from the compressor. Thus the action of suction and compression continuing at the same time. Rotary compressors have the advantage of being quiet in operation and reasonably free from vibration.Centrifugal compressor:
Unlike the reciprocating and rotary machine it is dependent upon centrifugal force and not positive displacement for compression of gas. Air is drawn into the center of a rotating impeller with radial blades and is pushed toward center by centrifugal force. The radial movement of air results in pressure rise and generation of kinetic energy. This kinetic energy is then converted to increase in potential energy by slowing the flow through diffuser. Because centrifugal units operate best with refrigerants possessing a high specific volume, they are frequently used for extremely low temperature application.
A typical rotary screw compressor has two interlocking helical rotors contained in a housing. Air comes in through a valve and is taken into the space between the rotors. As the screws turn, they reduce volume of the air, thus increasing pressure.Scroll compressor:
Scroll compressor use two interleaving scrolls; one is moving and one is stationary. The moving one doesn’t actually rotate, it orbits. Air gets trapped in the inlet and as the orbiting scroll moves, volume of air trapped gets smaller and smaller thereby increasing the pressure.
Fig: Scroll compressor
 Trott, A. R., & Welch, T. C. (1999). Refrigeration and air conditioning. Butterworth-Heinemann.
 Singh, R. P., & Heldman, D. R. (2001). Introduction to food engineering. Gulf Professional Publishing.