A method for controlling the rotational speed of an electric motor driven air compressor that supplies compressed air to a pneumatically operated system of a vehicle, the method comprising the preliminary steps of: a) determining an efficiency (e) of the air compressor for different values (Si) of the rotational speed of the air compressor, the efficiency (e) of the air compressor corresponding to a ratio between a pneumatic power produced by the air compressor and a power given to the air compressor; b) determining one or several specific values (S2, S4) among said different values (Si), for which the efficiency (e) of the air compressor is higher than a threshold value (emin) and/or comparatively higher than those determined for values (S1, S3) close to said specific value(s) (S2, S4); the preliminary steps a) and b) being preferably implemented only once; and comprising the repetitive step of: c) determining an air consumption rate of the pneumatically operated system receiving compressed air from the air compressor; the method being characterised by comprising the further repetitive steps of: d) determining a minimum rotational speed (Smin) of the air compressor to obtain an air production rate of the air compressor that is equal or substantially equal to said determined air consumption rate; e) determining if the specific value or at least one of the specific values (S2, S4) is greater than said determined minimum rotational speed (Smin); f) if no specific value is greater than said determined minimum rotational speed (Smin), controlling the rotational speed of the air compressor based on said minimum rotational speed (Smin); g) if only one specific value is greater than said determined minimum rotational speed (Smin), controlling the rotational speed of the air compressor based on said only one specific value; h) if a plurality of specific values (S2, S4) are greater than said determined minimum rotational speed (Smin), determining the specific value with the best efficiency among said plurality of specific values (S2, S4) and controlling the rotational speed of the air compressor based on said specific value with the best efficiency. a) determining an efficiency (e) of the air compressor for different values (Si) of the rotational speed of the air compressor, the efficiency (e) of the air compressor corresponding to a ratio between a pneumatic power produced by the air compressor and a power given to the air compressor; b) determining one or several specific values (S2, S4) among said different values (Si), for which the efficiency (e) of the air compressor is higher than a threshold value (emin) and/or comparatively higher than those determined for values (S1, S3) close to said specific value(s) (S2, S4); the preliminary steps a) and b) being preferably implemented only once; and comprising the repetitive step of: c) determining an air consumption rate of the pneumatically operated system receiving compressed air from the air compressor; the method being characterised by comprising the further repetitive steps of: d) determining a minimum rotational speed (Smin) of the air compressor to obtain an air production rate of the air compressor that is equal or substantially equal to said determined air consumption rate; e) determining if the specific value or at least one of the specific values (S2, S4) is greater than said determined minimum rotational speed (Smin); f) if no specific value is greater than said determined minimum rotational speed (Smin), controlling the rotational speed of the air compressor based on said minimum rotational speed (Smin); g) if only one specific value is greater than said determined minimum rotational speed (Smin), controlling the rotational speed of the air compressor based on said only one specific value; h) if a plurality of specific values (S2, S4) are greater than said determined minimum rotational speed (Smin), determining the specific value with the best efficiency among said plurality of specific values (S2, S4) and controlling the rotational speed of the air compressor based on said specific value with the best efficiency. d) determining a minimum rotational speed (Smin) of the air compressor to obtain an air production rate of the air compressor that is equal or substantially equal to said determined air consumption rate; e) determining if the specific value or at least one of the specific values (S2, S4) is greater than said determined minimum rotational speed (Smin); f) if no specific value is greater than said determined minimum rotational speed (Smin), controlling the rotational speed of the air compressor based on said minimum rotational speed (Smin); g) if only one specific value is greater than said determined minimum rotational speed (Smin), controlling the rotational speed of the air compressor based on said only one specific value; h) if a plurality of specific values (S2, S4) are greater than said determined minimum rotational speed (Smin), determining the specific value with the best efficiency among said plurality of specific values (S2, S4) and controlling the rotational speed of the air compressor based on said specific value with the best efficiency.