.BLDC.Utilities.EncoderTimeSpan

Information

Evaluates the input signals from an IncrementalEncoder:

and determines mechanical angular velocity w and mechanical angle phi:

The time span from one edge of the input signals to the next is measured, thus calculating the speed of rotation: 2*pi/(4*pRev)/(time - t0). Taking both rising and falling edges of A-track and B-track into account, 4*pRev edges per revolution are observed. Note that the output is discrete w.r.t. to time, it is not differentiable. The algorithm depends on interrupts (which appear in Modelica as when-clauses). The direction of rotation has to be detected by a logic from the values of A-track and B-track. Note that this algorithm depends on the accuracy of the representation of time, but usually gives better results than counting edges during a time gate.


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