MotoHawk:Blocks:Frequency In

From MotoHawk
Jump to navigationJump to search

Frequency Input

This MotoHawk™ block determines the frequency of a digital input signal.

Block ID

motohawk_frequency_in

Library

MotoHawk_lib/Advanced Digital I/O

Description

Frequency In.PNG

The output signal is in units of 0.01 Hz, and is based on the last sample period from edge to edge.

Choose the pin resource. Perform Duty Cycle Measurement: Add extra code to perform a duty cycle measurement along with period measurement. Note: Using the duty cycle option adds additional CPU usage.

Provide Trigger: Provide a trigger after each N pulses.

Alias Protection: Alias protection is a characteristic that protects low frequency inputs from indicating the incorrect frequency when the frequency is very near the low threshold. It places execution burden upon ControlCore because each edge results in the servicing of an interrupt. It should not be employed on inputs that consistently sit above the low frequency threshold under normal operation. The low frequency threshold is set at approximately 1.2 Hz for MPC5xx based modules. Alias protection will provide guaranteed uniform frequency response for all frequencies between 0 Hz and 39000 Hz. Inputs without alias protection may report incorrectly when they first start up, when they stop and while their frequency is near the low frequency threshold.

The duty cycle describes the elapsed time between the occurrence of the non-synchronous edge and the synchronous edge. The synchronous edge is configured during the creation of the resource via the 'Edge Detect' attribute. 4096 represents 100%

Edge Detect selects whether the period is measured between rising edges or falling edges.

Alias Protection adds a calculation to check for spurious edges, and attempts to adjust for aliasing.

Minimum Frequency (Hz) is an advisory attribute indicating the minimum frequency expected to be observed on the input. It allows ControlCore to configure itself optimally. Some implementations may use this attribute as the zero detection threshold and report any frequency lower than this value as zero.

Signal Interface selects between a simple logic-level digital input and a variable-reluctance signal, such as a hall-effect sensor.

Block Parameters

Parameter Field Values Comments/Description
Name Alpha-numeric text, single-quote enclosed Enter a unique resource name. This can be the name of the sensor that is being read. No special characters, such as spaces, dashes, commas (underscore allowed). If no name is given, a name is inherited, either from the pin (resource) name or the VarDec name, depending on whether calibrateable IO is selected.
Resource Drop-down list

Select from available resource listings, as appropriate. Note that the CAM input on MPC5xx modules can't be used if an [EncoderDefinition.html Encoder Definition] block exists in the model.

Perform Duty Cycle Measurement Perform/Do not Perform Choose whether or not to perform duty cycle measurement. Enabling this adds extra code to perform a duty cycle measurement along with period measurement. Note: This option adds additional CPU usage.
Provide Trigger after N Pulses Check box (enable) Select this to enable a trigger signal upon achievement of a set number of signal pulses.
Maximum N Numeric Set a maximum for N number (pulses)
Edge Detect Rising/Falling Select edge of signal to be used for frequency (select best or more consistent edge)
Alias Protection Enable/Disable Enable to allow Alias protection to protect low frequency inputs (noise) from creating false counts.
Minimum Frequency Positive numeric The minimum expected frequency to be detected. Values below this frequency may not be seen.
Signal Interface Digital / VR input Select type of signal to expect
Allow I/O pin to be calibrated from MotoTune Check box Name, Access Levels and MotoTune Group Strings fields available
Name Alpha-numeric text, single-quote enclosed Name as displayed in block, MotoTune, for block. No special characters, such as spaces, dashes, commas (underscore allowed).
Read Access Level 1-4 Sets security level 1 lowest, 4 highest, for user access to read value
Write Access Level 1-4 Sets security level 1 lowest, 4 highest, for user access to write value
Pin Group String Alpha-numeric text, single-quote enclosed Set Folder name and hierarchy as displayed in MotoTune. Use "|" character between folder names to delineate subfolder structure.
Calibration Parameters Group String Alpha-numeric text, single-quote enclosed Set Folder name and hierarchy as displayed in MotoTune. Use "|" character between folder names to delineate subfolder structure.