2015 WRX CAN Oddity with RPM

Discussions on CAN mapping for ECUs, sensors, PDMs, and more.
Post Reply
pacmantravis
Posts: 4
Joined: Sat May 23, 2020 10:24 pm

2015 WRX CAN Oddity with RPM

Post by pacmantravis »

I've gone through a plethora of information on this forum and other Subaru related forums and I'm having an issue with decoding RPM via CAN. I'm hoping someone can point me in the right direction as I feel like I'm SO CLOSE!

The issue I am facing is that RPM is grossly inaccurate at idle (17000+ RPM), but is accurate the moment I press on the accelerator pedal. I ran the basic CAN logger script and made sure to try and log at idle and with the accelator pedal pressed, and I don't see what could triggering this.

My CAN mapping for RPM is as follows.

CAN ID: 320 (0x140)
Offset: 2
Length: 2
Little Endian
Formula: X

In the BRZ mapping thread I saw that the CAN mapping for RPM is similar, but in bit mode (16 bit offset, 14 bit length). Both mappings give me the same results.

I've attached my confg file to this post. Also, here is a snippet of the logs when running the CAN logger script.

Is there anything I'm missing or should be looking for?

Code: Select all

[320.0]: 0.0, 9.0, 86.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 0.0, 10.0, 86.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 0.0, 11.0, 87.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 0.0, 12.0, 87.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 0.0, 13.0, 87.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 0.0, 15.0, 86.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 0.0, 0.0, 85.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 2.0, 1.0, 85.0, 67.0, 0.0, 0.0, 11.0, 0.0, 
[320.0]: 3.0, 3.0, 83.0, 3.0, 0.0, 3.0, 11.0, 0.0, 
[320.0]: 4.0, 5.0, 83.0, 3.0, 0.0, 4.0, 13.0, 0.0, 
[320.0]: 4.0, 6.0, 84.0, 3.0, 0.0, 4.0, 13.0, 0.0, 
[320.0]: 4.0, 7.0, 85.0, 3.0, 0.0, 4.0, 13.0, 0.0, 
[320.0]: 5.0, 8.0, 85.0, 3.0, 0.0, 4.0, 13.0, 0.0, 
[320.0]: 6.0, 9.0, 84.0, 3.0, 0.0, 5.0, 13.0, 0.0, 
[320.0]: 7.0, 10.0, 84.0, 3.0, 0.0, 6.0, 14.0, 0.0, 
[320.0]: 8.0, 11.0, 83.0, 3.0, 0.0, 7.0, 14.0, 0.0, 
[320.0]: 9.0, 12.0, 83.0, 3.0, 0.0, 8.0, 14.0, 0.0, 
[320.0]: 10.0, 13.0, 85.0, 3.0, 0.0, 9.0, 14.0, 0.0
Attachments
2015wrx-6-2020.zip
(4.5 KiB) Downloaded 218 times
Last edited by pacmantravis on Mon Jun 08, 2020 8:41 pm, edited 1 time in total.

pacmantravis
Posts: 4
Joined: Sat May 23, 2020 10:24 pm

Post by pacmantravis »

I've made some progress, but am not sure how to create a fix/workaround. Hoping to get some help from those more advanced at this than me.

When the car is idling, the ECU adds a leading "4" to the HEX value for B3. (Reference: https://www.pro-touring.com/threads/130 ... -an-A-Body), which throws off the RPM value and puts it around 17K RPM.

If I remove the leading "4" from the Hex value, I get the correct RPM.

It looks like the car gets the RPM Value by combining the HEX values of B3 and B2 (B3B2) and converting that value to decimal, which gives exact RPM.

Here is a link to the log with calculations that show this: https://drive.google.com/file/d/1D_3cHE ... sp=sharing

So, I guess my question is -- Is there a way to filter out that leading "4" Hex Value on B3 when the vehicle is idling? Bytes 0 and 5 are accelerator and tps (respectively), and it looks like that leading "4" in B3 is only added when B0 or B5 are at 0 (no accelerator/throttle pressure).

Accurate Example:
[320.0]: 9.0, 15.0, 164.0, 8.0, 0.0, 7.0, 12.0, 0.0

B2=164(Dec)=A4(Hex)
B3=8(Dec)=8(Hex)
B3B2(Hex)=8A4=2212(Dec) RPM

Innacurate Example (only when off throttle pedal):
[320.0]: 0.0, 11.0, 208.0, 72.0, 0.0, 0.0, 12.0, 0.0,

B2=208(Dec)=D0(Hex)
B3=72(Dec)=48(Hex) - Leading 4 in Hex
B3B2(Hex)=48D0=18,640(Dec) RPM - Incorrect

After removing the hex "4" from B3.
B2=208(Dec)=D0(Hex)
B3=8(Dec)=8(Hex) - Removed the leading "4"
B3B2(Hex)=8D0=2,256(Dec) RPM

pacmantravis
Posts: 4
Joined: Sat May 23, 2020 10:24 pm

Post by pacmantravis »

I was able to figure this out.

I mapped a CAN Channel in RaceCapture:

Channel Name: rpmraw
CAN ID: 320 (0x140)
Offset: 2
Length: 2
Formula: x

Created a virtual channel called "RPM". Created a function in lua that grabs the rpmraw data, strips the 2 highest bits from the higest byte, and sends the result to the RPM virtual channel. Then I added the getrpm() function to my onTick() and great success!

Code: Select all

rpmid = addChannel("RPM",50)

function getrpm()
local rpma = getChannel("rpmraw")
if rpma ~= nil then
 setChannel(rpmid, bit.band(rpma, 0x3FFF))
end
end

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

great, glad you figured it out!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply