ISO 9141-2 Diagnostics

It's all about the code!
Post Reply
User avatar
Snake____1
Posts: 35
Joined: Sun Sep 04, 2016 6:05 pm
Location: Norway

ISO 9141-2 Diagnostics

Post by Snake____1 » Sun Apr 23, 2017 9:19 am

Hi,

Is there a possibility to implement ISO 9141-2 Diagnostics to the code? Probably a shot in the dark, but I'm optimistic :)

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: ISO 9141-2 Diagnostics

Post by russian » Sun Apr 23, 2017 12:05 pm

https://en.wikipedia.org/wiki/On-board_diagnostics
ISO 9141-2 - is that the one commonly known as "K-line"

I think my Miata has it
But there are currently no plans to work on in.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Tomin
Posts: 39
Joined: Fri Oct 18, 2013 8:03 pm

Re: ISO 9141-2 Diagnostics

Post by Tomin » Sun Apr 23, 2017 6:02 pm

Why old ISO if there is a faster, simpler and more versatile CAN ?

Odesláno z mého SM-A320FL pomocí Tapatalk
Tomas

Rhinoman
contributor
contributor
Posts: 246
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK
Contact:

Re: ISO 9141-2 Diagnostics

Post by Rhinoman » Mon Apr 24, 2017 8:04 am

I looked at this a while back, OBD2 Mode 1 (live data) is mostly implemented already. It would need a small rewrite to implement two byte PIDs if extended diagnostics were required - the OBD2 specification is rather limited.
Last edited by Rhinoman on Tue Apr 25, 2017 7:48 am, edited 1 time in total.

stefanst
contributor
contributor
Posts: 579
Joined: Wed Feb 17, 2016 12:24 am

Re: ISO 9141-2 Diagnostics

Post by stefanst » Mon Apr 24, 2017 7:12 pm

Please be careful when implementing OBDII.
If rusefi could be used to "cheat" emissions, there may be regulatory concerns.

Rhinoman
contributor
contributor
Posts: 246
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK
Contact:

Re: ISO 9141-2 Diagnostics

Post by Rhinoman » Tue Apr 25, 2017 7:42 am

Tomin wrote:Why old ISO if there is a faster, simpler and more versatile CAN ?
I wanted full plug and play and the stock vehicle wasn't wired for CANBus but had a comprehensive diagnostic capability that used KWP2000. I also wanted it to be compatible with the manufacturer's handheld scan tool and a scangauge or similar - if you select '1998 -> MX5 -> 1.6' on the scan tool it selects KWP.

stefanst wrote:Please be careful when implementing OBDII. If rusefi could be used to "cheat" emissions, there may be regulatory concerns.
Implementing ISO diagnostics isn't the same as implementing OBD2, the ISO standards are not 'OBD2 standards' but international standards - OBD2 merely mandates the use of subsets of those standards. There are millions of vehicles out there that use ISO diagnostics but are not OBD2. The correct way to implement them is to set PID 1C Mode 1 to return 'Not OBD Compliant' or to not implement that PID (its only mandated by OBD2).
Last edited by Rhinoman on Tue Apr 25, 2017 7:52 am, edited 1 time in total.

Rhinoman
contributor
contributor
Posts: 246
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK
Contact:

Re: ISO 9141-2 Diagnostics

Post by Rhinoman » Tue Apr 25, 2017 7:49 am

I should have said 'live data' not fault codes. I have corrected my post above.

Tomin
Posts: 39
Joined: Fri Oct 18, 2013 8:03 pm

Re: ISO 9141-2 Diagnostics

Post by Tomin » Tue Apr 25, 2017 7:53 am

It's not a big problem to implement ISO protokol, But It's Not so Simple like added Two wires in the OBD connector. If you really want implement it, You Can try Google with "Stern iso protocol". There are sources somewhere.
Tomas

Rhinoman
contributor
contributor
Posts: 246
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK
Contact:

Re: ISO 9141-2 Diagnostics

Post by Rhinoman » Tue Apr 25, 2017 8:58 am

Tomin wrote:It's not a big problem to implement ISO protokol, But It's Not so Simple like added Two wires in the OBD connector. If you really want implement it, You Can try Google with "Stern iso protocol". There are sources somewhere.
There are better circuits on the internet, it looks like the comparator circuit violates the common mode specification of the comparator and the reference is biased at 10% of battery voltage which is unusual and with no hysteresis it is not very robust. My preference is to use the L9637 because it offers built in protection, the majority of the circuits on the web have an open collector output with no protection or do not have the correct 510 Ohm pull-up resistor.
Last edited by Rhinoman on Tue Apr 25, 2017 9:03 am, edited 1 time in total.

Tomin
Posts: 39
Joined: Fri Oct 18, 2013 8:03 pm

Re: ISO 9141-2 Diagnostics

Post by Tomin » Tue Apr 25, 2017 9:00 am

510 ohm must be in a scanner ONLY, not in an ecu.
Tomas

User avatar
mobyfab
Posts: 137
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France
Soldering skill: yes
Coding skill?: yes

Re: ISO 9141-2 Diagnostics

Post by mobyfab » Tue Apr 25, 2017 2:19 pm

What's the point of implementing ISO9141-2 when we have CAN bus?

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: ISO 9141-2 Diagnostics

Post by russian » Tue Apr 25, 2017 2:23 pm

I assume @ wants to stay as bmw e36 as possible?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
kb1gtt
contributor
contributor
Posts: 3469
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: ISO 9141-2 Diagnostics

Post by kb1gtt » Wed Apr 26, 2017 1:38 am

@ are you set on this or would you be ok with can bus? Can bus is more common and faster. You should be able to use normal scan tools for diagnosis. However keep in mind the goal is diagnostics and not spoofing. Basically of the shelf scan tools would report thinks like rpm, temperature and some day perhaps long term and short term fuel trim. However it would not report regulatory items including cat ok, vin, ECT.
Welcome to the friendlier side of internet crazy :)

nighthunter
donator
donator
Posts: 95
Joined: Sun Feb 21, 2016 8:39 pm

Re: ISO 9141-2 Diagnostics

Post by nighthunter » Tue May 02, 2017 10:35 am

One interresting thing to support 9141 is that it could act as a "reader" from the stock ECU to "clone" the original ignition and injection maps and use it as a stock tuning base for your car and engine. I think it would be pretty simple to implement eg.: Lets say we switch rusefi to a learning mode, in wich when you drive it will not read from maps but read the parameter from K-line and write to the correct map field in rusefi. (Many LPG installations use this learning feature to reconstruct petrol maps). And when we have lets say 70% coverage of the map, we can interpolate the rest and voila we have an "original clone" map for our engine and we can start to fine tune.

Btw. is there any software that can to this task - read PIDs and reconstruct maps for a generic K-Line interface for PC? I think there would be some???

User avatar
kb1gtt
contributor
contributor
Posts: 3469
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: ISO 9141-2 Diagnostics

Post by kb1gtt » Tue May 02, 2017 11:27 am

Is there a reason why that information would not be available in CAN and is available in 9141?

I've wanted to develop a "play recorder" which is basically just a Frankenso. Basically, make a short extension to the existing OEM harness connector, and sniff the injector pulses and sniff the various analog inputs,ect. Simply recording this data to a SD card. Then this log could be sent to a developer, who could then remotely play it back to an frankenso, or perhaps even just play the numbers back to a discovery board. Then you could off line tune until your tune matches the existing play file. At that point you could then re-flash the firmware and tune into the frankenso that originally recorded the OEM engine, disconnect the OEM ECU, and your off to the races. However that's a bit more pie in the sky. Lots of work to make that happen.
Welcome to the friendlier side of internet crazy :)

nighthunter
donator
donator
Posts: 95
Joined: Sun Feb 21, 2016 8:39 pm

Re: ISO 9141-2 Diagnostics

Post by nighthunter » Tue May 02, 2017 11:53 am

Many older cars do have only K line, or even when they have CAN, it is only used for instruments panel/internal backplane and can or can not output all internal variables. In K line you have a "standardized" PID set, what every or lets say nearly every engine must output, when requested.
I know the pros of can - it is faster and can be hardware implemented in many MCUs, but you have standardized only the physical message frame, not the data in there, and it is for every make different.

User avatar
mobyfab
Posts: 137
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France
Soldering skill: yes
Coding skill?: yes

Re: ISO 9141-2 Diagnostics

Post by mobyfab » Wed May 03, 2017 5:03 pm

No, CAN PIDs are standardized, just like K-line, KWP2000, etc etc.
Both can have custom PIDs but the message format is the same.

Rhinoman
contributor
contributor
Posts: 246
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK
Contact:

Re: ISO 9141-2 Diagnostics

Post by Rhinoman » Thu May 11, 2017 3:20 pm

nighthunter wrote:One interresting thing to support 9141 is that it could act as a "reader" from the stock ECU to "clone" the original ignition and injection maps and use it as a stock tuning base for your car and engine. I think it would be pretty simple to implement eg.: Lets say we switch rusefi to a learning mode, in wich when you drive it will not read from maps but read the parameter from K-line and write to the correct map field in rusefi. (Many LPG installations use this learning feature to reconstruct petrol maps). And when we have lets say 70% coverage of the map, we can interpolate the rest and voila we have an "original clone" map for our engine and we can start to fine tune.
Btw. is there any software that can to this task - read PIDs and reconstruct maps for a generic K-Line interface for PC? I think there would be some???
The problem is that K-Line diagnostics is very slow. The OBD2 spec calls for 100ms delay between messages which limits the maximum number of PIDs to around 8.5 per second but I have found that using the Windows with a Virtual Com Port slows that to around 6 PIDs/sec and around 4 PIDs/sec using a Bluetooth dongle. So if you're accelerating hard then your parameters are going to be some way out of sync. OBD2 also doesn't output injector PW as standard. Every OBD2 ECU that I've worked with also has a proprietary protocol to access more diagnostics, faster.
You should also take into account the much greater number of maps in an OEM ECU - you won't simply be reconstructing the original map but averaging a number of different maps.

User avatar
kb1gtt
contributor
contributor
Posts: 3469
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: ISO 9141-2 Diagnostics

Post by kb1gtt » Thu May 11, 2017 8:46 pm

I don't know if this is still true or not any more, but once upon a time, I understand that VW did 2X on the baud rate, which access the enabled a special OBD. It was all the same information, but had additional layers of information, like sensor adaptations, etc.
Welcome to the friendlier side of internet crazy :)

Post Reply