Hi,
Regarding your question, the angularSpeedScale/angularSpeedScaleShift are just parameter, as you know that the motor speed unit is RPM(revolutions per minute), but you just divide the edge number by tick number, so there must be a scale, the scale is related to bus clock cycle time the TMR1 counts, the total edge numbers per revolution.
I attach an1931 whiuch is written by the same author, it describes how to calculate the scale k.
Hope it can help you.
BR
XiangJun Rong