Evaluates the input signals from an IncrementalEncoder:
y[1]
= 1 pulse per revolution with a length of 2*pi/(4*pRev)
y[2]
= pRev
pulses per revolutiony[3]
= pRev
pulses per revolution, displaced by 2*pi/(4*pRev)
and determines mechanical angular velocity w
and mechanical angle phi
:
During the samplePeriod all rising and falling edges of A-track and B-track are counted.
The direction of rotation has to be detected by a logic from the values of A-track and B-track.
From the time span between first and last edge within the samplePeriod and the count of edges,
the angular velocity can be calculated: w=(count - 1)*2*pi(4*pRev)/(t_last - t_first)
.
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).