Setting PWM Time Threshold to 0.6 ms

For discussion of Phil Tobin's Tuner Studio software (Only about the tuning software itself, not about how to tune or firmware features)

Moderator: LT401Vette

Setting PWM Time Threshold to 0.6 ms

Postby kjones6039 » Sat Aug 04, 2012 12:24 am

Phil,

Is it just me or has anyone else noticed that they can't set 'PWM Time Threshold', under Injector Characteristics, to 0.6 ms?

I noticed this a long time ago with various versions of TS and firmware. If I enter 0.6 in the dialog, close it and reopen, the setting reverts to .7! If I enter 0.5 or 0.7 it saves the value correctly.

Just curious about it.........

Ken

EDIT: I did a little poking around and found a couple other settings that do the same thing... ie. 0.2 reverts to 0.1 and 1.1 reverts to 1.0
1979 Corvette - 383 CID SBC w/ Holley Pro-Jection 900 CFM TBI, 4-85 lb lo-z injectors & Walbro 255 pump
MS2 v3 w/ms2extra 3.3.1 Release
36-1, Delphi LS2/7 coils in wasted spark, driven by v2.0 logic board from JBPerformance
Spartan Lambda Sensor from 14point7
User avatar
kjones6039
Super MS/Extra'er
 
Posts: 1231
Joined: Sat Jul 22, 2006 8:02 pm
Location: Eureka, NV USA

Re: Setting PWM Time Threshold to 0.6 ms

Postby jsmcortina » Sat Aug 04, 2012 4:37 am

The time threshold is actually in 0.128ms units, so there's always some rounding.

I would always suggest setting it to a few 0.1ms longer than your "dead time" in any case to make SURE that the injector gets a good "peak" current and opens reliably.

James
I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27928
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: Setting PWM Time Threshold to 0.6 ms

Postby LT401Vette » Sat Aug 04, 2012 5:01 am

There are 2 representations for setting values, Human Readable and the binary controller values.

The binary values in the controller are usually integer based and may represent something like the number of clock ticks in the MegaSquirt. As a human it is easier to read that as ms. So TunerStudio converts all values from the byte msValues to human userValues based on the scale and translate defined in the ini using this formula:
msValue = userValue / scale - translate
userValue = (msValue + translate) * scale

Then in the ini the number of decimal places is defined. So looking at a setting like 'PWM Time Threshold'
injPwmT = scalar, U08, 613, "ms", 0.12800, 0.128, 0.00, 32.64, 1 ; * ( 1 byte)

It is has a scale of 0.128, a translate of 0.128 and is defined to display 1 decimal place.

so a userValue of 0.7 would be converted to binary as such:

msValue = (0.6 / 0.128) - 0.128
msValue = 4.5595

But now that it is to be stored as a byte, the decimal places are lost, a byte can only hold integer values 0-255. So it will be rounded to a 5 and stored.

So then when it gets converted back to a user value:
userValue = (5+ 0.128) * 0.128
userValue = 0.656384

as 1 decimal place is defined, this will then be displayed back as 0.7.

With the defined scale and translate there is not enough resolution to hold a representation for every 0.1 value

You shouldn't need to close and reopen the dialog, it should be converted to the closest possible value as soon as you tab out of the text area.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
User avatar
LT401Vette
Super MS/Extra'er
 
Posts: 8276
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC


Return to Tuner Studio

Who is online

Users browsing this forum: No registered users and 4 guests