Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: KDS Protocol


Member

Status: Offline
Posts: 21
Date:
RE: KDS Protocol


Hi guys, I can confirm that 0C register is speed. I have my set up and running and bellow few samples from yesterday's ride.
I have my small LCD showing GPS time and Speed and is located next to speedo clock. Both screens are recorded by go pro camera (screenshot below, don't be suggested by "gear 6", is not implemented yet :) ). BlueTooth logging works perfect, I use my android phone for this purpose.  There is around 60 "active" registers in zx6r. When I ask for rest, ECU response error code. List below as well.

example:
GPS time>161436.686 GPS speed> 47
reg:0xc 0x80 0xf1 0x11 0x4 0x61 0xc 0x0 0x91 0x84
calculated from my equation: 44.20731707;

GPS time>160943.186 GPS speed> 28
reg:0xc 0x80 0xf1 0x11 0x4 0x61 0xc 0x0 0x62 0x55
calculated from my equation: 29.87804878;

GPS time>161323.186 GPS speed> 69
reg:0xc 0x80 0xf1 0x11 0x4 0x61 0xc 0x0 0xdc 0xcf
calculated from my equation: 67.07317073.

 

below  is the list of "active" registers, few we know already:

 

_______________________________________14            
GPS time>160335.435GPS speed> 40           
reg:0x0 0x800xf10x110x60x610x00xdf0xf70xff0x870x45
GPS time>160335.435GPS speed> 40           
reg:0x1 0x800xf10x110x30x610x10x50xec   
GPS time>160335.685GPS speed> 39           
reg:0x2 0x800xf10x110x30x610x20x00xe8   
GPS time>160335.935GPS speed> 39           
reg:0x4 0x800xf10x110x40x610x40x00xff0xea  
GPS time>160335.935GPS speed> 39           
reg:0x5 0x800xf10x110x40x610x50x940xc00x40  
GPS time>160336.185GPS speed> 37           
reg:0x6 0x800xf10x110x30x610x60xa70x93   
GPS time>160336.185GPS speed> 37           
reg:0x7 0x800xf10x110x30x610x70x550x42   
GPS time>160336.185GPS speed> 37           
reg:0x8 0x800xf10x110x40x610x80xca0x400xf9  
GPS time>160336.685GPS speed> 35           
reg:0x9 0x800xf10x110x40x610x90x350x740x99  
GPS time>160336.685GPS speed> 35           
reg:0xa 0x800xf10x110x30x610xa0xb60xa6   
GPS time>160336.935GPS speed> 34           
reg:0xb 0x800xf10x110x30x610xb0x30xf4   
GPS time>160336.935GPS speed> 34           
reg:0xc 0x800xf10x110x40x610xc0x00x810x74  
GPS time>160339.685GPS speed> 41           
reg:0x20 0x800xf10x110x60x610x200xc30xe50xe00x1f0xb0
GPS time>160340.935GPS speed> 40           
reg:0x27 0x800xf10x110x30x610x270x00xd   
GPS time>160341.185GPS speed> 40           
reg:0x28 0x800xf10x110x30x610x280x00xe   
GPS time>160341.185GPS speed> 40           
reg:0x29 0x800xf10x110x30x610x290x00xf   
GPS time>160341.435GPS speed> 41           
reg:0x2a 0x800xf10x110x30x610x2a0x00x10   
GPS time>160341.435GPS speed> 41           
reg:0x2b 0x800xf10x110x30x610x2b0x30x14   
GPS time>160341.935GPS speed> 41           
reg:0x2e 0x800xf10x110x30x610x2e0x00x14   
GPS time>160341.935GPS speed> 41           
reg:0x30 0x800xf10x110x30x610x300x00x16   
GPS time>160342.435GPS speed> 41           
reg:0x31 0x800xf10x110x30x610x310x00x17   
GPS time>160342.435GPS speed> 41           
reg:0x32 0x800xf10x110x30x610x320x00x18   
GPS time>160342.685GPS speed> 40           
reg:0x33 0x800xf10x110x30x610x330x00x19   
GPS time>160343.935GPS speed> 39           
reg:0x3c 0x800xf10x110x30x610x3c0x00x22   
GPS time>160343.935GPS speed> 39           
reg:0x3d 0x800xf10x110x30x610x3d0x00x23   
GPS time>160344.185GPS speed> 39           
reg:0x3e 0x800xf10x110x30x610x3e0x00x24   
GPS time>160344.185GPS speed> 39           
reg:0x3f 0x800xf10x110x30x610x3f0x00x25   
GPS time>160344.185GPS speed> 39           
reg:0x40 0x800xf10x110x60x610x400xf00x00x140x3f0x6c
GPS time>160344.935GPS speed> 40           
reg:0x44 0x800xf10x110x60x610x440x00xc0x8e0xf70xbe
GPS time>160347.435GPS speed> 41           
reg:0x54 0x800xf10x110x40x610x540x00x00x3b  
GPS time>160347.685GPS speed> 41           
reg:0x56 0x800xf10x110x30x610x560x30x3f   
GPS time>160348.435GPS speed> 41           
reg:0x5b 0x800xf10x110x30x610x5b0x590x9a   
GPS time>160348.435GPS speed> 41           
reg:0x5c 0x800xf10x110x30x610x5c0x00x42   
GPS time>160348.685GPS speed> 42           
reg:0x5d 0x800xf10x110x30x610x5d0x00x43   
GPS time>160348.685GPS speed> 42           
reg:0x5e 0x800xf10x110x30x610x5e0xcf0x13   
GPS time>160348.935GPS speed> 42           
reg:0x5f 0x800xf10x110x30x610x5f0xb50xfa   
GPS time>160349.185GPS speed> 42           
reg:0x60 0x800xf10x110x60x610x600xff0x70x00x10x50
GPS time>160349.185GPS speed> 42           
reg:0x61 0x800xf10x110x30x610x610x00x47   
GPS time>160349.435GPS speed> 43           
reg:0x62 0x800xf10x110x40x610x620x00x00x49  
GPS time>160349.435GPS speed> 43           
reg:0x63 0x800xf10x110x30x610x630x00x49   
GPS time>160349.685GPS speed> 43           
reg:0x64 0x800xf10x110x30x610x640x20x4c   
GPS time>160349.685GPS speed> 43           
reg:0x65 0x800xf10x110x30x610x650x00x4b   
GPS time>160349.935GPS speed> 43           
reg:0x66 0x800xf10x110x30x610x660xb30xff   
GPS time>160349.935GPS speed> 43           
reg:0x67 0x800xf10x110x30x610x670x00x4d   
GPS time>160349.935GPS speed> 43           
reg:0x68 0x800xf10x110x30x610x680x10x4f   
GPS time>160350.935GPS speed> 44           
reg:0x6e 0x800xf10x110x30x610x6e0x00x54   
GPS time>160351.185GPS speed> 43           
reg:0x6f 0x800xf10x110x30x610x6f0x00x55   
GPS time>160351.185GPS speed> 43           
reg:0x70 0x800xf10x110x30x610x700x00x56   
GPS time>160353.435GPS speed> 44           
reg:0x80 0x800xf10x110x60x610x800x00x00x00x210x8a
GPS time>160357.435GPS speed> 42           
reg:0x9b 0x800xf10x110x30x610x9b0x00x81   
GPS time>160358.435GPS speed> 41           
reg:0xa0 0x800xf10x110x60x610xa00x00x00x00x10x8a
GPS time>160402.685GPS speed> 40           
reg:0xbf            
GPS time>160402.685GPS speed> 40           
reg:0xc0 0x800xf10x110x60x610xc00x00x1f0xff0x70xce
GPS time>160407.685GPS speed> 39           
reg:0xe0 0x800xf10x110x60x610xe00x400x00x00x00x9
GPS time>160411.685GPS speed> 25           

 

I noticed that firs registers are constant, regardless if engine is on/off or I'm riding. I would assume that this is some info about ECU and Motorbike...

"

GPS time>155614.934GPS speed>  0           
reg:0x0 0x800xf10x110x60x610x00xdf0xf70xff0x870x45
GPS time>155614.934GPS speed>  0           
reg:0x1 0x800xf10x110x30x610x10x50xec   
GPS time>155615.184GPS speed>  0           
reg:0x2 0x800xf10x110x30x610x20x00xe8   

"

Now I'm looking for RPM's which will be related with speed gear and throttle as well.

if someone want I cand send whole file around 56 readings of ECU, from register 0x00 to 0xff. 1 loop takes 36 seconds so the whole ride covers around 31 minutes.

Next time i will be register only "active registers"...:) we learning.

regards

sample.png

 



Attachments
__________________
Reg B.


Member

Status: Offline
Posts: 21
Date:

Hi Guys,

I found another register, RPM's, it is reg 0x09 (ignore speed value i have big latency set up for now):

GPS time>92930.699GPS speed>55         
reg:0x9 0x420xfd0x800xf10x110x40x610x90x230x8f0xa2

and it is calculated:

rpm= value1*100+value2

3643rpm=35 (0x23)*100+142 (0x8f)

photo as a confirmation.

cheers

Next question : What next...?

We have: speed, rpm's, gear, temp, throttle sensor. For me that is enough i don't have more aspiration.

snap.jpg

cheers



Attachments
__________________
Reg B.
MXP


Veteran Member

Status: Offline
Posts: 28
Date:

chszanek wrote:

Thx for tip,
MXP did you had chance to check(confirm) 0x0c?

cheers


 Sorry, friend.

I had no time yet to verify.

PS The display you have used looks familiar to me. Did you use DisplayTech INT018ATFT for your prototype? wink



__________________


Member

Status: Offline
Posts: 21
Date:

Hi MXP,
No it is different. I'm not really good in programming so i had to use ST7735:
www.adafruit.com/products/358
Is controlled via ISP and Adafruit supply good library for it (and SD card as well).

I checked 0x0C and 0x09 so i don't need more confirmations, these registers work well.
The only think is that I think I have hint about "Fuel gauge". I will spend few minutes on it and let you know. If not I'm done and good luck with rest.

Regards
Bartek

__________________
Reg B.


Member

Status: Offline
Posts: 9
Date:

Hi chszanek,

would you release your Arduino Code?

Thanks

Phil



__________________


Member

Status: Offline
Posts: 21
Date:

Well Phil, today :)

now, is not what I expected to upload, this is still "dummy" code. By dummy, i mean that Arduino sends requests but don't check what comes back, this why if the communication will be lost, well, you basically lost data sending possibility. I have already the code to check what is coming from ECU but still didn't have time to add this to this code. Still SD card is not implemented (you can bin "sd.h and sd.cpp" includes.

Moreover, working with Arduino Uno was difficult because it has only one UART, you can have software serial but it needs extra timers and interrupts which clash with LCD, SD card library. I'm not software engineer so i'm always looking for simple solutions...

The important bit is that I managed to remove "echo" effect from K-line by proper UART sending data function:

"void serial_write_c1(char c)
{
            UCSR1B &= ~(1<<RXEN1);      // disable RX
            while (!( UCSR1A&(1<<UDRE1)));
                UDR1 = c;
            while (!(UCSR1A & (1 << TXC1)));
                UCSR1B |= (1<<RXEN1);       // enable RX again
}
"  I't is really cool function. you don't read what you sent :), but because of Arduino enviromet it "duplicates" definitions which are in "Serial.h" standard library. So in the end i changed the original Arduino declaration. It may worki in Arduino programming software, I use Code Block for Arduin, it has much much better GUI! i dont know why Arduino is trying to create new GUI:( waist of time if you have something like Code Block. After I will com back from my work and holidays (probably end of the year) I will migrate to pure AVR enviromant not Arduino (still using Arduino board and using AVR Builder, which is really cool!! ).

back to software description.

After you turn on your Kawasaki (power for arduino is from Kawa), it waits a little bit and starts communication and sending all stuff to BT module. As you may noticed all info are separated with ";" to have easy import to MS Excel for analyses. I didn't have time yet to "digest" data from ECU and display it, it is just sending it outside, Speed is from GPS.

Uart0 is for Arduino to communicate with PC, Uart1for KDE (10400), Uart2 for BT (57600), Uart2 for GPS (38400). Now if you want to use it with Arduino Uno you should delete all serial_init functions and probably everything what is related with LCD (I assume that you have basic level of programing knowledge, if not buy Arduino mega + LCD screen :), it is just £20 for kit).

I hope it helps, I will come back to this project but probably some time next year...don't know.

I will still happy to answer questions. I can provide other codes which have some cool and useful bits, but are not added to this. (this code is "all in one" when the other are spited on libraries).

 

Enjoy guys and see you soon!

Regards

Bartek

 

p.s. i couldn't upload here zip file this why go to my website (hehe once created never used :) ):

https://sites.google.com/site/trophy250es2/

and download (on the botom of the page file "kds_dziala.zip". If you will open it in Code Block for arduino , job is done. If not use only kds_dzial.ino in Arduino GUI.

Cool stuff: http://arduinodev.com/codeblocks/ just remember to download newest Arduino Builder i think 0.8.9

 

 

 



-- Edited by chszanek on Saturday 21st of June 2014 06:25:58 PM

__________________
Reg B.


Member

Status: Offline
Posts: 11
Date:

chszanek,

Well, perfect timing I guess. I'm picking up the project again after a bit of time off where I couldn't get any time to code. I believe we are all using close to the same hardware. I'm using a Arduino Uno R3 with the same 1.8" TFT color screen. I believe I have most of the code worked out and I'm not just building the circuit to the bike. Can anyone post a solid design that will not fry the board? I'm great at coding, but my circuit skills are basic. I have a good amount of parts and was starting to build something like this:
blog.workingsi.com/2010/10/research-on-arduino-obd-ii-interface.html

Thanks, I'll help this project and share all findings

__________________


Member

Status: Offline
Posts: 21
Date:

Quick one,
Did someone managed to overwrite rpm's register to (for example) reduce rmp's. I was just thinking how far we are from building basic downshifter...
need to dig few more info about this.

 

logic will be simple:

- you press the gear lever/pedal (with switch=sensor),

- atmega reads Gear,

- atmega reads actual rpm's,

- atmega has table, for each gear (for each motorbike different table :) ). Subtract from actual rpm's value from table,

- overwrite existing rpm value, maybe add some delay if necessary.

- gear down! job done, no clutch needed.

cheers
bartek



-- Edited by chszanek on Friday 25th of July 2014 08:29:30 PM

__________________
Reg B.


Member

Status: Offline
Posts: 8
Date:

RookieDDZ wrote:

Can anyone post a solid design that will not fry the board? I'm great at coding, but my circuit skills are basic.


Using all the information in this thread I've managed to get data out of the KDS port on my 2013 Ninja 1000 (Z1000SX)...

Attached is both a schematic and a "breadboard" view of what I'm using (thanks Fritzing) for anyone else who might be interested...

The pins for the KDS  in my pictures aren't necessarily numbered correctly, just use the information in previous posts for which is +ve, gnd and k-line.

The Arduino code took a bit of stuffing around (particularly the timing of the sending/receiving - its not just as simple as using a 10400 baud rate!) but its working now too. Next job is to hook up some LEDs for my "Gear indicator" and mount it somewhere I can see it while riding.

Also, in the interest of tracking what registers are valid, here's the list that don't return an error from the Z1000SX:

00 (4 bytes): ?
01 (1 byte): ?
02 (1 byte): ?
04 (2 bytes): Throttle Position Sensor
05 (2 bytes): Air Pressure = ??
06 (1 byte): Engine Coolant Temperature = (a - 48) / 1.6
07 (1 bytes): Intake Air Temperature
08 (2 bytes): Abs Pressure(?)
09 (2 bytes): Engine RPM = (a * 100) + b ...
0A (1 byte): ?
0B (1 byte): Gear Position = x
0C (2 bytes): Speed
20 (4 bytes): ?
27 (1 byte): ?
28 (1 byte): ?
29 (1 byte): ?
2A (1 byte): ?
2E (1 byte): ?
31 (1 byte): ?
32 (1 byte): ?
33 (1 byte): ?
3C (1 byte): ?
3D (1 byte): ?
3E (1 byte): ?
3F (1 byte): ?
40 (4 bytes): ?
44 (4 bytes): ?
54 (2 bytes): ?
56 (1 byte): ?
5B (1 byte): ?
5C (1 byte): ?
5D (1 byte): ?
5E (1 byte): ?
5F (1 byte): ?
60 (4 bytes): ?
61 (1 byte): ?
62 (2 bytes): ?
63 (1 byte): ?
64 (1 byte): ?
65 (1 byte): ?
66 (1 byte): ?
67 (1 byte): ?
68 (1 byte): ?
6E (1 byte): ?
6F (1 byte): ?
80 (4 bytes): ?
9B (1 byte): ?
A0 (4 bytes): ?
B4 (1 byte): ?

Many, many thanks to all who've posted previously for all the work they've done.



-- Edited by Greebo on Sunday 27th of July 2014 10:30:02 AM

Attachments
__________________


Member

Status: Offline
Posts: 8
Date:

I've tidied up my code and tested it but posting it here seems problematic - is there any way to make this forum software quote code?

It seems that no matter what I do in the Visual or HTML tabs of the post editor I always end up with [ i] causing italics to come on  instead of displaying [ i] and I'm sure there are other bits of the code that are being similarly mangled...



__________________


Member

Status: Offline
Posts: 11
Date:

Thought if you Paste as Plain Text, it works:

 

void setFastInit() {

tft.setTextSize(1);

tft.println("setFastInt");

//Start Initialization (FAST) of port

pinMode(11, OUTPUT);//was 18

digitalWrite(11, HIGH);

delay(750);

digitalWrite(11, LOW);

delay(25);

digitalWrite(11, HIGH);

delay(25);

}



__________________


Member

Status: Offline
Posts: 8
Date:

RookieDDZ wrote:

Thought if you Paste as Plain Text, it works:

 


 Try that again with some arrays...

uint8_t arrayvalue[50];

for (uint8_t i = 0; i < 50; i++) {
      arrayvalue = 0;
      delay(1);
}

should appear as:

arrayvalue[ i ] = 0;
delay(1);

but instead of that, everything after the [ i] is italicised... (I also added a [ /i] at the end to stop this section of text being italic too!)

Just so happens I use "i" as an array index a lot... hmm

Never fear, I'm investigating other options for getting the code posted :)



__________________


Member

Status: Offline
Posts: 8
Date:

Here's the raw code on PasteBin: http://pastebin.com/raw.php?i=wjW8crrr

Hope someone finds it useful!



__________________


Member

Status: Offline
Posts: 8
Date:

I've updated my code to include writing the data to an SD card... Also the temperature reading is now correct.

The PasteBin link above now contains the updated code.

__________________


Member

Status: Offline
Posts: 11
Date:

Greebo: Can you go into a little detail of why you choose the K-Line Transceiver,  Si9241AEY. I've seen a lot of simple circuits with a few NPN and resistors (which I used), but you went a little path. I like it and it's still simple. I just wanted to find out why this way.

 

P.S. and it's a little hard to find. Finding only surface mounts

Thanks



-- Edited by RookieDDZ on Thursday 31st of July 2014 01:11:44 AM

__________________


Member

Status: Offline
Posts: 8
Date:

That IC is specifically designed for interfacing K-LINE and L-LINE levels with TTL levels. There's a lot of posts on various "OBD-II" threads around the Internet where people are using this chip or one that is almost identical (the MC33290 gets mentioned a lot but is apparently harder to find now) to do their OBD-II interfacing.

I found it (in SMD form) on element14 for $6 (I ordered enough other stuff for other things to get free shipping). I then purchased some SOIC-8 -> DIP8 boards from eBay (5 for $1, shipped to Oz - search for "SOIC8 to DIP8") and soldered the SMD IC onto one. I grabbed a 10nF cap for $0.25 and already had the 510ohm resister. Plenty of people have posted on other forums about getting free samples of the Si9241, so it may even be obtainable for free.

Total cost was under $8, bugger all soldering and I knew it was going to work with the Arduino. Why roll your own when someone else has already done it for you for only a few bucks. :)

The only reason for the extra resistor and cap is so the device can handle up to a 36V K-LINEs, the datasheet has two combinations of R and C depending on your K-LINE voltage (6V-18V or 16V-36V), the 10nF and 510ohm are for the voltage range that covers the 12V we have on our bikes.

I was comfortable soldering a SOIC8 chip so it was a no brainer for me. Others may have different views on that.



__________________


Member

Status: Offline
Posts: 8
Date:

MXP wrote:

As described from protocol specifications, structure of messages are these ones:

Messagge (request) sent periodically from the GEAR INDICATOR (constant):    80 11 F1 02 21 0B B0

Byte    Name                Value        Description
-----------------------------------------------
0    Format Byte            0x80        Address mode: with address information, physical addressing
1    Target Byte             0x11        Address of target devide (ECU)
2    Source Byte            0xF1        Address of source device (GEAR INDICATOR)
3    Length Byte            0x02        Two byte following...
4    Service ID               0x21        ReadDataByLocallIdentifier
5    Parameter name    0x0B        "Gear position" Parameter
6    Checksum              0xB0        Checksum = 80+11+F1+02+21+0B module 0xFF (OK)


Hi MXP,

In your past above, (posted ages ago) you described the protocol used by the GiPro... Where did you get the "Description" information from?

You said in your post: "As described from protocol specifications" - which protocol specifications? Can you share them?



__________________
MXP


Veteran Member

Status: Offline
Posts: 28
Date:

Hello Greebo!

 

Yes, the standard used is ISO 14230.

I found some specifications on the web. I don't remember the link but if you send me your email I can send you all the PDFs. Or you can try by yourself with Google.

It seems to me that only images can be attached onto this blog (right?). So I can't post them here.



-- Edited by MXP on Tuesday 26th of August 2014 04:03:14 AM

__________________


Member

Status: Offline
Posts: 8
Date:

Ok, I did have quite a hard look (using Google) for ISO 14230 but I never found anything as detailed as you provided....

I've sent you a PM :)



__________________


Member

Status: Offline
Posts: 11
Date:

You guys looking for info like this:

Check Google search

 

Quick update: The original circuit I made was causing tons of problems and I couldn't get a full bytes posted to the bike. So, finally order and got my Freescale 33660 as the Si9241AEY is never available :(. Then I didn't order the SOIC-8 adapter. Long story story, I believe it is soldered right so I'm ready to test. (Man that thing is small). I'll post some items soon. Thanks for the help guys.



__________________


Member

Status: Offline
Posts: 6
Date:

Hi Guys,

I'm a newbie to ecu hacking (1 week) and to this site. Just wanted to say thank you to all in this thread, as all the kds info within has enabled me to get started with my project.
I don't own/ride a kawa crotch rocket, more like a kawa steam locomotive on steroids, the vulcan VN2000.

Thanks to all the info here and links to ISO documents etc. I've managed to let my (bluetooth) ELM327 talk to my kawa ECU. I tested with throttle position and it works, using a laptop with PuTTY to type in ELM327 commands directly.

I'll probably start a new thread for this, see if there are more ECU-hackers on cruisers (rare?) so I won't bother you anymore ;)

Thanks again!

__________________

2005 Kawasaki Vulcan VN2000



Member

Status: Offline
Posts: 8
Date:

I know it's an old question, but still...

On my bike (zx6r 2013) the throttle goes from 0xD3 to 0x377, so the values are quite different.

It looks like your equation is not applicable in my case as the throttle value does not seem to be linear. I attached a small graph showing the data I logged.

 

Does anyone have the same kind of throttle response?

 

Screen Shot 2014-09-28 at 22.56.22 .png

 

 

 



Attachments
__________________
o5i


Member

Status: Offline
Posts: 11
Date:

Hi guys, looks verry good... Im on a suzuki, seems to bee just the same...

__________________


Newbie

Status: Offline
Posts: 1
Date:

Hello Guys,

This topic helped me with my design for a temperature reader for my 2010 650R (or ER-6F in Europe).

How I was very lazy and had this arduino laying aroung, dediced to give him some use, wrote to very simple sketchs, just for tests purposes and I'm developing more seriously now.

Connector pinout:

2qbzqra.jpg

 

This is the basic schematic I used:

Schematic

I used the Nokia 5110 LCD with Adafruit Graphics Library: https://learn.adafruit.com/adafruit-gfx-graphics-library/overview

The first sketch: KDS_TEMP_PRINT initializes the KWP and pulls the temperature while prints the data in HEX over ASCII format to ease the analyzes, very hand for logging. You'll need an serial usb adaptor and a terminal program.

The second sketch: GLCD_ADAFRUIT_LOGOS does the same thing while prints the temperature in the display, do not forget to download and install Adafruit-GFX-Library-master and Adafruit-PCD8544-Nokia-5110-LCD-library-master.

Here its working:

 

To get the correct equation for the temperature sensor I checked the repair service, which had some points for the temp sensor for 0ºC(6540), 40ºC(1130) and 100ºC(150), replaced with an adjusted pot and got these values out of KDS:

 

OhmsTempHEX
   
   
654002E
1130406F
150100D2

 

The final equation is them: Y = (A-46)/0.6125, where A is the temperature byte received from the ECU. I checked the readings with my Infrared thermometer and they match by 1ºC, pretty god for a thermistor.

 

For the phase 2 I'll writer a better coded to handle Gear, Temperature and battery voltage (not sure yet If I'll try to find the byte in the KDS or directly read it). 

I've shared everything on my google drive: https://drive.google.com/folderview?id=0BxlZ1VzjFIjmSGE3UVNmMURuazA&usp=sharing

 



__________________
I void warranties


Member

Status: Offline
Posts: 6
Date:

Does anyone here know how to request multiple parameters at once?

So far I've only be able to request one parameter at a time, like 80 11 F1 02 21 0B B0 to get current gear. I'm looking for a way to get the ECU to reply with multiple or all parameter values.

I'm developing an android datalogging app, and this would help a lot for performance.



__________________

2005 Kawasaki Vulcan VN2000



Member

Status: Offline
Posts: 11
Date:

Schave - I don't believe you can make multiple requests, at least from what I have read about the protocol. Anyone is welcome to challenge also. But the requests take milli-seconds and you should be able to hammer requests one after another and have it act as real time as possible. Just write once the line is available, ask for the next request.

I don't see any issue with getting your second request only milli-seconds after the first, but I don't know your application and need. We are all doing something slightly different and you may have a need.

Hope it helps.



__________________


Member

Status: Offline
Posts: 6
Date:

Thanks RookieDDZ.

I'm doing exactly as you described, but I'm using a (bluetooth) ELM327 in between my android phone and ECU, so there's a limit to how fast it will work.

Right now I'm getting about 4.2 values per second in my logs.  So by limiting which values to log, it's still usable. I hope optimizing my app will shave off some more overhead and speed it up a little more.



__________________

2005 Kawasaki Vulcan VN2000



Member

Status: Offline
Posts: 6
Date:

Has anyone figured out the pressure values?
0x05, 2 bytes, (inlet?) air pressure (values mostly in 0x6000 - 0xA000)
0x08, 2 bytes, abs. pressure (returns pretty stable value of about 0xCC40)


How to calculate pressure from these values? I'm not sure they both use the same formula. With the engine not running, the first value reads 0000, instead of a value around that of abs. pressure. But maybe that just means the ECU is not gathering IAP value yet when not running.

anyway: how to calculate the pressure values from the returned hex values?


__________________

2005 Kawasaki Vulcan VN2000



Member

Status: Offline
Posts: 11
Date:

Schave, just a thought as I read your last message. 4.2, or 4 messages per second isn't too bad. You could cycle through the list. But my thought was are the components you are using causing that? My app is hardwired to the KDS port, and not using BT. Just displaying to a small color TFT screen. Maybe the transport to BT is slowing it?

I never did any time tests, and I don't have them. Maybe share some code, or describe how you get your counts? I guess just post a counter on the screen? I'd be curious to see what others come up with. But a great topic.



__________________


Member

Status: Offline
Posts: 6
Date:

I was already cycling the list in my logging app. However, I've done some (thread) optimizations and now I'm logging about six values per second.smile

I do indeed believe the ELM327 and extra bluetooth link in between must be slowing things down, so I probably will start using an arduino/raspberry pi or something like that.

Not sure what you mean by counts, maybe the app's output will help. Currently, I've configured my app to spit out a .csv file. Here's part of a file where I logged just throttle,rpm,gear,spd (with engine cut off):

Timestamp,LAT,LONG,ALT,Throttle,AIPress,Cooltmp,Inltemp,abspress,rpm,gear,spd    2015-06-03T11:28:00.679Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,0,NOP,NOP    2015-06-03T11:28:00.840Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,NOP,5,NOP    2015-06-03T11:28:01.023Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,NOP,NOP,0    2015-06-03T11:28:01.203Z,51.5809020864121,4.978453360284786,47.0,5,NOP,NOP,NOP,NOP,NOP,NOP,NOP    2015-06-03T11:28:01.376Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,0,NOP,NOP    2015-06-03T11:28:01.529Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,NOP,5,NOP    2015-06-03T11:28:01.727Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,NOP,NOP,0    2015-06-03T11:28:01.863Z,51.5809020864121,4.978453360284786,47.0,5,NOP,NOP,NOP,NOP,NOP,NOP,NOP    2015-06-03T11:28:02.034Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,0,NOP,NOP    2015-06-03T11:28:02.211Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,NOP,5,NOP    2015-06-03T11:28:02.350Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,NOP,NOP,0    2015-06-03T11:28:02.552Z,51.5809020864121,4.978453360284786,47.0,5,NOP,NOP,NOP,NOP,NOP,NOP,NOP    2015-06-03T11:28:02.743Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,0,NOP,NOP    2015-06-03T11:28:02.884Z,51.5809020864121,4.978453360284786,47.0,NOP,NOP,NOP,NOP,NOP,NOP,5,NOP

...

I use "NOP" where there's no data, as "null" gave me lots of programming headaches.

(gear is in fifth because of a modification on the bike that tricks the ecu, avoiding power restrictions of first gears)

One other thing worth mentioning here: www.dashware.net

It may take some tweaking to get it to accept your logged data, but it works great and it's free!

 



__________________

2005 Kawasaki Vulcan VN2000



Member

Status: Offline
Posts: 11
Date:

Schave - Counts. Start a counter to for each time your program goes through a loop, add 1 to the counter. This will give you a 'count' of how many times your program loops a second.
You kinda do that now with your time stamp. I see from your read out that your program loops about 4-5 times a second. Doing a count now and then trying a count if you build a hardwire solution, with pretty much the same code, will help you figure out if the BT stuff is slowing you down. My guess it is, but I don't too much. Maybe you can increase up to 10 loops a second. Then you can ask yourself, "Is the lag worth it because it I have a wireless connection." Having the wireless benefit could out-weigh the speed.
I love this nerdy stuff!!!!
And I need to get back into this project. I have been riding more than programming.

__________________


Member

Status: Offline
Posts: 6
Date:

I love this nerdy stuff!!!!

biggrin Me too, although now I got it all working, I'm starting to loose interest. Now I've got it all figured out and working, I wonder if I'll ever use it!biggrin

Need a new project! I think I should get me an arduino to have some fun with next :)



__________________

2005 Kawasaki Vulcan VN2000



Member

Status: Offline
Posts: 21
Date:

Hi guys,
Any new achievements? next month i will come back to this project, so perhaps will have some more news.
Can you gents list your first 3 registers, bike model and year, I think those 3 regs are related with motorbike itself, we could compare and make a list...

My one

Kawaski zx6r 2008,
ecu no: 21175-0109,
ecu serial no:C558KPE1
values:
reg:0x0 0x80 0xf1 0x11 0x6 0x61 0x0 0xdf 0xf7 0xff 0x87 0x45
reg:0x1 0x80 0xf1 0x11 0x3 0x61 0x1 0x5 0xec
reg:0x2 0x80 0xf1 0x11 0x3 0x61 0x2 0x0 0xe8




__________________
Reg B.


Member

Status: Offline
Posts: 8
Date:

Hi Guys,

Anyone tried on a zx6 04-05.

It looks like the ECU is stopping the diagnostic session after some time. I don't think it's a ping interval issue for me. I tried to request data at regular interval with interval between 100 and 200ms. The problem seems to be always there. It's weird because it works well on a 636 2013. Any hint?

__________________


Member

Status: Offline
Posts: 21
Date:

Hi guys,

Any new achievements? Anyone new successes?

I prepared new PCB for Arduino mega (pdf in site listed under, as on attached photo).
I will finish soldering this week (in total i have 10 pcb's :) ). Moreover I also purchased bigger LCD's (I think 3.4 inch).

I will show photo when finish. My brother is really good in C/C++ programming and probably will help me out with previous (my) code.

Will keep you informed.

- my website: https://sites.google.com/site/trophy250es2/

cheers

 



Attachments
__________________
Reg B.


Member

Status: Offline
Posts: 21
Date:

Coolben,

Did you try to re-initiate transmission ?

cheers

 



__________________
Reg B.


Member

Status: Offline
Posts: 21
Date:

Hi Guys,

Any news?

 

Question:

What is the best frequency of reading values you managed to get from your ECU?

I can read register every 50ms ish (70 is safe).

 

cheers.

 



__________________
Reg B.


Newbie

Status: Offline
Posts: 1
Date:

Hi! I would like to start a little project too. Can anyone help me? I have a new zx6r 2016 KRT and I don't seem to find the ECU port so I can read the K-Line. Can anyone tell me where i could find this port on my bike?

Thank you!

__________________


Newbie

Status: Offline
Posts: 1
Date:

chszanek wrote:

Hi Guys,

Any news?

 

Question:

What is the best frequency of reading values you managed to get from your ECU?

I can read register every 50ms ish (70 is safe).

 

cheers.

 


 

I've been working on the KDS last year, where I managed to log the data to an SD card at a rate of ~7 requests/responses per second. The sudden communication loss that occurs every once in a while is very likely caused by voltage spikes/drops that restart the Arduino. I solved this by using a diode and a large capacitor. I have made a library for the KDS communication, which you can find here: https://github.com/Eztys/SimpleKDS and is relatively simple to implement.

From the datasheets I found that the minimal delay between response and request is indeed 50 ms. 



__________________


Newbie

Status: Offline
Posts: 3
Date:

Hello.

 I have a simple task to achieve, I guess, but I'm stuck. I'm using the setup from the attached image. All I need to do is to read the Speed of the vehicle using data from the obd2 k-line pin, and then to send a command to blink the brake lights when a certain decrease in speed is detected (e.g. more than 2km/h/s). I can not initialize the k-line and I am not able to red anything on the serial monitor on arduino :(. After I manage to read the raw data I am planing to figure out what's the code for turning on the brake lights by just simply pressing the brake pedal. The vehicle is an 2004 BMW E60, but I guess this is not an issue.

Question... Are the TX/RX pins connected as it shod on the arduino board?

Thank you. Ant help would be appreciated. I need this for a school project and a have a deadline :(((

k-line arduino.png



Attachments
__________________
«First  <  1 2 | Page of 2  sorted by
 
Quick Reply

Please log in to post quick replies.

Tweet this page Post to Digg Post to Del.icio.us


Create your own FREE Forum
Report Abuse
Powered by ActiveBoard