Electric carmaker Tesla Motors Inc (TSLA.O) has agreed to buy Germany's Grohmann Engineering GmbH, which develops automated manufacturing systems for batteries and fuel cells, as the California-based company seeks to expand its production more than sixfold by 2018.