Tribological properties of transition metal nitride and metal carbide coatings correlation with microstructure and mechanical properties