RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Tue Dec 23, 2025 11:13 am

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 43 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Tue May 22, 2012 7:33 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
Who else are you gonna ask?


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Wed May 23, 2012 1:00 pm 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
Ghost busters? :-)

Thinking about the conversions situation. Given that the whole thing is in a single XML file, it should be possible to scan that file for all of them and intelligently convert them across. So maybe it is feasible to have a change in direction there. If I write something to scan across it and check for certain formatting of the expressions, and convert it into a discrete set of steps that can be reversed, would you be OK with accepting that change? If there are any oddballs such a scan will find them and we can then discuss what to do about that. From what I've seen, though, all of them fit the standard scale/offset pair. The example you gave fits that, but would be cleaner if we had a more extensible operations list.

Perhaps an ordered set like this:

Code:
<fromECU>
    <multiply>90</multiply>
    <divide>256</divide>
    <subtract>20</subtract>
</fromECU>


Then toECU is implicit and just the reverse process.

Fred.

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Wed May 23, 2012 3:03 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
How do you define the order of operations?


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Wed May 23, 2012 3:18 pm 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
As read in would be my choice if the XML lib being used allows it.

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Wed May 23, 2012 4:00 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
So an XML representation of RPN?
Why not just RPN then?


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Wed May 23, 2012 4:39 pm 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
What's "RPN" ? The definitions are already a huge XML file, right? That's what I meant. You lost me. Care to explain?

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Wed May 23, 2012 10:29 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
http://en.wikipedia.org/wiki/Reverse_Polish_notation

Yes the files a huge and your notation will not help them become smaller.


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Thu May 24, 2012 3:41 am 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
No, it well help them become cleaner, clearer, more exact and precise and clean up the code that should never have existed to check two conversions when there should have only ever been one. Breaking them down into a dir structure (which could be done first) will make it/them smaller.

It's been years since I used "RPN" and I've never seen it written as an acronym :-p I don't see the relevance or humour, but I'm hoping it was the latter :-)

If I'm being dry, forgive me, but:

Code:
( ( rawValue <multiply> number ) <divide> number ) <add> number = humanValue

reads like normal math to me! :-p

Fred.

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Thu May 24, 2012 6:45 am 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
Some people are shy and/or don't understand the value of a "+1" style post.

A)

"I am all for sensible notations, <snip>"
....
"I have nothing meaningful to add to it, but I support your opinion"

B)

"I like the scaling setup"
"I was thinking simple gradient/offset for each, but this accomplishes the same, with more options"

Me:

"i'd prefer the simple scale/offset, BUT, the subaru ecu guys clearly weren't thinking the same thing :-)"
"imagine my surprise when i got 2.8444444444 when i tried to "fix" the other number"
"it was obvious it had to be a fraction though"
"and 90 is no coincidence either, being a timing"

--------------------

How many of them are three way calculations? like your 256, 90, 20 one? Are there any sine() sqrt() ^2, etc? or all simple mult/div/add/sub?

Simpler is better, but I feel as though the Subaru engineer logic should be exposed with all three numbers, not just 2.84444444 and 20.

Time to go and buy a transformer :-)

Fred.

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Thu May 24, 2012 10:02 am 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
Fearless wrote:
Code:
( ( rawValue <multiply> number ) <divide> number ) <add> number = humanValue

reads like normal math to me!
That is completely unclear when you defined this:
Fearless wrote:
<fromECU>
<multiply>90</multiply>
<divide>256</divide>
<subtract>20</subtract>
</fromECU>

Your definition has no groupings

Why not leave the current conversion alone and just write out the discrete values to use?
x * (90 / 256 ) - 20
Much shorter and simpler to understand than your proposal. What am I missing?

Here are a few other ECU conversions to consider:
"x*.00229800533137237"
"(x*.591715976)-75.29411712"
"(x*.0001220703125)*14.7"
"x*.004577637"
"(x-32768)*.001333224"
"x*(-.001333224)"
"(x*1.8)+32"
"x*.004"
"96560.6/x"
Look at this link, at the scalings for reference.

In addition, the Logger uses the same library to define conversion formulas but some are much more complex.
Recent example:
(P12/(([P7:kPa]*1000)/(287.05*([P11:C]+273.15))*1000))/(149.9*P8/3456*0.0283/60)*100
The P# items are other logged parameters in this case, think recursive.


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Thu May 24, 2012 11:25 am 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
dschultz wrote:
That is completely unclear when you defined this:

I disagree, it's ordered.

Quote:
Your definition has no groupings

AFAIK, you can only do one mathematical operation at a time.

Quote:
Why not leave the current conversion alone and just write out the discrete values to use?

Because it's not reversible and requires defining the same relationship twice, once forward, once backward. This is dirty.

Quote:
Much shorter and simpler to understand than your proposal. What am I missing?

That it's not reversible and thus prone to human error. It also means there is more code than necessary to handle the fact that some human screwed up.

Perhaps I'm missing something. Can the lib, in the process of processing an expression, provide an inverted copy back to you to store in memory? If so, just delete 50% of the entries and you meet my requirement :-)

Quote:
Here are a few other ECU conversions to consider:

All of them except this one are standard: "96560.6/x" what is this variable? It could still be handled easily, though.

Quote:

I'll take a look later. Just got home and haven't had lunch, nearly 6pm.

Quote:
In addition, the Logger uses the same library to define conversion formulas but some are much more complex.

Of course, having derivative expressions in a logger is pretty normal. PW vs RPM = duty, etc. It's not about ditching the lib, though I may have mistakenly said that earlier in the thread?

Fred.

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Thu May 24, 2012 12:55 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
Fearless wrote:
Because it's not reversible and requires defining the same relationship twice, once forward, once backward. This is dirty.

Ah, right that's who we got started with this discussion.

Fearless wrote:
Can the lib, in the process of processing an expression, provide an inverted copy back to you to store in memory? If so, just delete 50% of the entries and you meet my requirement :-)
That would be really nice if it did, but I don't know if it does.


Top
 Profile  
 
 Post subject: Re: Fred's Random Stupid Questions (and hopefully answers!)
PostPosted: Thu Jul 05, 2012 1:10 pm 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
Fearless wrote:
That would enable me to use YAML for my stuff too, instead of verbose XML.

I used SnakeYAML today for the first time. Very easy and natural. I look forward to using it much more in future :-)

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 43 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl