This screen shot is from MC3X60V3A that also uses DRV8313. I fired it up and looked at code because I need a reference as I try to understand the errors I have on the PWM12 board. I use the same circuit, so I am puzled.
Trapsoidal algorith is a 6 step brute force algorithm where you control speed by frequency of the steps. It is easy to code and a quick test to verify drivers & motors.