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

TypeNameDefaultDescription
Modelica.SIunits.DurationDelayCommutation (from DetectCommutationPartial)5e-005Delay commutation
RealminEMF (from DetectCommutationPartial)0.5Minimum EMF for good speed
BooleansampleAlltrueSample only on pulses when false
Integerbufsize10Size of buffer
Realperiod_adc1e-6
Modelica.SIunits.TimeTs_ADC1e-6Sample rate of ADC
Realvdivider3.6/13.6Voltage divider of phase voltage
IntegerNREG10Number of elements for a valid regression

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInput[3]bridgeState (from DetectCommutationPartial)
Modelica.Blocks.Interfaces.RealInput[3]v (from DetectCommutationPartial)Voltage per phase
Modelica.Blocks.Interfaces.RealInputv_dc (from DetectCommutationPartial)dc link voltage
Modelica.Blocks.Interfaces.BooleanInputsenseBEMF (from DetectCommutationPartial)BEMF sensing active
Modelica.Blocks.Interfaces.BooleanOutputy (from DetectCommutationPartial)Commutate when true
Modelica.Blocks.Interfaces.BooleanOutputspeedOK (from DetectCommutationPartial)Sufficient EMF for good commutation
Modelica.Blocks.Interfaces.RealInputKV (from DetectCommutationPartial)Voltage constant
Interfaces.PwmControlBusConnectorInpwmControlBusConnectorIn (from DetectCommutationPartial)

Components

TypeNameDefaultDescription
Integer[3]bridgeStateInt (from DetectCommutationPartial)
IntegersenseBridgeID (from DetectCommutationPartial)
RealsenseBridgeSign (from DetectCommutationPartial)
Integerv_dc_intADC value of dc link voltage
Integerk_cb_ADCIncrements at each the ADC callback
Integersumxcomputes sum of x (time-axis)
Integersumx2computes sum of x**2
Integersumxycomputes sum of x * y
Integersumycomputes sum of y
Integersumy2computes sum of y**2
Integern_regnumber of elements in list
Integer[NREG]yregCircular buffer for y
Integer[NREG]xregCircular buffer for x
Integerk_sampleSample in the present commutation cycle
Integerpwm_dutyCycle_int
Integerpwm_period_intPWM period relating to period_adc
Integerk_pwm_periodIndicates if the pwm sample ocurred at pwm-on
Integerk_zcSample when the zero crossing occurs
IntegerKV_intInteger equivalent of KV
Realduration_zc2comm_intDuration from zero crossing to next commutation
Realm_regSlope
Realb_regy-intercept
Real[bufsize]v_buffer
Integerzc_indexIndex in the ADC-buffer where the zero crossing occurs
Realduration_zc2commDuration from zero crossing to next commutation
Realtime_blockstartTime when last block started
Realtime_nextblockTime when next block (commutation) will occur
Realtime_zcTime when last zero crossing occured
RealbemfBack EMF at the open phase
RealintBEMFint(BEMF)!
RealmaxBEMFMax EMF in this cycle
Realv_senseSensed voltage at the open motor pin, referenced to v_dc/2
Booleany_neu
Sensors.ADCs.AdcSingleBufferedIntegeradcSingleBufferedInteger
Modelica.Electrical.Analog.Basic.Groundground
Modelica.Electrical.Analog.Sources.SignalVoltagesignalVoltage