Page 1 of 1

Adding OBD2 channels that aren't on the list

Posted: Sun Mar 15, 2015 4:02 am
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.

Posted: Tue Mar 17, 2015 2:28 am
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.

Posted: Tue Mar 17, 2015 4:21 am
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?

Posted: Tue Mar 17, 2015 12:26 pm
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.

Posted: Tue Mar 17, 2015 11:10 pm
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.

Posted: Wed Mar 18, 2015 1:49 am
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.

Posted: Wed Mar 18, 2015 3:25 am
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.

Posted: Wed Mar 18, 2015 8:28 pm
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!

Posted: Wed Mar 18, 2015 10:12 pm
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.

Posted: Thu Mar 19, 2015 1:52 am
by brentp
Excellent- let us know what you find out!