Adding OBD2 channels that aren't on the list

Discussion on the RaceCapture App - Windows, Android, OSX and Linux.

Moderators: JeffC, stieg

Post Reply
Copper280z
Posts: 30
Joined: Sun Mar 15, 2015 3:03 am
Location: United States

Adding OBD2 channels that aren't on the list

Post by Copper280z »

I'm curious about adding OBD2 PIDs. What I specifically want is to be able to log the cars built in steering angle sensor.

I see that there is a "obd2_channels.json" file in \resource\settings. I've played with it a bit but not had much luck achieving what I wanted to, or anything like what I expect should happen at all. Does this file do what I think it does? Is this the right place to be looking or is there a different config file that might be more useful?

Edit: Looks like this should have gone in the V2 section, not this one.

JMcDonough
Posts: 70
Joined: Tue Mar 10, 2015 3:31 pm
Location: Detroit, MI

Post by JMcDonough »

For the steering angle sensor, are you sure it is available as a PID? It may be on the vehicle's CAN bus, but not able to be read as an OBD PID.

Copper280z
Posts: 30
Joined: Sun Mar 15, 2015 3:03 am
Location: United States

Post by Copper280z »

Unless Torque for android is lying to me, I think it's available via OBD PID. Even if it turns out not to be, I know there are other PID's that could be interesting and I'm curious if there is a way to access a custom PID.

On the topic of the actual steering position, I have a string pot I can use and I bet it is available on CAN. Torque for android has a steering angle that seems to work for it, I'm not sure if it's reading CAN or OBD PID.

Speaking of CAN, is there a way to log CAN messages other than through a lua script?

JMcDonough
Posts: 70
Joined: Tue Mar 10, 2015 3:31 pm
Location: Detroit, MI

Post by JMcDonough »

I thought I read something elsewhere on the forum about custom PIDs not yet being available. Found it:

http://www.autosportlabs.org/viewtopic. ... 2182#22182

No idea if there is a way to create them now by editing certain files.

What make/model/year car are you trying to get the data from?

Due to the limitations of PIDs (logging rate, especially when trying to log multiple signals), my planned approach is to pick up desired signals off the CAN bus rather than using PIDs. I'm logging on a 2008+ vehicle, so its a matter of finding the messages and interpreting them.

Regardless, I agree. Custom PIDs would be a welcomed additional feature.

Copper280z
Posts: 30
Joined: Sun Mar 15, 2015 3:03 am
Location: United States

Post by Copper280z »

I actually found steering angle on CAN last night, so effectively this issue is 'solved' for me, but I'd still like to know if there is a way to do custom PID's, even if by editing config files and not through the UI.

Finding it on the CAN bus really wasn't that hard, I setup the CAN logger like in the wiki (which is configured to output in CSV, effectively), pulled up PuTTY and set it to save the file, then shook the wheel around a bunch. I then opened the log in excel, sorted the data by CAN ID, and did a line plot of everything. I looked for a waveform like how I shook the wheel, then checked to see what ID that part corresponded to, then I modified the lua script to only print that ID, went back out to the car and shook the wheel looking just at that ID. Took about 3 iterations to find the right one.

I'd really like to know now is if there's a way to log CAN outside of the lua scripting. The max of 30hz update isn't bad, but having 100hz would be better.

JMcDonough
Posts: 70
Joined: Tue Mar 10, 2015 3:31 pm
Location: Detroit, MI

Post by JMcDonough »

While you could certainly sample the actual steering angle sensor at 100Hz, it very well might not be updating that quickly on the CAN bus. The controller that is directly reading the sensor (BCM?) may be polling it faster than it gets broadcast onto the CAN bus for other controllers (and you) to consume. That said, having a higher sample rate (like 100Hz) would help you determine that and allow the user to record it at the native update rate of the signal.
Josh

Copper280z
Posts: 30
Joined: Sun Mar 15, 2015 3:03 am
Location: United States

Post by Copper280z »

I'm assuming the BCM and PCM are talking pretty frequently, the steering position is used in the TCS and stability control in this car, and it will play with the throttle and ABS to accomplish both.

I assume the 30hz tick rate for the script is set so that it won't interfere with the rest of the operation too bad if someone builds a monster of a script.

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

Post by brentp »

Hi,

Thanks for your investigative work. We're working on the ability to specify custom PIDs in the OBD-II configuration- in addition to custom CAN mapping for handling streaming messages.

Note - on the CAN logging script - even though the tick rate runs at 30Hz, there is internal buffering of up to 10 CAN messages in between ticks. If you notice the logic in the script, it will drain the buffer until there are no further messages, then wait for the next tick.

Due to this buffering / batching approach you'll get faster performance than the 30Hz woud imply.

Finally - got a list of custom PIDs? let us know the details and we'll get support for them!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Copper280z
Posts: 30
Joined: Sun Mar 15, 2015 3:03 am
Location: United States

Post by Copper280z »

That's interesting on the batching of the can messages, and great news on the custom PID's and can mappings. I had been planning on trying the PID that the Android app Torque said it was reading, but at that point I didn't realize it read the canbus too. I can share the mappings I've figured out for my car, I'd like to figure out a few more first.

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

Post by brentp »

Excellent- let us know what you find out!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply