motohawk_flexencoder_project

The motohawk_flexencoder_project M-script creates a new MotoHawk™ project that is constructed from a Flexible Encoder focused template. The behavior is similar to the motohawk_project script. There are a multitude of encoder systems that the MotoHawk™ Flexible Encoder block set can be used to define. This script can be used to quickly create a starting point for a MotoHawk™ Flexible Encoder project.

motohawk_flexencoder_project(project, [encoder_system_type], [model_name], [model_description])

project

The script will create new directory called project that will be used to house the files related to the sample project. This is a required string parameter. The project may be an absolute path or a path relative to the current working directory. It may contains spaces and any other characters that are legal for a path.

An error will result if the directory specified by the project already exists.

The Flexible Encoder Pattern Definitions used by the created model will be stored in the FlexEncoderPatterns sub-directory.

encoder_system_type

An optional string parameter that specifies the type of Flexible Encoder system that is to be created. When not supplied a value of 'Cnk_Basic' is assumed. The script supports these options:

An error results if an unsupported option is supplied.

Cnk_Basic

A basic single source Flexible Encoder System. The model illustrates the usage and interaction of the most common blocks.

Cnk_60M2_Camless

A 4-stroke 60 minus 2 tooth crank encoder source operating without a cam.

Cam_6P1

A 4-stroke 6 plus 1 tooth cam encoder source operating without a crank encoder. The example also demonstrates some of the finer points of RPM Sample Point configuration.

Cnk_60M2_Cam_Tooth

A 4-stroke 60 minus 2 tooth crank encoder source operating with a single tooth cam encoder source. This example demonstrates how to configure a halfcycle companion and the halfcycle window in particular.

Cnk_60M2_Cam_6P1

A 4-stroke 60 minus 2 tooth crank encoder source operating with a 6 plus 1 tooth cam encoder source. Example demonstrates how to configure a halfcycle companion and the halfcycle window in particular. Example also demonstrates the use of a dual absolute sources.

Cnk_60M2_Cam_PWM

A 4-stroke 60 minus 2 tooth crank encoder source operating with a PWM cam encoder source. This example demonstrates basic cam phaser reporting.

Cnk_3x20M2_Cam_6P1

A 4-stroke with a 3x20 minus 2 tooth crank encoder source operating with a 6 plus 1 tooth cam encoder source that provides halfcycle and synchronization information to the crank encoder.

The encoder signals for this setup are illustrated below.

Cnk_151X_Cam_Tooth

A 4-stroke with a 151 equidistant tooth crank encoder source operating with a single tooth cam encoder source that provides halfcycle and synchronization information to the crank encoder. This example demonstrates how the halfcycle window and the synchronization window influence encoder operation.

The figure below illustrates using a 10 tooth crank encoder (instead of 151 teeth)

Cnk_151X_Sync_Cam_Tooth

A 4-stroke with a 151 equidistant tooth crank encoder source operating with a single tooth cam encoder source and a single tooth synchronization encoder source that respectively provide halfcycle and synchronization information to the crank encoder. This configuration is sometimes referred to as 3 source configuration. The example demonstrates how the halfcycle window and the synchronization window influence encoder operation.

The figure below illustrates using a 5 tooth crank encoder (instead of 151 teeth)

FlexCal

This example illustrates flexible connectivity and pattern calibration. Flexible connectivity allows, for example, a 3 source and a 2 source encoder system to be supported from a single executable.

VarCam

This example illustrates a 4 source variable cam phaser encoder system. Such a system has a single absolute source to provide crank angle position (typically named the "CnkEncoder") and then 4 variable cam phaser encoder inputs. Typically these represent the inlet and exhaust cams for each 'V' in a V-engine configuration. This examples describes a system that has 4 separate PWM cams.

model_name

An optional string parameter, the created model will be named model_name when supplied. The name of the leaf directory specified by the project path will be used if a model_name is not supplied. The model_name must starts with a letter and contain only letters, numbers and underscores.

model_description

An optional string parameter, the model will set the model's properties to the value of model_description and also apply this description in the title on the top sheet. The default will initialize this value based upon the defined encoder_system_type if a model_description is not supplied.