automatic indexing function

The magnetic pole position is identified and the commutation sequence for winding energization is created by hall sensor signals. 
However, the magnetic pole position is automatically identified without using a hall sensor in this function.