This block "catches" a rotating BLDC motor measuring its electrical angle to which is required as initial value to start the sensorless commutation algorithm. The result is corresponds to a hall sensor measurement. Furthermore the voltage constant KV of the (one pole pair equivalent) motor is determined.
The algorithm looks for zero crossings of the difference of the three terminal voltages. When a zero crossing occurs, the electrical angle is known. To determine the direction of rotation, dir, two consequtive zero crossings are required.
There are serveral methods to determine the voltage constant of the motor. The easiest method is measuring the maximum difference voltage of one the phases between two zero crossings. Method 2 by measuring the voltages at a zero crossing applying the following equation:
V_max = max(all phases) - min(all phases) / (2*cos(pi/6)).
Then the voltage constant KV can be calculated using the duration between the two zero crossings.
KV = V_max * 6 * (time-time_zc1).
Note that this is the equivalent KV for a 1 pole pair delta connected motor.
The method 3 integrates the voltage of a phase after a zero crossing. This how it is measured using the back emf integration method.