2012 Ford Focus rumbles when turned off

When car is turned off a few times it has rumbled and knocked making anyone around turn and stare of course when I take it in it doesnt do it.