blockDetectCommutationIntBEMFext_old
Detects sensorless when commutation is required by back EMF integration - extended method
Extends from DetectCommutationPartial (I/O ports for commutation detection algorithm).
Information
This block implements the extended back-emf integration method.
It determines the time of a zero crossing by evaluating the slope of the back-emf. In the next step, the slope is also used to calculate the time when the next commutation is required.
TODO:
1. Implement the ADC-DMA-method and evaluate the measurements only when the ADC callback is executed.
2. In case the single-leg-PWM is applied, evaluate only the measurements when high side switch is on.
3. In case the function is called late, i.e. the zero crossing already happened, use the earliest voltage measurements and slope to determine when the zero crossing occured.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.SIunits.Duration | DelayCommutation (from DetectCommutationPartial) | 5e-005 | Delay commutation |
| Real | minEMF (from DetectCommutationPartial) | 0.5 | Minimum EMF for good speed |
| Boolean | sampleAll | true | Sample only on pulses when false |
| Integer | bufsize | 10 | Size of buffer |
| Real | period_adc | 1e-6 | |
| Modelica.SIunits.Time | Ts_ADC | 1e-6 | Sample rate of ADC |
| Real | vdivider | 3.6/13.6 | Voltage divider of phase voltage |
| Integer | NREG | 10 | Number of elements for a valid regression |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput[3] | bridgeState (from DetectCommutationPartial) | ||
| Modelica.Blocks.Interfaces.RealInput[3] | v (from DetectCommutationPartial) | Voltage per phase | |
| Modelica.Blocks.Interfaces.RealInput | v_dc (from DetectCommutationPartial) | dc link voltage | |
| Modelica.Blocks.Interfaces.BooleanInput | senseBEMF (from DetectCommutationPartial) | BEMF sensing active | |
| Modelica.Blocks.Interfaces.BooleanOutput | y (from DetectCommutationPartial) | Commutate when true | |
| Modelica.Blocks.Interfaces.BooleanOutput | speedOK (from DetectCommutationPartial) | Sufficient EMF for good commutation | |
| Modelica.Blocks.Interfaces.RealInput | KV (from DetectCommutationPartial) | Voltage constant | |
| Interfaces.PwmControlBusConnectorIn | pwmControlBusConnectorIn (from DetectCommutationPartial) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Integer[3] | bridgeStateInt (from DetectCommutationPartial) | ||
| Integer | senseBridgeID (from DetectCommutationPartial) | ||
| Real | senseBridgeSign (from DetectCommutationPartial) | ||
| Integer | v_dc_int | ADC value of dc link voltage | |
| Integer | k_cb_ADC | Increments at each the ADC callback | |
| Integer | sumx | computes sum of x (time-axis) | |
| Integer | sumx2 | computes sum of x**2 | |
| Integer | sumxy | computes sum of x * y | |
| Integer | sumy | computes sum of y | |
| Integer | sumy2 | computes sum of y**2 | |
| Integer | n_reg | number of elements in list | |
| Integer[NREG] | yreg | Circular buffer for y | |
| Integer[NREG] | xreg | Circular buffer for x | |
| Integer | k_sample | Sample in the present commutation cycle | |
| Integer | pwm_dutyCycle_int | ||
| Integer | pwm_period_int | PWM period relating to period_adc | |
| Integer | k_pwm_period | Indicates if the pwm sample ocurred at pwm-on | |
| Integer | k_zc | Sample when the zero crossing occurs | |
| Integer | KV_int | Integer equivalent of KV | |
| Real | duration_zc2comm_int | Duration from zero crossing to next commutation | |
| Real | m_reg | Slope | |
| Real | b_reg | y-intercept | |
| Real[bufsize] | v_buffer | ||
| Integer | zc_index | Index in the ADC-buffer where the zero crossing occurs | |
| Real | duration_zc2comm | Duration from zero crossing to next commutation | |
| Real | time_blockstart | Time when last block started | |
| Real | time_nextblock | Time when next block (commutation) will occur | |
| Real | time_zc | Time when last zero crossing occured | |
| Real | bemf | Back EMF at the open phase | |
| Real | intBEMF | int(BEMF)! | |
| Real | maxBEMF | Max EMF in this cycle | |
| Real | v_sense | Sensed voltage at the open motor pin, referenced to v_dc/2 | |
| Boolean | y_neu | ||
| Sensors.ADCs.AdcSingleBufferedInteger | adcSingleBufferedInteger | ||
| Modelica.Electrical.Analog.Basic.Ground | ground | ||
| Modelica.Electrical.Analog.Sources.SignalVoltage | signalVoltage |