sorry, i did not get it.
can you explain more about it. i don't know which equation i have to use. The source code that i posted before is the commutation states in 3 phase BLDC motor control. i want to make the motor run in the 3 speed, fast,medium,and slow. to do that, i just change the frequency for the commutation states such as
EvaRegs.T1PR = 0x493E;//1kHz (FAST)
EvaRegs.T1PR = 0x30D4;//3kHz (MEDIUM)
EvaRegs.T1PR = 0x1D4C;//5kHz (SLOW)
EvaRegs.T1PR = 0x14ED;//7kHz (SLOW-STOP)
but the commutation states are still the same.
as a result, the motor run but not as expected. can anyone help me how to fix this problem?