MotoHawk:Blocks:ADC Angle Vector Definition

From MotoHawk
Jump to navigationJump to search

ADC Angle Vector Definition

This MotoHawk™ block is used to define an object that can capture multiple channels of crank angle synchronised data from an ADC. Related blocks like the [GetEntireADCAngleVector.html Get Entire ADC Angle Vector] block can then be used to export the captured data as a series of vectors. This block, when combined with a number of [ADCAngleVectorElement.html ADC Angle Vector Element] blocks could be used to capture in-cylinder pressure data for a number of engine cylinders

ADCVectorDefnExampleFig.jpg

Block ID

ADC Angle Vector Definition

Library

MotoHawk_lib/Analog I/O Blocks

Description

ADCAngleVectorDefinition.JPG

The ADC Angle Vector blocks uses an internal interpolative encoder edge output to generate a trigger signal for the ADC. The "Average Period" output details what the last encoder period was in microseconds. The interpolative encoder uses this average period, along with the "Elements in Vector" attribute, to calculate what the interpolation spacing between ADC trigger edges will be.

Under periods of rapid acceleration it is possible for the sum of the interpolation times to exceed the available encoder tooth period. Those edges that don't fit within the actual encoder tooth period are considered late. They are not missed, but instead are squashed together. The "Late Edge Count" output exports the total number of trigger edges that had to be squashed into the observed period. The "Max Consecutive Late Edges" output port exports the maximum number of consecutive edges that were squashed together. The consecutive late edge count would be 2 if 12 trigger edges were supposed to have occured in one encoder tooth period, but because of acceleration, only 10 could occur. These attributes provide feedback on whether the interpolation is suffering from too many errors

Block Parameters

Parameter Field Values Comments/Description
Name 'single-quote' enclosed alpha-numeric text No special characters such as spaces, dashes, commas (underscore allowed). Select a unqiue name. This name shall be used by related blocks to reference this definition.
Resource Drop-down list Select appropriate resource.
Periods in Average Numeric (Integer) The averge period used to calculate the interpolated time between trigger edges uses a FIFO with a depth of this value. The latest observed encoder tooth period is inserted into the FIFO
Number of Elements in Vector Numeric (Integer) Defines the number of samples that will exist in a vector. Also defines how many interpolation points will exist in one cycle. An even number of interpolation points must exist for each encoder tooth period. A value of 720 would be valid for a 60 tooth crank encoder in a 4-stroke system (1 degCA spacing and 6 edges per encoder tooth) but 600 would not (5 edges per encoder tooth)
Represet vector element as this many ADC bits Numeric (Integer) Data is captured right justified. A value of 12 would see possible values of 0 through 4095. If the internal ADC is only 10bits then the value is shifted to the left by 2 to give the impression that there is 12bits of resolution
Stack Size (bytes) Numeric (Integer) Any trigger that executes because of this ADC Angle Vector's definition shall execute in a task context where the task's stack is sized based upon this value.
Stack Margin (bytes) Numeric Value Provide a margin that could be used by the application monitor.
Processing Task Priority Drop-Down List Any trigger that executes because of this ADC Angle Vector's definition shall execute in a task context where the task's priority is defined based upon this value.
Vector Names 'single-quote' enclosed, spaced alpha-numeric text

Single spaced names of [ADCAngleVectorElement.html ADC Angle Vector Element] blocks associated with this definition. If there were two [ADCAngleVectorElement.html ADC Angle Vector Element] blocks named 'Cyl1' and 'Cyl2' then the appropriate value for this field would be 'Cyl1 Cyl2'.

* NOTE: The execution triggers that can be associated to this definition object will execute in a Task context. This is why there are tasking configurations available.