This right here saved my life! Months of work close to paying off. Results soon both on here and on my more serious profile
\(\dot q^\*_j= \operatorname{clamp}\!\left( \frac{\operatorname{wrap}(q^\*_j-q_j)} {H}, -8,\;8 \right), \qquad H=\max(t_{\rm contact},\,80\text{ ms})\)