PDA

View Full Version : OBD logging and real-time histogram



ColPaul
01-24-2020, 08:24 PM
I've very new to this and am very excited about all the work that has been done on PCMHammer. Is there a data logging tool with realtime histogram capabilities or is everyone logging and then doing post-processing. It would be great to be able to drive around and see which parts of the VE table have been captured so that I can drive differently to get the undersampled data points.

woody80z28
02-04-2020, 08:59 PM
I'd love to know this as well. I'm tuning with lsdroid, but looking for a good datalog solution.

NSFW
02-04-2020, 11:45 PM
PCM Hammer includes a primitive logger in Release 11, but I just noticed that it was missing the .profile files that are needed to actually use it. So I just added them to the zip file:

https://github.com/LegacyNsfw/PcmHacks/releases/tag/2019.12.30.01

There's no real-time histogram, but I agree that would be a good idea. For now, you'd have to post-process the .CSV file in another tool. Excel could probably do it.

Also, it would really benefit from more / better profiles (lists of parameters to log). It's pretty straightforward to create profiles using SAE PIDs, if you're comfortable editing XML. Logging anything that isn't an SAE PID would require doing some reverse-engineering to find the memory location of the parameter you want... that's more work, but I'm sure we'll hunt down the most useful parameters over time.

steveo
02-05-2020, 05:49 AM
if you're using an ELM chip try tunerpro with the ELM plugin. its 'history table' will pretty much do what you ask, i think.

woody80z28
02-16-2020, 03:25 AM
I just bought a USB cable and couldn't get it to work. The driver said something about being phased out in 2012 and I couldn't get it to assign as a COM port. Would not recommend it:
https://www.amazon.com/dp/B081S15H7R

In related news...has anyone been able to log in TunerPro via an OBDLink? LX ideally? I'm logging in torque, but it leaves a lot to be desired.

woody80z28
02-18-2020, 06:55 AM
Looking like this will work via OBDlink in TunerPro. It connects on my bench, will try it in the truck tomorrow.

Anyone know how to add EGR position to the datastream? That's where I'm wiring in my wideband 0-5v.

According to a post from 2009 I found it's PID.2811
https://ls1tech.com/forums/pcm-diagnostics-tuning/496625-how-log-your-wideband-hptuners-without-eio-5.html#post11938549

woody80z28
02-19-2020, 07:36 AM
It works! I had to build some lookup tables to convert C to F and KPH to MPH, etc...but it works. LTFT was showing 128 like obd1 so I converted that to 100 to show percent. Overall I'm happy with it.

"VN5000" is the original author of the ADX according to the header. I searched and didn't find any info on that name.

I attached an ADX capture to show the code for the PID. That's way over my head. Anyone have an idea how to code for PID.2811 to get EGR voltage in the datastream so I can do the wideband conversion?

woody80z28
02-19-2020, 07:22 PM
Found a hex converter online and the byte string for KPH translates to M01P0D501R1. Did I mention that part is over my head? Haha

woody80z28
02-20-2020, 04:11 PM
Ok I found this thread and it was very helpful:
http://www.gearhead-efi.com/Fuel-Injection/showthread.php?1164-Tuner-Pro-V5-and-OBDII-plug-in

Wiki also shows the PID info here:
https://en.wikipedia.org/wiki/OBD-II_PIDs

So, we know vehicle speed is:
0x4D 0x30 0x31 0x50 0x30 0x44 0x53 0x30 0x31 0x52 0x31 =
M01P0DS01R1=
'M' + HH + 'P' + HH + 'S' + HH + 'R' + H
Where 'M' is for Mode, "HH" is two hex ASCII bytes (e.g. 'F' 'F' for 0xFF). 'P' is for PID, 'S' is for size of PID data reply, and 'R' is for reply count. Note that the 'R' data is a single hex digit (e.g. '2').
= Mode 1 PID 13, get only 1st reply

So for PID 2811 I'm thinking: M01PAFBS01R1 (hopefully 3 hex bytes is not a problem and it still figures the delineation via the S after it for the size packet)
0x4D 0x30 0x31 0x50 0x41 0x46 0x42 0x53 0x30 0x31 0x52 0x31

woody80z28
02-21-2020, 07:11 AM
Ok, it looks like that's working perfect! Won't know for sure until my wideband comes in this weekend, but I set it up just to read volts for now, and I get 0v cold, and then about 0.5-2.1v while driving, which is definitely influenced by throttle.

I also tried to log PID 68 commanded EQ ratio (hex 44), but can't get it right.
0x4D 0x30 0x31 0x50 0x34 0x34 0x53 0x30 0x32 0x52 0x31
It sends back 2 data bytes, and I set it to 16bit in the ADX, but there are two equations online and neither get the output to about 1 in closed loop.
2/65536(256A+B) and ((A*256)+B)/32768
The latter is closer, but not there. I'm not sure it's an equation issue though. Cause the data has spikes in it that wouldn't make sense for EQ ratio. I set it up identical to the way MAF and RPM are done (which are also 2 data byte PIDs.)

kur4o
02-21-2020, 01:24 PM
The afr pid is 119e and is 1 byte long. Conversions is x*10. Let me know if you need some other info for logging. You are the perfect guinea pig for the adx improvement.
It is good to know that not all PCM supports all PIDS. If you get weird data or no response it might be because the OS doesn`t support it.

Do you have a copy of the adx used.

woody80z28
02-21-2020, 08:30 PM
I do have a copy of the ADX I started with and the modification I'm at now. I'll post them tonight.

I just searched pid.199e and pid.119 without any hits. Just add all four characters in hex to the string? And that comes back as commanded AFR?

kur4o
02-21-2020, 10:14 PM
It should be something like that. I am not that familiar how the messages are constructed.

brandonwh64
02-22-2020, 04:46 AM
I do have a copy of the ADX I started with and the modification I'm at now. I'll post them tonight.

I just searched pid.199e and pid.119 without any hits. Just add all four characters in hex to the string? And that comes back as commanded AFR?

WOW thank you! It sounds like you have done a great job. I am going to setup my tablet for this and test

woody80z28
02-22-2020, 06:54 AM
Ok, I never did get a chance to try out PID 119E tonight (busy being Mr. Mom)...but added some notes to my ADX and attached it here. (Use at your own risk...I'm new to this)

Interestingly enough: my wideband came in and has some options my 2010 AEM doesn't. It has the typical 0-5v output, but also options for 1-2v, 0-1v linear and 0-1v simulated NB.

So I just did a little looking and I'm actually thinking about adding Blue pin 68 to the PCM for o2 sensor #3 and PID22 so I can retain EGR function. I don't have post-car o2 sensors on my 2500hd, so as long as it will read the data, I don't lose any functionality.

brandonwh64
02-24-2020, 09:31 PM
Ok, I never did get a chance to try out PID 119E tonight (busy being Mr. Mom)...but added some notes to my ADX and attached it here. (Use at your own risk...I'm new to this)

Interestingly enough: my wideband came in and has some options my 2010 AEM doesn't. It has the typical 0-5v output, but also options for 1-2v, 0-1v linear and 0-1v simulated NB.

So I just did a little looking and I'm actually thinking about adding Blue pin 68 to the PCM for o2 sensor #3 and PID22 so I can retain EGR function. I don't have post-car o2 sensors on my 2500hd, so as long as it will read the data, I don't lose any functionality.

Thank you so much! Once I get my car more reliable, I will start getting more involved into this to see if I can help.

woody80z28
03-03-2020, 06:45 AM
So my additons for Target EQ won't work for PID119E or PID68. I get nonsensical data...which seems tied to vehicle speed for some reason. Same with the PID22 for the rear o2 sensor (that I added the wire in). Voltage is 0 at a stand still, and climbs with vehicle speed. Not sure what I'm doing wrong.

My next plan is to change my wideband from 0-1v to 0-5v and try the EGR position wire. But I'll have to flash a new tune to zero out EGR added spark and physically unplug the EGR and tap into the wire. I'm not hugely excited on that idea...but I need something to work.

brandonwh64
03-03-2020, 11:49 PM
So my additons for Target EQ won't work for PID119E......

So from what I am reading, You are trying to log in open loop and trying to get rear O2s to work correct?

kur4o
03-04-2020, 12:34 AM
So my additons for Target EQ won't work for PID119E or PID68. I get nonsensical data...which seems tied to vehicle speed for some reason. Same with the PID22 for the rear o2 sensor (that I added the wire in). Voltage is 0 at a stand still, and climbs with vehicle speed. Not sure what I'm doing wrong.

My next plan is to change my wideband from 0-1v to 0-5v and try the EGR position wire. But I'll have to flash a new tune to zero out EGR added spark and physically unplug the EGR and tap into the wire. I'm not hugely excited on that idea...but I need something to work.

It still can be config issue, or the OS doesn`t support afr pid.
What kind of pcm and OS you are trying to log it.

You can try the stnterm.exe to manually log the pid and see if it gets 7f response or it gets actual data.
The elm config through tunerpro is some dark magic for the enlightened.

woody80z28
03-06-2020, 04:04 PM
8322 os on a 411.

Logging in closed loop, but trying to read my wideband via the bank 1 sensor 2 circuit. Target EQ is just to have a reference on what's going on when not in closed loop (warmup, pe, etc.) I have target AFR on my obd1 car and it's handy.

I'll Google stnterm.exe when I get a minute. Thanks

kur4o
03-06-2020, 07:18 PM
Do you have the stock bin. I will make a list from it, what pids are supported for the OS, so you can log some extra things. There could be even some free 0-5v pins not used by your setup.

woody80z28
03-07-2020, 05:44 AM
Do you have the stock bin. I will make a list from it, what pids are supported for the OS, so you can log some extra things. There could be even some free 0-5v pins not used by your setup.
That would be awesome! Bin right here:
http://www.gearhead-efi.com/Fuel-Injection/showthread.php?1512-2001-TunerPro-Bin-Files&p=79585&viewfull=1#post79585

kur4o
03-09-2020, 09:39 PM
I finally figured why it is not working for you. Playing with some tools to see what actually tuner pro sends to the elm device.

It looks like that the elm plugin supports only mode1 with the standard SAE pids.

The 2 bytes pid are handled by mode 22 requests. I tried to reconfigure the tunerpro send message but couldn`t make it to work. It does change to mode 22 but when I try to extend the Pxxxx to 4 characters it just stops sending.

For now you can log mode1 pids 00-1f, I hope someone can make it to work with mode22 so you can benefit with the extra data.

Here is some good reading material I have on file.

woody80z28
03-10-2020, 06:35 AM
Hmm. From all the other lists I've seen, O2b1s2 is 16 in hex, not 1146 or 15. Interesting. PID15 would still be within 00-1f. I can try 15 (M01P15S02R1).

I wondered if that data just wasn't read because rear O2s are not used in my truck. I see some half tons used 8322 OS, and they have P10420 enabled where mine doesn't...but I don't see a place to "turn on" the rear o2 in my BIN.

This weekend I tried moving the pin to the EGR and using that with no luck. Oddly enough, it also scaled perfectly with the speed for some reason... So I went back and noticed my WBO2 MACRO was right underneath the KPH MACRO in the MONITOR MACRO list. It was the 11th entry in the list. Maybe the ELM will only take 10 readings total and it just duplicated the 10th reading for the 11th? I deleted the STFT B1 MACRO and moved the WBO2 MACRO up in the list to see if that makes any difference. I'll find out tomorrow. Either way, I'll switch the wiring back to the o2b1s2 pin when I get a minute and try that out too. I'd really prefer that than killing my EGR.

kur4o
03-10-2020, 08:13 PM
Here is the list with all the pid available for the OS you have.

Now since mode22 is likely not to work with elm plugin, why not reconfigure the data you can log with the standard pid 0-1a.

It is to time to get some patches done for the ls1 pcm.

This is the sae pids the pcm OS support



ROM:00001F64 dword_1F64: dc.l $10200
ROM:00001F68 off_1F68: dc.l sub_454E8
ROM:00001F6C dc.l $30100
ROM:00001F70 dc.l sub_454AE
ROM:00001F74 dc.l $40000
ROM:00001F78 dc.l sub_45458
ROM:00001F7C dc.l $50000
ROM:00001F80 dc.l sub_45446
ROM:00001F84 dc.l $60000
ROM:00001F88 dc.l sub_4541E
ROM:00001F8C dc.l $70000
ROM:00001F90 dc.l sub_453F6
ROM:00001F94 dc.l $80000
ROM:00001F98 dc.l sub_453CE
ROM:00001F9C dc.l $90000
ROM:00001FA0 dc.l sub_453A6
ROM:00001FA4 dc.l $B0000
ROM:00001FA8 dc.l sub_4539A
ROM:00001FAC dc.l $C0100
ROM:00001FB0 dc.l sub_4538E
ROM:00001FB4 dc.l $D0000
ROM:00001FB8 dc.l sub_45356
ROM:00001FBC dc.l $E0000
ROM:00001FC0 dc.l sub_4532C
ROM:00001FC4 dc.l $F0000
ROM:00001FC8 dc.l sub_4531A
ROM:00001FCC dc.l $100100
ROM:00001FD0 dc.l sub_4530E
ROM:00001FD4 dc.l $110000
ROM:00001FD8 dc.l sub_452F4
ROM:00001FDC dc.l $120000
ROM:00001FE0 dc.l sub_452BA
ROM:00001FE4 dc.l $130000
ROM:00001FE8 dc.l sub_452B2
ROM:00001FEC dc.l $140100
ROM:00001FF0 dc.l sub_45264
ROM:00001FF4 dc.l $150100
ROM:00001FF8 dc.l sub_4523A
ROM:00001FFC dc.l $160100
ROM:00002000 dc.l sub_45210
ROM:00002004 dc.l $180100
ROM:00002008 dc.l sub_451C2
ROM:0000200C dc.l $190100
ROM:00002010 dc.l sub_45198
ROM:00002014 dc.l $1C0000
ROM:00002018 dc.l sub_45190
ROM:0000201C dc.l $1E0000
ROM:00002020 dc.l sub_45156
ROM:00002024 dc.l $210100
ROM:00002028 dc.l sub_45150


The one that starts with $ is the pid number. The first 2 bytes is the pid number[zero missing] byte3 is config 0=1byte response,1=2bytes response.4th byte is not defined yet.

I can repatch any of these pids to log what you want from the full list.
The sub field under the pid is the subroutine where the value for the pid is taken.


For the patch to work you will have to full flash the pcm.

Make a list what you need from the extended pids and which ones from the sae list you don`t need and I will make a quick patch for logging.

woody80z28
03-11-2020, 05:13 AM
Well, the back end is above my skill level, but let's make this happen!

Needed as-is:
$05 - Engine Coolant Temperature
$06 - Short Term Fuel Trim Bank 1
$07 - Long Term Fuel Trim Bank 1
$08 - Short Term Fuel Trim Bank 2
$09 - Long Term Fuel Trim Bank 2
$0B - Manifold Absolute Pressure
$0C - Engine RPM High Resolution (RPM x4)
$0D - Speed in KPH
$0E - Ignition Timing Advance
$0F - Intake Air Temperature
$10 - Mass Air Flow
$11 - Throttle Position Sensor %
$14 - O2 B1S1
$15 - O2 B1S2 (for WBO2 0-1v)
$18 - O2 B2S1
$19 - O2 B2S2

Wish list
$119E - Air Fuel Ratio (this is target, right?)
$11A6 - Knock Retard (which one?)
$125D - Knock Retard (which one?)
PID 2811 - EGR position 0-5v (not in your list, but referenced all over for use with wideband 0-5v)

Excited to see what happens here! Thanks

kur4o
03-11-2020, 03:39 PM
I made a list what we can re purpose in the datastream.
Sae pids
$03 -2bytes
$04 -1byte
$12 -1byte -Air fuel target
$13 -1byte -11a6 knock retard
$16 -2byte -114b egr feedback[I will rip the 16bit data straight from the AD readings] stock have some filtering.
$1c -1byte -1144 AC pressure switch[in case you want to log wideband through AC, or add second wideband]
$1e -1byte


SO we have 3 more pids left on the table. I will try to get a reading of gm/cyl reading used for table lookup, and the spark modifier[% blend between low and high octane table]

So 1 more left. Will try to get the knock counter there but can`t promise. If you need more data at stage2 we can make use of the full sae range from 00-1f, but it will be more time consuming.

2811 is not supported by the OS and I can`t find it anywhere in the datasheets I have. Could it be used for the can stuff.

woody80z28
03-13-2020, 06:08 AM
I didn't see 114b in the list...that's probably the same wire as the "2811" that HPtuners calls EGR 0-5v.

AC pressure also makes sense for wideband, although I read that's not usable until 03-07, which would be a different OS. Unless you can make this OS read it with an added pin?

kur4o
03-16-2020, 10:55 PM
I will try to get the patch done ASAP. I didn`t have much free time recently.

Stay tuned.

woody80z28
03-20-2020, 03:02 PM
I will try to get the patch done ASAP. I didn`t have much free time recently.

Stay tuned.
Absolutely. Thanks again.

I ran into a rocker panel replacement project on the wife's car to sell it. Body work takes forever when you're an amateur!

woody80z28
03-22-2020, 04:19 PM
I will try to get the patch done ASAP. I didn`t have much free time recently.

Stay tuned.

Hold off on that for a bit if you haven't already started. I've got another BIN manually modified by another member to get PE working. I gotta test that out today. Thanks!

kur4o
03-25-2020, 12:57 AM
$12 -1byte -Air fuel target
$13 -1byte -11a6 knock retard
$16 -2byte -114b egr feedback[I will rip the 16bit data straight from the AD readings] stock have some filtering.
$1c -1byte -1144 AC pressure switch[in case you want to log wideband through AC, or add second wideband]
$1e -2byte - gm/cyl value used for table lookup.


I set the patch as this. 16bit value of egr is straight from the AD channel. You need to log some voltages to figure the conversion factor.

You can use the small program I attached to apply the patch. UNzip to a folder and run from there [.net 4 is needed to run it], click on modify and select the bin you want to patch, click add patches, select the patch and than save the modified bin. You have to write OS for the flash to take effect.

woody80z28
03-25-2020, 06:46 AM
That is slick as shit! Works nice, thank you. I'm gonna flash that BIN hopefully tmo. The PE is working as of tonight, so I'm finally getting somewhere with this thing.

Gearhead rules!

woody80z28
03-26-2020, 06:22 AM
So I got the BIN flashed and I'm getting my ADX set up to try this out. Setting them up is fairly straightforward...until it comes time to figure out the formulas for $119E Air Fuel Ratio and $11A6 Knock Retard. I found the formula for PID68 Target EQ [2/65536 * X], but I'm not confident that's right. I found nothing applicable for a knock retard formula at all. I could try to use the regular spark advance formula I suppose...

kur4o
03-26-2020, 11:03 AM
For afr try x/10 conversion. If you got close to 14.7 at closed loop it is correct.
knock retard could be something like x/11.378

woody80z28
03-29-2020, 08:52 PM
So, after trying a few things...I'm pretty much at a loss.

These PIDs I've tried to add don't work. The custom patched ones such as Target AFR and Knock Retard, but also the standard B1S2 o2 voltage for WBo2 (however, this truck doesn't have a post-cat sensor from the factory). As I'm typing this, it makes me wonder now if I can add another standard PID that this truck should have like B1S1 o2 voltage.

What I've confirmed is that these PIDs I've tried to add conform to the PID directly above it in the monitor macro for commands (capture attached). So it seems to ignore the PID I added and use the value received from the previous RX. So I can't even test the formulas to see if they are right.

I'll post a log later with an ADX to show what I mean.

Ugh.

kur4o
03-29-2020, 09:19 PM
Post the current adx, maybe there is some config issue.

woody80z28
03-29-2020, 10:16 PM
Ok, log329.xdl and patch.adx go together; both files with reduced go together also. Originally I had the added PIDs at the bottom of the commands list and wondered if it would only receixe X amount of data. So I made another one that reduced the overall PIDs and dispersed them in between the standard ones so they weren't at the bottom of the list. That's how I discovered that the added PIDs get filled in with the data from the standard PIDs immediately before them.

Hopefully you can discover something I did wrong! haha

BTW: that b1s1 adx had the wideband charged to just read bank 1 sensor 1 narrowband o2 voltage. It appeared to be correct while driving.

kur4o
03-30-2020, 03:07 PM
Have no clue where is the problem in tunerpro, in patch or in both or vehicle doesn`t support AFR the way we know it. At least for sure there is some data sent on the target afr, so patch kind a works.

I think only manual troubleshooting can find the problem.

Sending some custom commands with stnterm.exe can give more clues what is not working.
If you are willing to try I will get you some commands.

woody80z28
03-30-2020, 08:19 PM
That kind of thing is above my current level of understanding, but I'm willing to learn it.

kur4o
04-03-2020, 12:26 AM
Here is the stnterm.

Upon starting select the comm port and baud rate of the elm device. If you are unsure of the comm port open device manager and see the number there.

Pressing the ATI button will get you the elm id.
When you are sure you have good communication with the elm device, send ATSP 2 . This will set the protocol to j1850 vpw.

Now you can send custom request to pcm. Like requesting different pids.

To request mode1 sae pids type

01xx

01=mode
xx= sae pid number 01-ff

To request mode 01 pid 1c simply send
011c and you will get the result.
If you get a 7f reply, this means that the pid is not supported or the request is in invalid format.


To request enhanced pids you will use mode 22 requests.
the format is

22xxxx01

22=mode
xxxx=pid
01=??byte count request?? not sure on this but in most cases 01 will do the job.

So 119e pid can be requested by sending

22119e01

Let me know how you are coping with this so we can get to level2.

kur4o
04-03-2020, 12:44 AM
To get mode22 working you might need to change the header first.

send

ATSH6C10F0

After that mode 22 requests should work fine.

woody80z28
04-07-2020, 06:55 PM
Ok, I got the COM and baud figured out COM5 and 9600. I know ELM is communicating because I connected in TunerPro and then closed out. I even unplugged and replugged after closing TP to make sure it wasn't "busy" before opening stterm.

Key on, engine running: I send "ATSP 2" and it shows in the list red with no response. Same thing with PIDs I tried: 0112, 0107, 010D. What am I doing wrong?

kur4o
04-07-2020, 08:11 PM
Pressing any of the built in button does it return a reply. I am sure it is set for different baud rate stock, so try all of them until you get a communication from the tool.
You can try sending it without the space: atsp2. Before opening make sure the bluetooth is paired and the com port is not used by other software.

Ignore tunerpro settings since it can request different baud rate. 9600 is extremely slow, try upping it to 115000 in tunerpro and see if it connects.

kur4o
04-18-2020, 12:07 AM
Found that some of the later version of tunerpro supports 2 bytes pid requests. I will give it a try and hopefully it will work.

woody80z28
04-18-2020, 06:39 AM
I've got to try the other baud rates still, too. My dad got Covid, so I was on mandatory quarantine and ripped up the floor in my house. I'll post here as soon as I get more results. I haven't forgotten.

brandonwh64
05-12-2020, 04:23 PM
Great work woody! I have downloaded you ADX for tunerpro RT and I have a OBDLINK LX but I am having a hard time getting it to work. I imported your ADX but its not logging anything. Do I need to specify the OBDLINK adapter COM somewhere in the app?

woody80z28
05-14-2020, 06:05 AM
Great work woody! I have downloaded you ADX for tunerpro RT and I have a OBDLINK LX but I am having a hard time getting it to work. I imported your ADX but its not logging anything. Do I need to specify the OBDLINK adapter COM somewhere in the app?
You'll need the ELM327 plugin for TunerPro and select it in preferences where you select plugins or Autoprom.
http://www.tunerpro.net/downloadPlugins.html