INI files

The NGen GUI can load and save files in typical INI format.
"#" is the comment sign. However the INI files containing NGen data must start with the comment "'#NGEN".
There is a global section called "ngen" and one sections for each of the four channels, named "channel0" to "channel3".
Finally, there's a section for the engine speed gradient called "gradient".

Note that you don't need all sections. The only section that always has to exist is the "ngen" section.
If you an INI file doesn't contain a certain section, it is ignored and the according data is not updated.
E.g. if a file only contains "ngen" followed by "gradient" or "channel2", then only this data will be altered.

Also not every entry inside a section has to exist. However, if an entry is missing, a default value is assumed.
E.g. if you want to define an angular signal for a channel and don't care about the PWM parameters, just leave them.
However when loading this INI file, this will also reset the PWM parameters for this channel in case you changed them before.

Resolution

For specifying periods, offsets etc., one of the following resolution types can be chosen.
Note that INI files saved by the GUI will always use ticks.

Identifier Description Short form
degree Crankshaft degree (1 == the 360rd part of a crankshaft rotation) de
teeth

Number of crankshaft teeth (one tooth equals 360/TeethPer360D)

te
ticks

Angular/time ticks. TicksPerTooth angular ticks equal one tooth. Frequency time ticks equal 1s

ti
ms Milliseconds ms
us Microseconds us

 

Section NGEN

This section must exist exactly once.
Note that the parameter Frequency is defined for reference and compatibility with future HW solutions. The current hardware supports only exactly 100MHz. So don't change this value.
Furthermore, also the parameters TeethPer360D and TicksPerTooth should not be changed as the current NGen firmware only supports the default values (60 teeth, 256 ticks per tooth).

Parameter Description Type Default

TeethPer360D

Number of teeth per crankshaft rotation

Unsigned integer 256

TicksPerTooth

Number of angular ticks per crankshaft tooth

Unsigned integer 60

Frequency

Number of timer ticks per second in time mode

Floating point

100000000

ReverseEnable

Enable reverse rotation (negative engine speeds)

Boolean ("true", "false") false

BiDirEnable

Enable simulation of bidirectional sensor

Boolean ("true", "false") false

BiDirActiveEdge

Active edge in bidirectional mode

Either "falling" or "rising" (only first character counts)

falling

BiDirFwdPeriod

Period in timer ticks after active edge in bidirectional simulation mode (forward direction)

Unsigned integer 6000

BiDirRevPeriod

Period in timer ticks after active edge in bidirectional simulation mode (reverse direction)

Unsigned integer 9000

 

Section Channel

One section per channel named "channel0" to "channel3". Missing channels are ignored.
The parameter Periods must be specified and has to contain at least one value.
Note that the hardware implementation induces a certain restriction for Mode. Within the channel groups 0,1 and 2,3 it is not possible to use Time and Angle mode and the same time.
E.g. if channel 2 is in time mode, then channel 3 has to be either in time mode or pwm mode, but not in angle mode (and vice versa).

Parameter Description Type Default

Name

Channel name displayed in the GUI

String with up to 16 ASCII characters - (empty)
Mode

Channel mode

Either "angle", "time" or "pwm" (only 1st character counts)  
Resolution The resolution used for the channel data One of the defined resolution identifiers degree
Offset

Offset of first edge from absolute start position

Floating Point, as specified by Resolution

0

FirstEdge

Polarity of first edge

Either "falling" or "rising" (only first character counts) falling
Periods A comma separated list of periods following the first edge (resulting in alterating edges)

Floating point, comma separated, using Resolution

-
PwmPolarity Polarity in PWM mode (level during the active phase specified by the duty cycle) Either "hi" or "lo" (only first character counts) hi
PwmDutyCycle PWM duty cycle in percent (specifies the percentage of active phase per period)

Floating point, percentage 0..100%

50
PwmFrequency PWM frequency

Floating point, Hertz

1000

 

Section Gradient

Optional section. Ignored if missing. The parameters Speeds and Periods must be specified and have to contain at least one value.
The parameter "Resolution" is just there for reference and will be ignored. When files are saved, it will be defined as "ms".

Parameter Description Type Default

Resolution

The resolution used for the periods (always milliseconds at the moment)

One of the defined resolution identifiers

-ms
Speeds A comma separated list of engine speeds in rpm (rotations per minute)

Signed integer, comma separated, rpm

-
Periods A comma separated list of periods in milliseconds

Unsigned integer, comma separated, milliseconds

-

 

Example INI file

This should reflect the ROM defaults:

#NGEN

[ngen]
TeethPer360D = 60
TicksPerTooth = 256
Frequency = 1.0E8
ReverseEnable = false
BiDirEnable = false
BiDirActiveEdge = falling
BiDirFwdPeriod = 6000
BiDirRevPeriod = 9000

[channel0]
Name = Crank
Resolution = Degree
Offset = 0
FirstEdge = falling
Periods = 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 15, 3
PwmPolarity = hi
PwmDutyCycle = 50.0
PwmFrequency = 1000.0

[channel1]
Name = Cam
Resolution = Teeth
Offset = 62
FirstEdge = rising
Periods = 5,25,5,5,25,5,25,25

[channel2]
Name = Medres
Resolution = Teeth
Offset = 1
FirstEdge = falling
Periods = 5

[channel3]
Name = Sync
Resolution = Teeth
Offset = 13
FirstEdge = falling
Periods = 60

[gradient]
Resolution = MS

Speeds = 1000, 1500, 2000, 2500, 3000, 3500, 4000, 3500, 3000, 2500, 2000, 1500
Periods = 1000, 800, 600, 400, 300, 200, 200, 200, 300, 400, 600, 1000


Back to main page