Soft-closing technique while drilling an petroleum well