Account
|
View Cart
|
Checkout
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
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
PPE User Forum
>
Scripts
>
User Scripts
>
Scripts for Torque and HP ?
Pages:
1
[
2
]
All
« previous
next »
Print
Author
Topic: Scripts for Torque and HP ? (Read 14210 times)
0 Members and 1 Guest are viewing this topic.
Mr Whippy
Newbie
Offline
Posts: 18
Re: Scripts for Torque and HP ?
«
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
Posts: 20
Re: Scripts for Torque and HP ?
«
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.
Logged
phuz
Newbie
Offline
Posts: 20
Re: Scripts for Torque and HP ?
«
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
Posts: 20
Re: Scripts for Torque and HP ?
«
Reply #18 on:
October 12, 2008, 12:19:13 pm »
And after testing this one, too, my data value still sits at ZERO.
Logged
Pages:
1
[
2
]
All
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Lounge
-----------------------------
Products
-----------------------------
=> ScanXL
=> PCMSCAN
=> DashCommand
-----------------------------
DashXL
-----------------------------
=> DashXL Discussion
=> User Dashboards
-----------------------------
Scripts
-----------------------------
=> Script API
=> Script Problems
=> User Scripts
Home
|
News
|
Products
|
Downloads
|
Forum
|
Distributors
|
Store
|
Contact Us
Copyright © 2012 Palmer Performance Engineering, Inc. All Rights Reserved.