# HP Tuners, Widebands, Math, Offsets, Speed: The Story of The Attempt to Get It Right



## RoninDusette (Aug 21, 2018)

Greetings. So this started out yesterday morning (literally 24 hours ago) as an attempt to comment on a post, and by the time I knew I it, my 2 hour train ride was over and I had a wall of text. I decided to put it into a separate post. 

I am not a career math badass, but I hold my own. This is my research going into what seemed to be the simple matter of wiring my AEM wideband controller analog output wire through my A/C pressure sensor wire to the PCM, to transform and subsequently log data via HP tuners without selling my kid to pay for the pro version (come on guys... throw us a bone, here). 

Most gen III guys got this down, and I figured it should be easy. I mean, GM is the American Honda, right? Pfff. NYOOOP. 

Below are my findings, ramblings, probably waaaaayyyy too much calculus, but they are my findings nonetheless. I want to get this conversation started, as it seems as though nobody as really attempted to do this. I have done a few weeks of research and days of tinkering, and this is what I have of this morning. Please feel free (in a respectful way) to add to this discussion so that we can have a compendium of proper knowledge on how this works, so others don't have to spend time doing it. 

I am going to start another thread that will have a list of this post/tutorial and the other one I did about SD VVE tuning. I will continue to post detailed things like this, and I hope they are well-received, as there is little to no info about this stuff, and as much as I dig HP tuners, they don't update their docs EVER. Most tutorials out there unless you want to pay hundreds of bucks only teach HPT v3, which is not what we have now.

If they guys from HP Tuners see this... Dude... For the money we pay (and it's a lot) for your stuff, over and over and over again, you should be updating your docs and your forums should not be dead. Shi*. I should get a discount for doing all of this work, as I am sure if it's worthy it will be referenced in your forums I know, me personally, I am over 800 bucks deep in your product, and have to do all of this research on my own because the forums lack people (likely because of the lack of friendliness to n00bs) and your docs are YEARS behind. Please, get on the ball. 

Sorry about the rant. So let's get to it.

Here is what I am working with:
2015 Cruze LT 1.4t 6-speed manual
every air mod you can get besides a catback and a turbo (intake, IM ported, pcv fix, intercooler and piping, catless dp and mp (all from ZZP), MSD ignition pack, HP Tuners (standard), and a bunch of other stuff. FOr this discussion that is all that matters)
State: California
Fuel: ~e10 (shell or cheveron only)
AEM Digital Boost Gauge (not logged)
AEM 30-4110 Digital Wideband Controller (analog 0-5v output running to A/C pressure wire. I will update tomorrow with pics of where I tapped in, where you should and shouldn't, etc etc etc. and post it here)

_Please be aware, again, this needs to be rearranged and fine-tuned for grammar, math, etc. so pardon the mistakes. Hey... I'm trying here... _

For those that do not know, the AEM digital series of gauges (and a few other) when it comes to widebands have different settings to suit multiple needs. For the sake of this draft not getting erased, I will edit/update later after I have had breakfast and coffee and time to proofread again. PLEASANT comments and suggestions are greatly appreciated. 

p0: AFR, 0-5v, linear
p1: Lambda, 0-5v, linear
p2: AFR, 1-2v, linear
p3: AFR, Autotronics-esque calibration, 0-.425v, linear
p4: AFR, Nernst (narrow-band) emulation, 0-1v, non-linear

p4 is actually backwards compared to the others. Higher the voltage, the richer it reads. The inverse is true for all of the others.

So, that being the case, for the A/C pressure sensor wire, we have 4 options (again, all of this will go into a detailed writeup), from just what I am guessing, best to least favourable:

I will use the p0, 0-5v AFR on my AEM UEGO 30-4110 as an example as that is the most common.

*NOTE:* If you are wanting to log in lambda, you can always transform in the formula used to get the AFR from the voltage. Details (probably too much) below.

*NOTHER NOTE: *This is about to get REAL math-y. Just be warned, it's pretty simple calculus, but I understand if you get a headache. 

This is the formula (long-form) to convert voltage into AFR:
_((Volts / (0~Max Voltage)) / (max AFR - Min AFR)) + (min AFR +any offsets in AFR values)_

(_([ 7101.10] / .5) + 10_) / 14.12
| 1 | 2 | 3 | 4 |

1: A/C pressure sensor PID, in volts
2: Steps of voltage range divided by the difference between max and min AFR range. 20:1 - 10:1 AFR (10 steps, 1 volt per step)
3: Minimum AFR rating (as per voltage output vs AFR in the docs for your gauge. NOT the gauge's LEDs or number display) + the ground offset (steps between high and low AFR numbers displayed on gauge vs what you see in HP Tuners channels/graphs/charts)
4: The result of 1, 2, and 3, divided by stoich for your fuel (In Cali you almost always get e10. Adjust for your stoich rating. My stock Cruze tune was set for 14.12, so I used that)

Here is an example for my particular gauge (refer to the owner's manual for your gauge, as the output is different for most, if not all of them):

AC V: 3.230v
Volt Range: 5 (0-5v, 1V * 5V = 5)
AFR range: 10 steps (10:1 - 20:1, 20 - 10 = 20
Stoich: ~14.12 (e10, not a bad idea to adjust between 14.68 and 14.12, just because you cannot always know the ethanol content of the fuel)

*[0~Max Voltage] / max AFR - min AFR = *
5 / 10 = .5 

*((3.230 / .5) + 10) / 14.12*
1.165 lambda

Note this is slightly off of what their docs say (link below, pg 11, table 3). That is where you add to your offset (3, the "+ 10") to compensate for your ground offset, which should get you straightened out. The difference between the two is we need to get in order to dial it in better, according to the paperwork (in AFR to make it easier).

*(3.230 / .5) + 10 = 
16.46:1 AFR*

at 3.230v the docs say it should read 16.25:1

*100 * ((16.46 - 16.25) / ((16.46 + 16.25) / 2)) = *
1.28401%

That is our difference. And this I think is correct here. Our offset is at 10. We need to know what 1.28401% of 10 is. This should be easy:

1.28401% is simply .0128401 (.01 is 1%. I don't think we need to do the math for this on. Lol.).

BUT, if it were like 16.45612%, then the number to add would be .1645612. If the percentage you get is 2 digits before the decimal point, just move the decimal point to the left two spaces. If it's only 1 digit, then move the decimal point to the left 2 spaces, and add a 0 right after it. 1.2% === .012. 84.23% === .8423. Get it? 

*10 + .0128401 =*
of course, 10.0128401


Let's see if this comes together to give us the right AFR and subsequently lambda now:

*((3.230 / .5) + 10.0128401) / 14.12 =*
1.166 lambda or 16.47:1 AFR

*AFR / stoich = lambda*
16.47 / 14.12 = 1.166

The docs show this as it's AFR/Lambda to voltage tables:

View attachment 284269


So it looks like we are almost right on the money. My math is probably a little off (likely because of my stoich), though. Let's try and match what is listed. Say, 16.50:1 AFR with a known used stoich of 14.68:

AC Signal volts: 3.250
Goal lambda/AFR: 1.127/16.50:1 AFR

*((3.250 / .5) + 10.0128401) / 14.68 =*
16.51280401:1 AFR, or 1.248 lambda

Now damned if that isn't close enough.  I am sure this can be improved upon by adjusting the integers after the decimal point, though. The further to the right you get of the decimal point on your offset, the smaller the change.

I want to try another:

Let's use the same voltage as above, but with 14.75:1 AFR

*((3.250 / .5) + 10.0128401) / 14.75 = *
16.51284010:1 AFR, or 1.119 lambda

The reason you see a difference from all of these is partly the offset, but these gauges consider stoich === 14.68. Doesn't matter what your car is running at, the gauge will show 14.68. This is why measuring in lambda is good. Lambda is always relative to whatever your stoich is. You just have to factor it into your equation. Above you can see how close we got using 14.68. Almost right on the nose. Now, you will have to adjust the offset number (the 10.0128401, or whatever the math brings you to put there) to account for the offset because of electrical interference or whatever. You WILL have to do the math, and it will get you extremely close. Then you can make the tiny adjustments from there.

Long story short, unless you can program your gauge/controller to measure an arbitrary stoichiometric ratio, then refer to your gauge/controller's docs, and you will likely find them to calibrated to 14.68. Then use the transforms/maths/custom PIDs to convert it to lambda whilst you log if you are running on anything but pure gasoline.

Also note that I am just shooting from the hip and am on a busy train, but it would be something similar.

Annnnnyway...

=====================================================
*NOTE!!!!!!!!*
-------------------------------------------------------------------------------------
p0/p1 are the winners of the proverbial chicken dinner. 

I will be editing and re-arranging this to make more sense, but I want to get this data out there today, so pardon if it looks like a "construction zone"... it is. 

In the end, your absolute BEST bet is simply spending the frikkin $20 and buying a serial-to-USB adapter. I will be doing it this weekend and doing a writeup about that as well. Very detailed. I am also going to try with some other devices I have sitting around (raspberry pi/arduino, TTL-to-USB UART adapter (for debugging MCUs and the like,), probably try a couple of parallel cables and just see what I come up with. 

Please, if you have corrections, comments, etc; don't be a jerk. Let's be constructive. I will drop all of this and keep it to myself otherwise. Lol. 
=====================================================

?? :/ 1) p3: Autronic sensor calibration setting. 0-.425v. This setting will actually work on this wire, and still has 24 steps of resolution for that range. Given the high sensitivity of these sensors, setting the custom math/PID to say, 5 or 6 decimal points, would give you a voltage reading that will work on that the A/C pressure sensor (which I now believe is not a sensor, but a switch, hence the limited 0-1v range. Most v8/gen II/III guys use that or EGR, and until I find the EGR pin, I am stuck with this, and I am damned and determined to get this working for us.). I will be trying this in a few hours when I get off work, as it's all hooked up and I just have to flip the setting on the gauge and adjust my formula for it. This is probably the easiest way for no money to hook this thing up to HP tuners.

*UPDATE:* p3 would not work for me. Only reads 10 .425v. Also, when switching back to p1 (0-5v, lambda, linear), I am having much more luck dialing it in and scaling the 5V signal to the 0-1V range (after days and days of research and testing, the A/C pressure sensor does not seem to be a sensor at all; it's a f***ing switch with a limited range. We don't have EGR valves, though I am certain there is a pin for it on the ECM... if you know or can test, let me know and I will do the rest of the legwork.). Another option is the fuel tank pressure sensor wire, which I will test tomorrow (checking for voltage output and sensor ground ratings, posting my findings as such), which are known usually across the board to be a 0-5v signal. I have already tested my sensor and gauge/controller; it works fine. It's for sure being limited by the particular wire I am tapped in to. I know this is the correct one because my transforms correlate almost directly with my gauge vs the PID.7101.10 values. They are just skewed. This is just a math problem to work out.

I will say this about p0/p1; It WILL read and get you VERY close. I am only differing about 3-5% difference between what my gauge reads vs what HP Tuners reads, and only at the far extremes. For a budget, this will get you as close as possible. The math I used for my particular gauge just this morning used the following parameters:

_Channels:_
commanded AFR (SAE)
commanded EQ Ratio
a/c pressure sensor (units: Volts, decimals: 5)

_Tools -> Math Parameters (or CTRL + m):_
View attachment 284271


and:
View attachment 284272




graphs:
View attachment 284273


and:

View attachment 284274


and:
View attachment 284275


and:
View attachment 284276



*NOTE: *All of these tables are based off of the VVE tables. You will need to copy the labels for the row and column axis to match that table. This is absolutely a *MUST*. If your graph does not match, then you will not be able to copy anything over properly. 

Please, test this if you can and submit improvements in the thread. I don't mind being a lone-wolf at all. I actually like it. Though I know there has to be another engineer out there that likes to tinker, so have at it and let's make this constructive. I am using my car as a guinea pig for the sake of science, speed, and DAS CRUZE. 


2) p2: The docs say that the 24 steps in AFR readings from 1.00v to 1.85 will equal your AFR: 10:1 === 1.00v, 13.8:1 === 1.38v, etc. The only issue is that if this wire is only reading 0-1v, I am not sure we can do that. Though, I was running my gauge in p0, the 0-5v range, and have not noticed any difference except the screwed up offsets. p0 could possibly be scaled, but you would lose resolution and you would likely have to use something to attenuate the signal (I have heard of people using voltage splitters for stereos to halve voltage; could possibly work here with a transform).

3) p0/p1: Attempt to scale the 0-5v range as listed just above and add an extra 0 so as to get more granular with the resulting lambda reading, like:

((*(High Limit – Low Limit) x V out / 5 + Low Limit* ) / )

I did some math using this guide here, so I know it can be scaled properly, though this isn't the best way as it's out of range in the first place:








0-5V Signal to Measurement Reading Converter


This voltage signal to measurement conversion tool will convert an electrical signal within the range of 0 to 5 volts to the ideal reading of any linear measurement type and create an incremental volts conversion scale for each measurement range entered.




www.sensorsone.com





*NOTE: *This will be a pain in the arse, too. I have not tried it yet, but I am sure that it will be. Best to be avoided unless you want to by stock in headache medicine. 

4) p4: Given that this is the closest to what can be read via that wire (Pretty please correct me if I am wrong), and the fact that at least the AEM 30-4110 has a decent resolution in that range, using the formula above can get maybe get close, but because it's not a linear signal (you will have to change the math based on AEM's docs for the 0-1V range) and reversed, math will will not be stay the same, and your values will be inverse (low lambda result from transform would be lean, not rich. Basically flipping your math around, plus you have to account for the slope, as it's not linear.). That sounds like a pain in the arse. Don't use it. Tried it, useless. 

To be continued...


----------



## Blasirl (Mar 31, 2015)

RoninDusette said:


> Greetings. So this started out yesterday morning (literally 24 hours ago) as an attempt to comment on a post, and by the time I knew I it, my 2 hour train ride was over and I had a wall of text. I decided to put it into a separate post.


Can you reload or refresh the pictures?


----------



## RoninDusette (Aug 21, 2018)

Oh yeah. Totally. I didn't see that it did that


----------



## RoninDusette (Aug 21, 2018)

Blasirl said:


> Can you reload or refresh the pictures?


I would love to, but it seems as though someone has yanked my ability to edit my post. If someone did, it would have been awfully nice to be informed when and for what reason. Can you check my permissions please?


----------



## RoninDusette (Aug 21, 2018)

Blasirl said:


> Can you reload or refresh the pictures?


May I please get rights to edit my posts? I am only doing so to have correct and up to date info.


----------



## Taxman (Aug 10, 2017)

I can only edit my posts which were made in the last 24 hours.


----------



## Blasirl (Mar 31, 2015)

RoninDusette said:


> May I please get rights to edit my posts? I am only doing so to have correct and up to date info.


I have been offline for a bit. I'll ask to see what's going on as that is above my level.


----------



## RoninDusette (Aug 21, 2018)

Blasirl said:


> I have been offline for a bit. I'll ask to see what's going on as that is above my level.


 For sure. That would be much appreciated. I want to make sure they stay updated with good, recent info. If it is ok, I will start reserving the next couple of posts too


----------



## Blasirl (Mar 31, 2015)

RoninDusette said:


> For sure. That would be much appreciated. I want to make sure they stay updated with good, recent info. If it is ok, I will start reserving the next couple of posts too


I have not heard anything yet. As far as reserving slots, as soon as you make the first post, reserve as many as you think is necessary. They can always be deleted, but not added.


----------



## RoninDusette (Aug 21, 2018)

Word. Just wanted to make sure it's OK to do that. If it's is cool, I'd like to update each of these recent posts mostly for grammar and whatnot. If they could be opened up for 24 hours (though please let me know when that window is before doing that) that would be awesome. 

I wouldn't mind chatting with an admin or two about getting some sort of rights elevation for my tutorial posts, especially if I'm putting the time, money, and effort to do experiments and share detailed info with the community, I think it could be considered an even trade.  I ask with all due respect and humility.


----------



## Blasirl (Mar 31, 2015)

RoninDusette said:


> Word. Just wanted to make sure it's OK to do that. If it's is cool, I'd like to update each of these recent posts mostly for grammar and whatnot. If they could be opened up for 24 hours (though please let me know when that window is before doing that) that would be awesome.
> 
> I wouldn't mind chatting with an admin or two about getting some sort of rights elevation for my tutorial posts, especially if I'm putting the time, money, and effort to do experiments and share detailed info with the community, I think it could be considered an even trade.  I ask with all due respect and humility.


I still have not received an answer ...

Try selecting "Edit" in your post. Do not use the sideways ellipses at the top of your thread.


----------



## Blasirl (Mar 31, 2015)

I sent another message further up the chain ...


----------



## RoninDusette (Aug 21, 2018)

Blasirl said:


> I sent another message further up the chain ...


Sweet. Thanks.


----------



## Blasirl (Mar 31, 2015)

RoninDusette said:


> Sweet. Thanks.


I got a question from an admin about you. I answered them - fingers crossed.


----------



## RoninDusette (Aug 21, 2018)

Blasirl said:


> I got a question from an admin about you. I answered them - fingers crossed.


Hopefully it was a good question? Lol. I just want a little room to contribute. That is all. I've been sick lately but I have some more cool writeups I'll be doing too.


----------



## Blasirl (Mar 31, 2015)

They needed clarification on what the issue was.. With the changeover to the new software, so many things are still dorked up.


----------



## Administrator (Feb 26, 2010)

You should be able to edit your post for up to 24 hours. Near the timestamp at the top of the post, you should see an edit link if it is within that time limit. After 24 hours you would need to reach out to a mod/admin for assistance.

Time limits are used in order to preserve useful thread content, while also protecting the forum against spam. We have formulated the current times in a way to best prevent thread confusion and time gaps left vulnerable to spam. 

- Cricket


----------



## RoninDusette (Aug 21, 2018)

Administrator said:


> You should be able to edit your post for up to 24 hours. Near the timestamp at the top of the post, you should see an edit link if it is within that time limit. After 24 hours you would need to reach out to a mod/admin for assistance.
> 
> Time limits are used in order to preserve useful thread content, while also protecting the forum against spam. We have formulated the current times in a way to best prevent thread confusion and time gaps left vulnerable to spam.
> 
> - Cricket


While I can appreciate that, I am not a spammer, obviously, and second, I want to be able to update my tutorial posts to help the thread NOT get confusing or out of date. For instance, I have yet ANOTHER update to my tutorial. I want to update the tutorial, not post a comment in my own thread. Let's say that the thread gets pages deep, and I have something extremely important to amend; I post a comment on page 3 on Friday, by Monday, there for several more pages... few people are going to read the WHOLE THREAD. 

Help me help you. Please. I would much rather post here and keep traffic flowing where relevant, rather than direct people to a blog page on my own site... For reals, feel me on this; I am trying to donate my time, experience, and hours and hours and hours of tuning to the community. I am sure were can figure out a way to elevate permissions for my own posts. You have my word that I will not abuse it, but I want to write and share this stuff, and would rather do it here, as stated previously. Otherwise I guess I will get flagged for spam by trying to share info by posting links to my own blog that can stay updated with info for you, and anyone else here. This time limit for these posts (which I have been trying to regain access to for a couple of months now to edit) has hindered me VERY much from writing more and keeping these things up to date. I mean, if you guys want that, then so be it, but I am not going to be a d*** and not help people learn this stuff, especially when the online classes are CRAZY expensive (I may just start my own... who would subscribe? Let me know in the comments below. haha) and HP Tuners has very little interest in keeping their docs up to date. 

So, talk to the rest of the guys and gals and let's work this out. you can contact me directly at [email protected].


----------



## Administrator (Feb 26, 2010)

There has been an update to post edits since the original reply was posted to you. Please look for the three vertical dots at the top of your post. Click the dots and the edit menu will expand. 
-Philip


----------



## RoninDusette (Aug 21, 2018)

Awesome! Thanks!


----------



## Eddy Cruze (Jan 10, 2014)

RoninDusette said:


> Awesome! Thanks!


Its* not* awesome, you are only allowed to edit 7 posts in 10 days and have no delete rights anymore. The guys here are a multi million dollar Canadian conglomerate and just want an individual post/click count without any regards to the forum layout or ease of reading. Other than that how is the $100 Tuning sale doing?


----------



## Administrator (Feb 26, 2010)

Eddy Cruze said:


> Its* not* awesome, you are only allowed to edit 7 posts in 10 days and have no delete rights anymore. The guys here are a multi million dollar Canadian conglomerate and just want an individual post/click count without any regards to the forum layout or ease of reading. Other than that how is the $100 Tuning sale doing?


It may be awesome to some, but if you don't find this to be accurate to your experience, how many do you feel would satiate your editing needs. Unlimited within the first 24 hours usually helps me catch most editing mistakes I may make (human error and what not)

The 10 additional edits are usually more than I find I need before the first refreshes. Do you feel like you're going through them quicker? I'd love to hear more. 

-Gerrit


----------



## Eddy Cruze (Jan 10, 2014)

Administrator said:


> It may be awesome to some, but if you don't find this to be accurate to your experience, how many do you feel would satiate your editing needs. Unlimited within the first 24 hours usually helps me catch most editing mistakes I may make (human error and what not)
> 
> The 10 additional edits are usually more than I find I need before the first refreshes. Do you feel like you're going through them quicker? I'd love to hear more.
> 
> -Gerrit


The previous setup allowed for unlimited deleting of posts (unless you were the O/P) and unlimited edits. This Forum is a work in progress and needs to be updated, revised, and corrected from time to time. You have eliminated all of this and much much more. This was the premiere Forum for the Chevy CRUZE, the new layout has decimated 80% of the forum traffic because it's cumbersome & hard to read


----------



## -loki- (Dec 13, 2019)

I recently joined... was expecting more traffic like jbody.org... back in the days before cell phone instant notifications... the layout doesn't seem bad and fairly user friendly. 

Anyhoo isn't this thread about tuning?


----------



## RoninDusette (Aug 21, 2018)

-loki- said:


> I recently joined... was expecting more traffic like jbody.org... back in the days before cell phone instant notifications... the layout doesn't seem bad and fairly user friendly.
> 
> Anyhoo isn't this thread about tuning?


Dude I was on nobody) jbody for years. My first tuner was a 98 cavi 2200 ohv. Haha. That was in like 2004.


----------



## -loki- (Dec 13, 2019)

This was my 3rd j body. GRD head, motor built by RSM racing. 2.3 HO PORTED INTAKE MANI... ETC... 

I HAVE A 4TH IN THE GARAGE.


----------



## RoninDusette (Aug 21, 2018)

-loki- said:


> View attachment 285449
> View attachment 285450
> 
> This was my 3rd j body. GRD head, motor built by RSM racing. 2.3 HO PORTED INTAKE MANI... ETC...
> ...


Sick. I was DJYoshaBYD. My 98 was black too. I swear if I could get a 2.2 ecotec one right now I'd buy it in a heartbeat. They only made them for 2 years before the cavalier was deprecated in favour of the cobalt. My Hondas were always much faster than that bucket, but it held its own. I'll post a photo if I can find it. 

To the topic at hand; I will be updating my posts soon. Recently am out of work and have been going through it. Also, after a year of research and development, I've started digging deep into my pet project called "Suave". A modern cross platform tuning solution that doesn't look like garbage and from 2002. It's taken a very long time to get to this point but I'm coding out the APIs and all that day by day. Since I have a spot in my heart for gm and my cruze in general, obviously when the beta comes around, cruzetalk (2nd only to my own site) will be where it is debuted and invites for testing are going to be available. It's going to be at least 6 months, but it's in the works.


----------

