Draft: Spasm Detection
Calculating ToolJerk by differentiating ToolAccel (and filtering). This is used in the control loop to set SpasmDetected, if the scalar ToolJerk exceeds SpasmThreshold.
Writing bool "false" to SpasmDetected resets it. SpasmThreshold is also settable.
Temporary mods to Example04 show SpasmThreshold ~= 1000 m/s^3 is effective to detect spasms without interfering with normal operation.
Edited by Brian Zenowich