MOSS – Motion smart senzor
Block SymbolLicensing group: ADVANCED
Function Description
The MOSS block implements an advanced filter for incremental (quadrature) position sensors.
The block requires special hardware, as correct operation necessitates knowledge not only of
the current value from the sensor but also the timestamp of the last pulse, the direction of
movement at the last pulse, and the timestamp of the reference moment (from the same source
as the pulse timestamp). The output of the block is not only the filtered position but also
the velocity and acceleration. For proper operation, it is necessary to appropriately
select the alpha parameter. A smaller value reduces noise but increases the signal
delay.
If no pulse is received in the stalled time interval, sensor is considered stopped and the outputs (pos, vel, acc) are set to 0. If pos is greater then maxpos, the internal position processed by the Kalman filter is decremented by an integer multiple of maxpos and incremented back for output. This causes the filter algorithm to calculate small enough numbers and not reduce accuracy due to rounding errors. The default value should not normally be changed. If no pulse is received for a long time, the predictor output will drift. To overcome this drift, if no pulse is detected for longer then mindivert time, the output position is clamped to 1 pulse from input (measured) position.
Note 1: It may seem impossible to determine the position more accurately than the quantization error (1 pulse) of the measurement, but knowing the velocity allows for a more accurate estimation of the position. Furthermore, it may appear that velocity cannot be determined more accurately than as a ratio of the number of pulses and the difference in timestamps, but by plotting both signals, it is evident that the MOSS signal improves. Determining acceleration through differentiation leads to utterly unusable values.
Note 2: Internally, the block implements a Kalman filter for a system with 2 integrators (i.e., input acceleration, output position). The filter is discretized anew in each period, where the discretization period is the current difference in timestamps. To derive the filter, it is necessary to know the input and output disturbances. If we consider white (Gaussian) noise, it suffices to know their ratio, which is the alpha parameter.
This block does not propagate the signal quality. More information can be found in the 1.4 section.
Input
tsPulse | Time stamp of last pulse | DWord (U32) |
cntPulse | Last state of pulse counter | DWord (U32) |
tsSync | Time stamp of synchronization pulse | DWord (U32) |
cntCorr | Last pulse correction | Double (F64) |
flags | Input status flags (1: POS, 2: NEG, 4: RUN) | DWord (U32) |
R1 | Block reset | DWord (U32) |
Parameter
freq | Frequency of source time stamp [Hz] 0.0 100000000.0 | Double (F64) |
stall | Time for activation of halt state [s] 0.0 0.08 | Double (F64) |
alpha | Design parameter of Kalman filter 0.0 200.0 26.0 | Double (F64) |
maxpos | Rounding error optimization of Kalman filter 0.0 1e+10 | Double (F64) |
mindivert | Time for activation of predictor diversion limiter [s] 0.0 0.003 | Double (F64) |
Output
pos | Filtered position | Double (F64) |
vel | Filtered velocity | Double (F64) |
acc | Filtered acceleration | Double (F64) |
status | Output status flags (1: POS, 2: NEG, 4: RUN, 8: INIT, 16: PULSE, 32: STALLED, 64: DIVERT) | Long (I32) |
iE | Error code | Error |
[Previous] [Back to top] [Up] [Next]
2024 © REX Controls s.r.o., www.rexygen.com