Repository navigation
Encoder (HALL) block
Implements the algorithm that estimates the BLDC angular position based on its HALL sensor's measurements.
This block has no parameters.
halls: [3x1] array containing the measurements of each hall sensor, i.e., [hall1 ; hall2 ; hall3].
- Hall1: active between 300 and 120 degrees
- Hall2: active between 60 and 240 degrees
- Hall3: active between 180 and 360 degrees
theta: Angular position of the BLDC in electrical degrees (capped between 0 and 360 degrees, e.g., 700 degrees would actually be 340 degrees).
direction: Signal that has the value '1' if the BLDC is rotating in the clockwise direction and '0' if it is rotating in the counterclockwise direction.
The BLDC's rotor (the BLDC block is not actually in this model, but its output is being simulated by a Sine wave generator) describes a sinusoidal trajectory, and the encoder estimates its position based on the hall measurements. To compare between the real and the estimated angular position it is necessary to cap the real one between 0 and 360 degrees.
The BLDC's rotor describes an arbitrary trajectory and the encoder estimates its position based on the hall measurements. To compare between the real and the estimated angular position it is necessary to convert the BLDC's Theta_m output from mechanical radians to electrical degrees and cap it between 0 and 360.