Sign up for our newsletter! 
Home News Products Downloads Forum Distributors Store Contact Us
PPE User Forum
May 21, 2013, 06:01:01 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 [2]  All
  Print  
Author Topic: Scripts for Torque and HP ?  (Read 14210 times)
0 Members and 1 Guest are viewing this topic.
Mr Whippy
Newbie
*
Offline Offline

Posts: 18


View Profile
« Reply #15 on: October 09, 2008, 06:50:50 am »

I have since added to this, so I will upload what I have later tonight.

Basically, the problem now is that of low resolution speed inputs.

Take speed vs time. If you accelerate at 1mph every second, then you get a certain gradient line. If you accelerate at 1.5mph every second, then the gradient you get is actually rounded to either 1 or 2mph every second.

There lies the problem. Basically, when it rounds down between two frames, you get zero acceleration and so zero power.

This results in a jumpy output where the rounding occurs.


My solution is hardly simple or elegant, but basically I have an if statement (yet to complete) that uses the rpm's (much higher resolution input), and uses the VSS, determine the gear ratio used from that, and the back calculate a superior vehicle speed using the rpm's and gearing...

There might be nicer maths to do that, I'll have to have a look into it more as I do it...

The downside of this is that you are monitoring two PID's which is twice as slow, so the refinement of the output isn't as nice.

Dave
Logged
phuz
Newbie
*
Offline Offline

Posts: 20


View Profile
« Reply #16 on: October 09, 2008, 07:09:05 am »

But I am showing zero now no matter what.  It doesn't jump around...it's just a constant zero.  Huh
Logged
phuz
Newbie
*
Offline Offline

Posts: 20


View Profile
« Reply #17 on: October 10, 2008, 12:16:02 pm »

my little rendition:

var SpeedY = Obdii.GetPidValueMetric("SAE.VSS", Obdii.CurrentFrame - 1)/3.6; // Speed in m/s (one frame ago)
var SpeedZ = Obdii.GetPidValueMetric("SAE.VSS")/3.6;                         // Speed in m/s (current frame)

var TimeY = Obdii.GetPidTimeStamp("SAE.VSS", Obdii.CurrentFrame - 1);        // PID Timestamp in MS (one frame ago)
var TimeZ = Obdii.GetPidTimeStamp("SAE.VSS");                                // PID Timestamp in MS (current frame)


/* Variables for TESTING ONLY!
var SpeedY = 80/3.6;
var SpeedZ = 112/3.6;
var TimeY = 20;
var TimeZ = 25;
*/

//Input details

var Mass = 1818; // S60R mass (in kg) w/ driver & 1/2 tank fuel

var Accel = (SpeedZ - SpeedY) / (TimeZ-TimeY);
var Distance = SpeedZ * (TimeZ - TimeY);
var Power = (Mass * Accel * Distance) / (TimeZ - TimeY);
var HP = Power / 746;

Obdii.PidValue.English = HP;
Obdii.PidValue.Metric = Power;
Logged
phuz
Newbie
*
Offline Offline

Posts: 20


View Profile
« Reply #18 on: October 12, 2008, 12:19:13 pm »

And after testing this one, too, my data value still sits at ZERO.   Huh Huh Huh
Logged
Pages: 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.138 seconds with 20 queries.
Home | News | Products | Downloads | Forum | Distributors | Store | Contact Us
Copyright © 2012 Palmer Performance Engineering, Inc. All Rights Reserved.