channel editor

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

Post Reply
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

channel editor

Post by MS2tester »

could the channel editor get some more attention
it,s overly sensitive to white spaces and refuses some very simple calculations
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: channel editor

Post by LT401Vette »

In what way is it overly sensitive to white spaces?

TS does not know how to handle division by 0 as I do not know how to.
When you are attempting to divide by 0, what would be your desired behavior?
- Allow an over-ride? (It will then churn out errors to the AppDebug at runtime)
- Perhaps suggest a fix to protect against the divide by 0?

In this case, what you would perhaps want to put in that expression:

vss2 > 0 ? vss1 / vss2 : 1

That will prevent your expression from creating errors.
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
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

Re: channel editor

Post by MS2tester »

this is sort of what i mean exact the same calculations but one gives an error the other does not
not clear why
maybe this is an excel sheet background some how that gives this error when there is no data
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: channel editor

Post by LT401Vette »

Hmmm, now what is different where it passed the validation?

I tried:
(vss1 / vss2)
( vss1 / vss2 )
(vss1/vss2)
( vss1 / vss2 )
etc.. I haven't been able to get a valid expression based on spaces. And they really should not matter.

The only thing that should make that pass is if some how vss2 is not 0.
Which if you were online it could have a left over value of non-zero.

I am curious..
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
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

Re: channel editor

Post by MS2tester »

i guess when trying to make it work i somehow turned off my ecu while trying different ways off making the calculation work
being offline is definitely a bonus when making a custom channel
i don,t know if this is a vss specific issue or if there are more inputs affected
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: channel editor

Post by jsmcortina »

I'm guessing that "Not a number" divided by "Not a number" is 1 ?

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Matt Cramer
Super MS/Extra'er
Posts: 17499
Joined: Thu Apr 16, 2009 8:08 pm

Re: channel editor

Post by Matt Cramer »

jsmcortina wrote:I'm guessing that "Not a number" divided by "Not a number" is 1 ?

James
It depends on how big your number that is not a number is. The math parser probably doesn't understand calculus limit functions. :P
Matt Cramer -1966 Dodge Dart slant six running on MS3X
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: channel editor

Post by LT401Vette »

jsmcortina wrote:I'm guessing that "Not a number" divided by "Not a number" is 1 ?

James
I think that is sort of it... It the variables are non initialized and are NaN, then NaN/NaN=NaN
That doesn't cause an exception as divide by 0 does.

MS2tester wrote:i guess when trying to make it work i somehow turned off my ecu while trying different ways off making the calculation work
being offline is definitely a bonus when making a custom channel
i don,t know if this is a vss specific issue or if there are more inputs affected
I don't think you are quite getting it.. You want to listen to the errors, not find ways around them. If you make expressions with errors, then at run time TS will be churning errors and filling the AppDebug with error entries.

It seems I do need to tighten up these validations.
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
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

Re: channel editor

Post by MS2tester »

obviously correct calculus is important
i am just a little worried that the validation will be over protective and have a "why do you want to do that!" attitude
like dividing vss1 by vss2 making no sense
but the math is correct!
so if i want to multiply the fuel pressure by rpm i am able to do so, even if there is no possible use for it
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: channel editor

Post by jsmcortina »

Phil,
how about implementing automatic divide by zero protection? Many customers don't understand why it is a problem and will continue to trip over it.

A failsafe could be x/0 = 0

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: channel editor

Post by LT401Vette »

jsmcortina wrote:Phil,
how about implementing automatic divide by zero protection? Many customers don't understand why it is a problem and will continue to trip over it.

A failsafe could be x/0 = 0

James
I'll think think about that. I am somewhat hesitant to make the TS math parse do incorrect math, perhaps make it x/0=NaN.

I could also perhaps make it automatically add/suggest the divide by 0 protection upfront.
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
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

Re: channel editor

Post by MS2tester »

correct me if i am wrong but within megasquirt 0 will be a true value
fuel pressure will be 0 with the pump not running
wheel speed sensors will be 0 with the car not moving
pulse width will be 0 with the engine not running :?
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: channel editor

Post by LT401Vette »

MS2tester wrote:correct me if i am wrong but within megasquirt 0 will be a true value
fuel pressure will be 0 with the pump not running
wheel speed sensors will be 0 with the car not moving
pulse width will be 0 with the engine not running :?
Yes, now you are getting it..
You don't want those in the divisor unless it is checked and handled, your expression should have protection up front like outlined above.
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
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

Re: channel editor

Post by MS2tester »

as i am currently still using wrong math , i would like to get this working with the newer firmware
tried this, is coming up invalid
= ( vss2 > 0? vss2 / vss1 > 0? vss1 )
what would not let the math channel freak out?
Attachments
small.png
small.png (339.14 KiB) Viewed 413 times
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

Re: channel editor

Post by MS2tester »

well not getting it :roll:
Attachments
math_parser_IF_function_small.png
math_parser_IF_function_small.png (344.62 KiB) Viewed 406 times
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: channel editor

Post by LT401Vette »

In that last pic, start by getting rid of the != or |= up front. I don't know what that is for.

Then, what is the calc attempting to calculate? I see PropSlip, so in the end are you attempting to get vss1/vss2 with protection against divide by 0?

like this:
if( vss2 > 0, vss1 / vss2, 0)

of:

vss2 > 0 ? vss1 / vss2 : 0

Those are both the same expression, just 2 ways of doing it.
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
MS2tester
Master MS/Extra'er
Posts: 606
Joined: Sat Apr 11, 2009 12:54 pm
Location: Aalsmeer the netherlands
Contact:

Re: channel editor

Post by MS2tester »

yes it is a math channel to display proppelor slip on a boat by divding true speed (gps pulse per meter) by theoretical speed ( RPM pulse fed back to wheel speed input with prop pitch input)
this is what works in google spreadsheet with the correct slip numbers versus the mercury marine online slip calculator in %
now still need to test with actual pulse inputs
atleast the mathparser is satisfied now
Attachments
propslip_correct_math_small.png
propslip_correct_math_small.png (344.08 KiB) Viewed 369 times
Post Reply