MotoHawk:Blocks:Synchronized PWM Child
Contents
Synchronized PWM Child
This MotoHawk™ block references a PWM parent block, and drives the output with a square wave with a specified phase offset relative to the parent.
Block ID
motohawk_pwm_child
Library
MotoHawk_lib/Analog I/O Blocks
Description
A synchronized PWM child may have an independent duty cycle from the parent. Either choose the resource to reference, or provide the name of a resource by name, as defined by a PWM Output block. This is necessary when the parent pin is made calibratable. The Duty Cycle input is an int16, ranging from -4096 to 4096, where 0 is 0%, 4096 is 100%. When the value is negative the polarity is reversed, this is only valid on PWM resources that are H-Bridge outputs, like ETC or H1. Phase offset delays the phase input/4096% of the period. A phase offset of 0 will have it start at the same time as the parent and 2048 would have it be delayed half the period of the parent. When "Output Current" is checked, the drive current in milliamps is provided. When "Output Fault Status" is checked, a value indicating fault status is provided. This value is one of: 0 - OK, 1 - Fault, 2 - Indeterminate.
Limitations
This block currently only works for 5xx processor targets, each parent can only have two or fewer child PWMs, and the parent and child resources must reside on the same [../MotoHawk_topics/TPU.html TPU bank].
If the resource is not behaving as exspected there are a few common errors. To check the common errors look at the resource creation status in the display(System|Debug|Resources|PWM|"ResourceName").
Common Errors
Error Enum | Common Causes |
---|---|
TPU Config | Check parent PWM is enabled as parent PWM. Check parent and child are on same TPU bank. |
TPU Primative Usage | Use 2 or fewer child PWM per parent PWM. |
TPU Primative Count | Use 2 or fewer child PWM per parent PWM. |
Hardware not Supported | Check that resource is on a TPU bank. |
Block Parameters
Parameter Field | Values | Comments/Description |
---|---|---|
Resource | Drop-down list | Select from available resource, per target ECU, such as H-bridge, etc. |
Parent Reference Type | Select Method for choosing resource of Parent | |
By Resource | Enable Drop-down list | |
By VarDec Name | Open Parent Name field | |
Parent Resource | Drop-down list | Select Parent Resource from available resource, per target ECU, such as H-bridge, etc. |
Parent Name | Alpha-numeric text, single-quote enclosed | Indicate exact Name of Parent Resource. No special characters, such as spaces, dashes, commas (underscore allowed). |
Output Current | Check box (enable) | When "Output Current" is checked, the drive current in milliamps is provided. |
Output Fault Status | Check box (enable) |
When "Output Fault Status" is checked, a value indicating fault status is provided. This value is one of: |
Allow I/O pin to be calibrated from MotoTune | Check box (enable) | Name, Access Levels and MotoTune Group Strings fields available |
Name | Alpha-numeric text, single-quote enclosed | Name as displayed in 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 |
MotoTune Group String | Alpha-numeric text, single-quote enclosed | Determines Folder name and hierarchy as displayed in MotoTune. Use "|" character between folder names to delineate subfolder structure |