added aceleration clamping for trapazoidal velocity curves