KTM 790 Duke Forum banner

ODB2/CANbus data for the 890R (gear, front brake force etc.)

12K views 30 replies 5 participants last post by  fredaroony  
#1 ·
I've got a Kiwi3 synced up with RaceChrono and RaceRender and I'm able to get fantastic videos with:
  • Speed
  • RPM
  • Throttle position

I'm also able to get some data on lean angle etc. via my phone's GPS but the precision isn't great.
Image


However, I'd really like to get front brakes pressure and gear into my videos. Has anybody figured out how to do this on an 890 Duke R?

The best lead is this thread about the SuperDuke Results from hacking the KTM SuperDuke 1290 CAN bus
which identifies a few CAN bus PIDs on a 1190 Adventure

  • Throttle position: ID_hex_120 / ID_dec_288, byte 3
  • Gearbox & clutch position: ID_hex_129 / ID_dec_297, byte 1
  • Front break force: ID_hex_290 / ID_dec_656h, byte 1/2
  • Rear break force: ID_hex_12B / 299h, byte 3/4

Have folks been able to access CAN bus PIDs on their 890R via bluetooth or gear+brake pressure some other way? What ODB2 dongle are you using?
 
#3 ·
Thanks! That thread is what got me started with the Lontec adaptor and the Kiwi3. Unfortunately even on that thread, it doesn't look like folks have figured out the PID for front brake pressure (I don't think it's available via OBD2, you need to tap into the CAN bus) or gear (which should be available as a standard OBD2 pid but doesn't seem to actually work).

Anybody have luck getting brake force & gear logged?
 
#19 ·
So I got my MX+ and was able to get brake pressure and gear from the CAN bus! The only problem - at-least with RaceChrono, it looks like I can EITHER get ODB2 data (RPM, speed, throttle) OR CANbus (gear, brake pressure).

Is this what folks are running into? I guess I should be able to get all the OBD2 codes from the CAN bus if I configure them one by one right? Should it be possible to get both ODB2 and CAN data from one MX+?
 
#20 ·
So I got my MX+ and was able to get brake pressure and gear from the CAN bus! The only problem - at-least with RaceChrono, it looks like I can EITHER get ODB2 data (RPM, speed, throttle) OR CANbus (gear, brake pressure).

Is this what folks are running into? I guess I should be able to get all the OBD2 codes from the CAN bus if I configure them one by one right? Should it be possible to get both ODB2 and CAN data from one MX+?
Maybe it can only address one module at a time?
 
#22 ·
I confirmed with RaceChrono that it can either talk to OBD or CAN, but not both. So, if you want front brake pressure, you have to use CAN which means you’re stuck trying to pull everything else off the CAN bus.

You could potentially buy an OBD splitter and use two OBDLinks - one configured for CAN and other for OBD.

I now have throttle position and engine RPM in addition to brake pressure and gear.

With PID 299, I see no movement in the data. I rode the bike around my neighborhood and went above 20mph and still didn’t see any change. I’m more interested in figuring this out since this PID is also supposed to have lean angle. Speed from the phone’s gps is probably accurate enough.

Also, looks like the ID is different from CAN PID on the OBD side. I tried a copy exact of the data I could see on OBD and tried to capture it on the CAN side. No luck.
 
#23 ·
Yup I'm in the same place. I've gotten good tracking figured out via MXLink+ in CAN bus mode for:

Front brakePID 656
First 16 bits / 200 for rough % (can go over 100%), use to round values <30 to zero
ClutchPID 297
Bit 4 * 100 (binary)
Engine RPMPID 288
First 2 bytes
GearPID 297
First 4 bits
Throttle positionPID 288
3rd byte

Unfortunately a few don't seem to work. Do folks have ideas on how to sniff the CAN bus to find the PIDs for:
  • Rear brake pressure
  • Bike speed (if we need to - wheel speed can work ... supposed to be PID 299 but doesn't work)
  • Lean angle (Again supposed to be in PID 299)
Happy to mess around, but not sure how to just log every PID for activity. The good news is that most of these have a proxy (e.g. phone GPS logging).

Next level would be traction control or anti-wheelie kicking in... but those will probably be harder to sniff.

Finally - I'm assuming that this is passive logging and we're not stressing the CAN network with these few datapulls, but let me know if you think this is a concern.
 
#24 ·
Decimal 1104 does work for ABS (bit 33, Road = 0 and SMOTO = 1) and Riding modes (bits 36 and 37 - 0 for street, 1 for Sport, 2 for rain and 3 for track). I might be off with what the decimal numbers represent which mode/ ABS setting, but the bits are correct. If you look at the bits/ nibbles/ bytes differently, you will have different numbers, of course.

I also see some change when I switch MTC on and off, but I wasn't really paying attention to it too much.

I have not looked for intervention levels since this was all in my garage.
 
#25 ·
Huh a little CAN bus sniffing partially paid off.

PID 303: Lean angle! First 2 bytes / 100 seem to pretty closely match. Next 2 (after a spacer) likely Tilt?

In theory the later bytes should have wheelspeed (if it works like the KTM 1290) but I've not tested yet

Weirdly I could not find rear brakes among any of the PIDs with significant traffic.

This is good fun, but I really wish we could just look this up in a table.

Thanks for the ABS code. I figured I'd want to track the ABS/Traction control actually kicking in (vs. their setting) but ... that requires bolder testing than I'm necessarily willing to do.
 
#26 · (Edited)
Nice find! How did you manage to figure it out? I guess what I'm asking is, how exactly are you sniffing the CAN bus?

That said, I think if you try the first 3 nibbles/10 it is closer to the actual lean angle. Otherwise, it seems too optimistic. The reason I say this is because I put a second phone on the tank fuel cap to measure lean/ level. While the bike was on the side stand, the second phone showed 8 or 9 degrees while the first 2 bytes/ 100 showed closer to 17 degrees. When I tried first 3 nibbles/10 it was almost the same as the measurement by second phone. I might resort to 2 bytes/ 100 when I ride at the track so I can impress people with my insane lean angles though. :LOL:

Tilt seems to be the next three nibbles. As I was rolling the bike down the slightly inclined driveway and on to the level road, all three nibbles seem to register changes.

I then went up and down my neighborhood and touched almost 25 mph. Apart from the first three bytes (and I think the last one just going nuts per usual), there was no change in data. I think speed is on a different PID.
 
#27 ·
+1 you can get the exact lean angle with the first few nibs!
I used an app called Tes LAX (tes𐫴LAX) and it's free 5 day trial to sniff the CAN bus. It did a decent job of logging to text (which I mangled with a ... spreadsheet? to find the lean angle). I later figured out that it can export btf files to SavvyCan but for some reason it's not connecting properly to the MXLink+ today. I've mostly failed to find the rear brake or wheel speed. If you figure it out keep me posted!

For now ... I'll probably pick up a Racebox mini for speed and give up on rear brake data (though the OCD person in me is really annoyed that we can't find these last two datapoints!). Apparantly on the 790 Duke 0x299 works for wheelspeed, so it's wierd that we can't find it.
 
#29 ·
No luck on speed from the CAN bus still (phone recorded speed via GPS), but I logged a session at the local track yesterday while recording lean angle, gear, front brake pressure (I never touch rear brake, so I'm ok without logging it), throttle position and RPM. Looks like everything worked as intended.

Next step maybe is to talk to a GoPro and record video also.

Pretty happy with this set up. I need to start working on my technique.
 
#30 ·
No luck on speed from the CAN bus still (phone recorded speed via GPS), but I logged a session at the local track yesterday while recording lean angle, gear, front brake pressure (I never touch rear brake, so I'm ok without logging it), throttle position and RPM. Looks like everything worked as intended.

Next step maybe is to talk to a GoPro and record video also.

Pretty happy with this set up. I need to start working on my technique.
Hi!!! Can you share the PIDs, equation and settings to display that data?. I'm trying to see the data on my 790 with RaceChrono App and I can't find the correct equation or pid...Thanks in advance!!! :)