Intelligent selection of grinding conditions