Go Down

Topic: Bike interface OBD (Read 50168 times) previous topic - next topic

artcore

Anyone can give a code solution to read k line of injection motorcycle using the L9637D circuit? thank you

TriB

Anyone can give a code solution to read k line of injection motorcycle using the L9637D circuit? thank you
Serious?
Here are 8 pages about this topic. With tons of code snippets and detailed explanations.
And the minimum of 5 links to GitHub, with full solutions for SDS (Suzuki) and KDS (Kawasaki).
Attachments with *.ino-Files and so on...

Furthermore, there are even more threads about this topic.

We will help you out with any specific question, but please be a little bit proactive :)
I cannot read this thread for you :P

artcore

Well, thanks in advance, sorry for my first entry in this forum.
I want to read the communication on K-Line on Yamaha Vixion motor using IC L9637D circuit, thanks  :)

TriB

As far as I could understand the YDS (Yamaha Diagnostic Protocol) protocol, it is close to the Honda protocol.
There are no sender-/receiver-adresses or header information. Just the checksum at the end.
You initialize the diagnostic mode by sending 0x80 and from then on you can just submit 0x02 and it gives you:
Rpm, Speed, Error, Gear & Checksum.

Until now, we only have working solutions for Kawasaki and Suzuki here in the forum.
I think, you will have to create something by your own.

A great startingpoint will always be the ECU-Hacking forum. Thats where the most of us have our basic information from :)

artcore

Oh, well, I'm learning to try using the L9637D IC and Arduino codes, but the results I get are usually only able to generate hex numbers that are data of ECU and sometimes only a few parameters whose value is almost the same as the Yamaha diagnostic tool on Generally, such as the value of Battery Voltage, incoming/intake air pressure. Thank you

TriB

I was going on developing the Suzuki solution.
As I found out with my Kawasaki, the most calculations from ECU Hacking forum are wrong or not precise.
This seems equal to the Suzuki  ::)


Has somebody found the speed in data? It is 0xFF all the time.
And there is no other value, which seems to fit. My Gsx-R 600 is from 2006 and has a digital speedometer, which let me guess, the data should be there...

cyclegadget

Has somebody found the speed in data? It is 0xFF all the time.
And there is no other value, which seems to fit. My Gsx-R 600 is from 2006 and has a digital speedometer, which let me guess, the data should be there...
I am not positive, but I thought that the speed came from the pulse counter on the front sprocket, and then went directly to speedometer cluster. Certainly, the odometer information is stored in the speedometer cluster. You can change ECUs and your mileage will still be stored int he gauge cluster.

  I need to review the wiring to find the answer, Suzuki is pretty good with individual wire colors for everything.


Mark
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

TriB

#127
Jul 27, 2017, 04:37 pm Last Edit: Jul 28, 2017, 10:32 am by TriB Reason: RPM still not right
Thank you Mark!
That´s what I expected. But it does not really matter, because I also use GPS to record the track and measure my lap-times.


My current calculations are:
Gear
None :)

Engine coolant Temperature in degrees Celsius
((uint32_t)ecuResponse[17] * 160 / 256) - 30

Intake manifold absolute pressure (kPa)
All found calculations are not coherent. I am getting a 0xB9 = 185 dec.
My location is at about ~40 meters above sea level, which is


0m 29.9inch Hg 760mmHg 14.7psia 1.03kg/cm³ 101kPa

(Source)
Without having values from different heights, it is nearly impossible to get an approximated factor.

Engine Speed (RPM)
A*100+B is definitely wrong. All calculations base on 256 factor A*256+B
It is stored under double precision, I think:
(((uint32_t)ecuResponse[13] << 8 ) + ecuResponse[14]) / 2
(<< 8 is equal to *256)
[EDIT:] No it´s not. / 2.56 seems closer but still not right. Or my dashboard shows slightly different values. The RPM is at about 1,900 (The needle almost touches the 2000 on the scale) after starting up. /2 makes 2,191 and /2.56 - 1711.

Throttle Pos. Sensor
There are some calculation to degrees, which in my eyes aren´t very helpful.
That´s why I work with min & max values (max is actually not from my bike, due to loudness reasons in my garage)
maximum = 0xDD;
minimum = 0x39;
value = map(ecuResponse[15], minimum, maximum, 0, 100);

gives you the percentage.

Voltage
I expect it to be rather the dynamo output then the battery voltage.
  • because it is zero without a running engine
  • it is to high with ~13,8v

(uint32_t)ecuResponse[20] * 20 / 256

Relative/Secondary Throttle pos. sensor
Should be adequate to TPS. but I didn´t got time to measure min & max values.

That´s what I guess, right now :) I´ll try to get TPS min & max values and try to measure my battery voltage, next time.

TriB

Hi guys,

I´ve been on a racetrack, last weekend. During the breaks, I got some spare time to go on testing.
Again, the most calculations are still not right.
Voltage: Measured 12.44 and 13.9 was calculated
RPM: Seems to fit more or less. Probably the rev meter is not very accurate.
TPS: Enhanced the code with automatic adjustment, now it shows the right percentage (which is enough for me). Next step is to store min & max values to eeprom and make them readable via bluetooth.

Sadly I got dozens of break downs :(
With ignition on, I can listen to the ECU for hours. With engine on, I receive some values and run into a timeout. After 5 Seconds (Minimum time to wait from ISO protocol), it might gets initialized again.
10-20 Seconds data and again: timeout.

My loop checks the last request and if it is older then a second, it sends a keepalive message to the ECU.
Bluetooth asks constantly for single data (RPM, Temp, TPS, ect.), so I request the ECU on every RPM question. The remaining data comes from a buffer until RPM is asked again and "fresh"-data is obtained.

After the request is sent to the ECU, a timer is reset on every received byte. If the timer passes 55ms, the timeout is thrown (ISO specification says 40ms). That´s what happens right now.

Did someone also got breakdowns? Or is it related to my Code, device or bike? :(

cyclegadget

Trib,

 Are you trying to use Bluetooth to communicate with the bike, or to the Arduino board on the bike?

 When the bike is off, the OBD voltage is +-12volts. When the bike is running you will get some switching spikes and alternator noise that would show up on an Oscope. Your circuit may need some capactors or more shielding.

 I can log my Suzuki with my laptop while riding on the road with no problems. I still need to finish my Arduino however.
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

TriB

#130
Aug 17, 2017, 05:21 pm Last Edit: Aug 18, 2017, 01:46 pm by TriB Reason: Added example videos
Hi cyclegadget,

I connected an Arduino to a HC-06 and created some kind of ELM327 compatible protocol.
Made that to transfer my data to my Garmin Virb camera, which is capable of OBD II recording.
You can, more or less, use every OBD II / ELM327 compatible device or app to see the data.

That works fine for my Kawasaki. Suzuki gets one PID to transfer all data, Kawa one PID for each value (RPM, Speed, TPS, ect.), so I changed the sketch a bit and added a small caching mechanism, like described in my previous post.


The voltage comes from the ECU data, it´s zero until the engine is started. The formula from here and from ECU Hacking Forum gives me a different value, then my multimeter. That´s why I expect it to be wrong. Like some other values.

Due to the fact, that it runs on my Kawa, I expect the cirquit to be right. The sketch goes on, but gets a timeout from the ECU, what can be anything, I guess  :smiley-roll:

PS: You can see it here or here on YouTube.


Go Up