.OpenBLDC.Blocks.DetectCommutationIntBEMFext

Information

This block determines the time when the next commutation has to occur by detecting the zero crossing and (if enabled) the slope of the voltage of the open motor phase. The back-EMF is sampled with an ADC. The ADC callback is executed each time its buffer is (half-) full, i.e. when ...cbStart .... The ADC buffer is then evaluated by for f in 1:bufsize loop... Depending on the selected PWM method, it may be required to evaluate only the samples during t_on or t_off. Furthermore some potentially noisy samples that are close to PWM switching events can be droped by adjusting the dropnoisysamples parameter. All good samples are stored in a circular buffer of the size NREG where yreg[NREG] are the sampled values and xreg[NREG] are their respective indexes. The voltage zero crossing is determined by applying a linear fit to all good values in the buffer. The index of the calculated zero crossing (from the beginning of the ADC measurement) is k_zc. This is not neccessarily the index of a valid sample. The time of the next commutation event time_nextblock is either calculated by evaluation of the voltage slope (if modeSlope) or the duration of the last voltage zero crossing. Note that the second method will work robustly with the most motors while the first method potentialy provides better dynamic response / acceleration while it may cause trouble with motors with an "ugly" back EMF shape.

TODO:

1. Investigate the spike that occurs single leg mode as in Test.Commutation.IntBEMF3.


Generated at 2024-12-03T19:25:34Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos