Sample hal for using hyst. This example cleans up the spindle RPM (averages over 200 samples) and provides output in 50RPM steps with no noise or bobble.

loadrt hyst names=hyst-rpm
...
addf hyst-rpm                 servo-thread
...
net spindle-speed     => abs.0.in      <=   hm2_7i76e.0.encoder.00.velocity
net spindle-speed-abs => motion.spindle-speed-in <= abs.0.out

# Convert spindle speed from RPS to RPM
setp     scale-speed.gain 60
net      spindle-speed-abs => scale-speed.in
# Cleanup the RPM signal
setp hyst-rpm.gain 0.005 # 200 1ms samples
setp hyst-rpm.deadband 0.7
setp hyst-rpm.step 50.0
net	 spindle-speed-rpm-raw => hyst-rpm.in <= scale-speed.out
net	 spindle-speed-rpm     <= hyst-rpm.out

