Pre-shaping command functions to control the dynamic impacts in MEMS