In ecap module how does capture event selection works?
5 views (last 30 days)
Show older comments
I want to mesure position of Bldc motor using hall sensor for FOC.As a refrence model I am using mcb_pmsm_foc_hall_f280049c.slx.How does capture event selection works? Below are the image of event slection block of 3 hall sensor.
0 Comments
Answers (1)
Shivam Gothi
on 17 Sep 2024
Hello @Harshil Dodia
Three Hall sensors (A, B, C) are utilized to determine the rotor's position. Throughout one complete rotation of the rotor, the state of each Hall sensor transitions from (0 to 1) or (1 to 0). Consequently, there are six possible combinations of Hall states during a full rotation, which follow the sequence ABC: (001, 010, 011, 100, 101, 110), as illustrated in the accompanying figure.
With this foundational understanding, it becomes easier to comprehend the functionality of the blocks mentioned in the attached screenshot:
1) Code Generation Block:
The “eCAP” module is employed to capture the "ON" and "OFF" durations for each Hall sensor. Here, "ON" time signifies the period during which the Hall sensor reads "1," while "OFF" time indicates when it reads "0." For instance, for Hall sensor A, the “eCAP” module should access the “eCAP1” register and record the two time intervals (T1 and T2) corresponding to the changes in Hall value during a 360-degree electrical rotation cycle.
Similarly, eCAP2 and eCAP3 registers should read the Hall values and record the time intervals for Hall sensors 2 and 3 respectively.
Please refer to the below documentation for detailed explanation.
In summary, the block named "Code generation" will return the ON and OFF times for each Hall sensor, as depicted in the image below:
2) Capture Event Selection Block:
A selector switch is employed in the model shared in the screenshot. When the selector switch receives an input value of "1" at its second input, it will pass the first signal (T1 in this case). Conversely, when it receives an input value of "0" at its second input, it will pass the third signal (T2 in this case). The "Capture event block for eCAP1" outputs "1" if the Hall state is "3" (i.e., 011) or "5" (i.e., 101). In all other cases, it outputs "0."
3) Hall validity block:
The Hall validity block is evaluated only when there is a change in the Hall state. It performs checks to ensure that the outputs from the Hall sensors are valid and that no sensors are malfunctioning. This block requires information about T1 and T2 to determine the time elapsed between the Hall state change and block execution.
For more information on the "Hall validity” block, please refer to the documentation below:
I hope this helps!
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!