Search the FAQ

Category: Electrics and electronics

Everything powered by electricity, and all the driving assistances

CAN Bus and OBD2

The KTM 790 Adventure is like many other modern motorcycles employing CAN Bus for communications between the ECU, sensors and actuators. And some other devices like the front lights. A CAN bus is just two wires with data flying through it that can be read and written to.

A lot can be done from a CAN Bus, from capturing detailed read of temperatures, to uploading a new map for the engine. Your KTM dealer uses the CAN Bus during service to update the software on various parts of the bike, and to read the diagnostic codes. The risks of uploading software or new maps are high, pushing the wrong values may end up wrecking your engine. Reading or clearing diagnostic codes and monitor motorcycle performance however is perfectly fine, and can be achieved with your phone and a bit of hardware.

The simplest way to get access to the CAN Bus is the diagnostic port under the battery cover, it’s easy to find, and it’s sealed with a protective cap.

Diagnostic port

OBD2 is originally a US standard, a requirement for all vehicles to provide a standard way to read data and diagnostic codes. OBD2 is nothing else than a CAN Bus and a specification for a diagnostic port. All the solutions on the market do use an OBD2 port. In order to use them you need an adapter from the KTM diagnostic port to OBD2. There are plenty of vendors selling those, just search for “KTM OBD2 Adapter“. One that’s proven to work is this Lonelec adaptor (which comes with all the hardware to use TuneECU on Windows).

Once you have an OBD2 port, it’s just a matter of finding a software solution for you. The picture below have been taken using OBDLink on Android, using a OBDLink MX+ Bluetooth adapter. Just avoid the cheap adapters, they do not work properly most of the time.

Once connected (and bound via Bluetooth, Wifi or USB if/as appropriate), you’ll be able to examine any “thrown codes” and peek at some commonly coded sensors.

Techies that study this stuff may want to dig into an Adventure Rider thread titled “Results from hacking the KTM SuperDuke 1290 CAN bus”, as many of the “secret codes” used on the 790 are likely to be the same as other KTM models.

Many thanks to Scott McCrory for the original idea, some of the text and all the images for this article.

Riding Modes explained

The 790 Adventure come with a very advanced electronic package with features never seen before on production bikes (On the fly MTC tuning anyone?). This makes for a very safe bike, but understanding what the electronics is doing for you is paramount to fully exploit it.

There is a lot of confusion on the various riding modes and what exactly they are changing on the bike. This is not helped by different settings having the same name (“Offroad” can be a Ride mode, a Throttle control setting or an ABS setting for example). The riding modes have influence on throttle response, anti-wheelie, and traction control. ABS is not controlled by changing riding mode at all, and traction control (MTC) can be turned off separately for each mode.

This is not helped by the user manual, which goes in great length to explain how to turn things on and off, but doesn’t explain why you would want to change the settings, and for what purpose. And what exactly is changed by each settings. Be aware that some of the content in this article are educated guesses, until someone reverse engineer the code or KTM fact checks it. The source data for this article comes from KTM literature about the bike and the discussion in this advrider thread.

So to make it clear this entry in the FAQ is all about those three indicators on the bottom right of the dashboard:

The indicator shows the ride mode (one of STREET/RAIN/OFFROAD, the ABS (one of ROAD/OFFROAD/OFF) and the MTC (one of ON/OFF). All of those are freely mixable, you can set STREET/OFFROAD/OFF or OFFROAD/ROAD/ON for example. RALLY is displayed differently, see below.

Before diving into the ride modes, let’s talk about throttle response, ABS, and MTC.

Throttle response

The 790 is equipped with a ride by wire system. Turning the throttle tube just sends a signal to a computer. The computer can then decide how much power to give for a set rotation. Throttle response is just that, controlling the mapping from the amount of rotation to the amount of power.

There are four possible throttle responses available (Street, Rain, Offroad and Rally) but they are no all controllable directly. The various ride modes will select the associated throttle response (Rally mode is an exception).

ABS

The ABS prevents wheel lock. Wheel lock is bad when not controlled, and in an emergency braking situation ABS can save you. The ABS in this bike is very advanced, and it can regulate the brakes based on the lean angle. There are three possible settings for the ABS:

  • Road: ABS is active on both front and rear wheel, lean angle input is used
  • Offroad: ABS is active on the front wheel, and turned off on the rear wheel. Lean angle input is ignored.
  • Off: No more ABS. Note that this setting is not memorized, if you shut down the engine (or stall) the setting is going to reset to Road.

When on the road, unless you are a supermotard hero who want to slide the rear wheel in turns, you should be in the ABS Road setting. On the other hand, when riding off road it is useful to be able to lock the rear wheel for initiating a turn, or to be able to brake effectively on very loose surfaces, making the ABS Offroad setting useful in those conditions.

Also, comparing Road and Offroad ABS settings on just the front wheel, Road ABS is more aggressive in preventing locking. Braking on a loose surface with just the front brake there is a large difference between the two modes, Offroad allows for more slip, making the braking manoeuvre more effective. On the other hand, using Offroad setting on a really hard but slippery surface like ice would be a bad idea, as any slip there can send you flying, and the lean angle input would be useful.

The Offroad ABS is very effective on the 790 Adventure. Doing braking exercises on the dirt with the ABS off and with the Offroad ABS on, it requires a pro rider to reach the same level of performance without the ABS. For the common folks, you have no hope in hell moderating your braking as effectively as the Offroad ABS mode.

So in short: On the road, use Road ABS. Riding offroad, use Offroad ABS. Turning ABS completely off is not recommended unless you really know what you are doing and you are fully cognisant that it will reset by itself.

This video shows braking distances with the various modes on gravel.

MTC (Motorcycle traction control)

The interesting thing about MTC on the 790 Adventure is that it can be fine tuned. It’s not just a on-off switch; depending on the riding mode selected it will be more or less aggressive. The ultimate MTC control being the optional Rally mode, where it can be modulated through 9 different settings, on the fly.

Another interesting point is that the MTC doesn’t act on the engine directly. MTC of old, on less advanced motorcycles, used to just cut ignition to regulate power. On the 790 the MTC acts on the throttle directly. Conceptually the throttle by wire has two inputs: the rider throttle tube position, and the MTC. The lower of the two will be the throttle input for the engine. This makes for a very smooth MTC intervention.

The MTC on the 790 Adventure can also share with the ABS the lean angle sensor to adapt the slip control based on current conditions.

There is a setting in the motorcycle menu to turn MTC completely off, overriding the fine tuning done when changing modes. As with ABS this setting resets itself when the engine stops.

If you have Rally mode on your bike, you should probably never turn MTC completely off, use Rally mode instead. If you have a 790 S without Rally mode, it is useful to turn it off in certain conditions like deep gravel or sand, but most of the time the Offroad ride mode is sufficient to tone down the MTC offroad.

Another last tidbit about MTC: If you are using cruise control and the MTC triggers for any reason, MTC is going to force the CC to turn off. This can happen on a highway when going over bridge expansion joints for example. Be aware.

MSR (Motor slip regulation)

MSR conceptually is the opposite of traction control: it prevents the rear wheel from locking when shifting down. If the driver is very aggressive with their downshift there is a risk of getting to the point of making the rear wheel loose traction and slide. This would have the same effect as using the rear brake to slide the rear wheel.

To avoid this, on downshift, the MSR checks the rear wheel rotation, and if it detects the issue it will put just enough throttle to keep it turning.

MSR on the 790 adventure is tied to the rear ABS. MSR is only on on if he ABS is ABS fully on. MSR is disabled in ABS offroad mode, and when the ABS is completely off. There is a message on the display when switching away from full ABS saying “MSR is off”. Now you know what this message means.

Ride modes

The three default ride modes are changing Throttle control, MTC, and anti wheelie. The optional Rally mode is the fun one with on the fly configuration.

Street

  • Throttle control: Fairly direct. Strong response.
  • MTC: Full on, lean sensor input enabled (unless MTC is turned off)
  • Anti Wheelie: On

The default mode to use when on the road. Makes for a peppy fun bike, with the rider’s aids turned on to back you up in case of mishaps.

Rain

  • Throttle control: Very soft. Needs lots of input to get power.
  • MTC: Full on, lean sensor input enabled (unless MTC is turned off)
  • Anti Wheelie: On

For the days where adherence is low, road is boring, or you want to save your tires for a long journey… also you can use this mode to get accustomed to the bike the first times you ride it.

Offroad

  • Throttle control: Less direct than street, and more linear, to give more control in technical areas. Allows the rider to be more precise with the bike power delivery.
  • MTC: on (unless MTC is turned off), but less intrusive, allows for some slip. The lean sensor is disabled to allow the rider to uses a berm, sand dune or rut to lean into a turn.
  • Anti Wheelie: Off

The go-to mode for almost everything offroad. Not ideal on the road as the amount of slip allowed is quite important. But okay for short stints on the road between two tracks. Be aware that the MTC lean sensor is off here, so a big handful of throttle in a turn with off-road tires will launch your bike sideways…

Rally

Rally mode is an option on the 790 S, standard on the R and Rally.

  • Throttle control: can be manually selected from Street, Offroad and Rally. Street and Offroad are apparently the same as in their relative modes. Rally throttle control is extremely direct, the throttle control turns into a virtual on/off switch.
  • MTC: Fully controllable from 9–full on to 1–almost off (Unless MTC is turned completely off). Lean angle sensor is disabled to allow the rider to uses a berm, sand dune or rut to lean into a turn. The amount of slip allowed can be changed on the fly with the up/down button on the handle bar. It is thought that 9 is roughly what Street and Rain mode are calibrated for, and 7 is where Offroad mode probably is. Use 5-6 for sliding around on fire roads, 3 for deep gravel, 2-1 for sand. For a slippery technical climb put it on 7, throttle up and let the bike climb by itself, it’s uncanny.
  • Anti Wheelie: Off

The display changes in rally mode. [Rally] is displayed on top of the speedo, A big number showing the current MTC setting is shown at the bottom (or n/a if MTC is off), along with the current throttle and ABS settings.

Like Offroad Mode, probably not the ideal mode on the road as the MTC lean sensor is off. But, if you know what you are doing, sure. Off road, it’s the ultimate weapon, where you can change the slip level according to your skills and the conditions. Watch out with the Rally throttle control: you will chew your tires in record time, and your mileage is likely to take a hit as well!

3D Printed GPS support

For other supports, see GPS mounts.

I designed two GPS support. The first version was very simple and only need drilling to set in place. But it failed once, and once is one too many. Please stop using that mount or at a minimum use a tether.

The second version is more robust, uses threaded inserts to keep thing in place. But it requires more DIY work.

All my designs are free, I provide the STL ready to print and also the OpenSCAD file used to create it, allowing you to modify the design if you wish. OpenSCAD is free and can be installed on any computer.

Original version (bottom), vs version for inserts, both fresh from printing.

Original simple version

The files are still available on Thingiverse. If you print or have printed this design be aware that the tabs holding the mount to the bike can break. At a minimum please use a tether (any kind of line preventing your GPS to fall if the tabs break).

Version with inserts

This version is sturdier, but requires some manual labor once the part is printed. So first you print the part using your favorite techniques. The STL is also available on thingiverse. Note that for extrusion printing the part will need supports for all the holes.

Then you need brass inserts and fit them. I found mine on amazon, but those are very easy to source. the part is designed for two type of inserts:

  • Two M5x10x7 to insert in the holes connecting to the bike
  • Four M4x10x6 for the AMPS pattern

To insert them put them in place in the entrance of the hole (there is a lip for this purpose in the print) then use a soldering iron to make it hot and let it sink in the plastic by using just the weight of the soldering iron, don’t push! When it is getting very close to its final position remove the soldering iron, flip the part and press it against something flat. this video should make this clearer:

Once the inserts are installed, putting it on the bike is trivial. Bolt it on. Then use 4mm screws to attach your favorite device.

First design on the left, print with insert on the right, ready to go on the bike.

Fuel Gauge

People are confused by the fuel gauge. Plus the fact that some of them where not calibrated properly lead to a lot of confusion.

First of all the fuel gauge only works for the second half of the tank. This is explained in the manual. For the first 10 liters the fuel gauge will show full and the range indicators will display a range with a plus sign, the range being the distance you will do on the half tank. For the second half of the tank each bar is approximately two liters.

If this is not confusing enough, there is also a special behavior of the fuel gauge, caused by the split tank design. The fuel gauge is mounted in the right side tank bottom. When the bike is parked, on the side stand, the fuel will will run to the left side fuel tank trough the connection tubing on the bottom. With little fuel (1/4 and less) in the tank most fuel will end up on the left side. When you start riding, the fuel gauge will indicate a very low fuel level, blinking red. After a few minutes the fuel will move over to the right hand side again and balance out, then the fuel gauge will show normal level again and the fuel range will increase to what it actually is.

In short, don’t trust the fuel level as you start the bike. Ride for three or four minutes to get an accurate reading.

This is not a defect, but a normal behavior of the tank design with two low halves. If KTM had mounted the fuel gauge in the left side, it would show a much too large level when you start riding, which might leave you stranded shortly after. One option would be two fuel sensors, one on each side and some software to clear things up, but hey, more complexity, more money 🙂

Note also that the fuel tank has two valves on the bottom, one on each side. If you tank reads full but your bike stops, check that the last person who touched the bike actually opened *both* valves.

Horn

The denali sound bomb mini is a simpe upgrade to the original horn. It fits right there.

A denali split sound bomb without the compressor is also a direct fit in place of the original horn. Install is more involved as the compressor needs to be be fixed under the seat for example.

Warning: The denali pulls 30amp, way way more than the original puny horn. Fuses on the bike are all 10Amps. And since the fuse for the horn also controls the instrument cluster and the brake lights there is a high risk of blowing the fuse and losing those functions each time you use the horn if plugged directly. Please feed the denali from the battery, with a large fuse and a relay from the original wires.

Additional lights

The headlights are pretty good from stock. With 3 positions: DLR (peripheral lights), Low beam (middle lights) and high beam (top light). The bottom light is always on. Low beam is switched on automatically when the sensor on the dashboard detects darkness, or manually if DLR is turned off in the menus (this may be useful in fog for example).

There is no obvious spots to put additional lights, and so far not a lot of installs have been published. I’ve seen a very long video with lights installed on the lower tube supporting the front end (but warning the clearance with the forks is very tight) and this very extensive install report on Facebook.

KTM added lights to its catalog: P/N 63514910033, 487€. Those are PIAA lights, made by Valeo for KTM. The hardware simply replace the metallic braces for the headlight, adding mounting points.

The mounting braces are available stand alone as p/n 63514910044, €150 for just the bars without any connector.

Denali offers 790 Adv specific mounts, mounted on the same tube under the instrument cluster, with an additional leg to stabilise it and not just relying on the clamp. $120.

Denali mount

BDCW also offers light mounts and optionally the associated lights to go with it. Plenty of options detailed in this ADVRider thread ($150 for the mounts, $500 for the mount plus some nice LED lights).

BDCW mounts & lights

Cyclops also offers a mount ($80), in multiple sizes depending on the size of your lights. Also available with your favorite lights and and a bunch of other options.

Cyclop mount with long range beams

GIVI also has specific mounts for the 790, reference LS7710. Those are very low, attached to the bash plate, and not compatible with crash guards as they use the same attachment point. €60 or so. See this install report (more pic in the comments).

There is a company in Columbia, Lion, making mounts as well. Their picture is from a S model, it is unclear if a R fender would clear the one fixed under the light housing. $60 each pair. The site is a little scarce on information.

The cheapo option is to buy a 18mm “Stauff clamp” from a hydraulic shop and to use it to mount the lights on the lower bar. $10 for a pair. As seen on FB in a comment by Kris Eric :

Stauf clamp in action

Reset service warning

The service warning light can be turned off by pressing the right buttons in the right sequence. Note that the service light has two triggers: mileage and date.

The secret is to navigate to highlight the “Settings” menu (Highlight “Settings” in the menu, don’t enter into settings), and then hold up and down together for 5 seconds. This pops out a page where you can change the data to the next service.

Each press on set will increase the mileage. The date is automatically preselected for 12 months and can’t be changed. To cancel, press the back button. To validate press set for a few seconds. This procedure is not the same as the one described in the shop manual (see documents), but the one there doesn’t work as described.

Tire Pressure Monitoring System

TPMS information is shown in the manual, there is a part number (P/n 63512931044, around €160). Requires a trip to the dealer to pair it with the bike.

The install will be fairly involved: tires need to be removed to install replacement valves, a receiver plugged in, and a software activation done.

A cheap alternative, if you have a Zumo GPS (but not a Zumo XT), Garmin offers TPMS valves caps that connects to it.

KTM MY RIDE navigation

KTM MyRide is standard on all versions of the 790 Adventure. You need to:

  • Enable the navigation option: Navigate in the menu to “Extra Options”/“KTM MyRide” and enable navigation there.
  • Download the KTM MyRide app (£8/€9) to your smartphone. If you want to operate without a data service you can also download the country maps to your phone. The Bluetooth (optional) symbol on the combination instrument actually refers to a pairing of a device via KTM MY RIDE

The navigation app is fairly basic, and the display in the bike is just directions and pictograms. For short road trips it is fine. But not at the level of a real GPS or phone app like waze, google map or calimoto.

Most importantly, if the phone lose the connection with the bike (which happens rather often in my experience) the display will stay stuck on the latest guidance and not refresh. This caused me to miss some turns 🙂

But if you have an Android phone you are in luck! Inmate Undingen on advrider created an app that reads notifications from Google maps, adapt them and send them to your dashboard. Uncanny.

Note that early bikes had problems connecting to phones and showing navigation. The bike may need a software update.

Very old bluetooth devices may have problem communicating with the bike. The first gen Sena SMH 5 and 10 for example, the ones without USB port for updating, will not work properly.

Smartphone mount

Note: Before mounting a phone on your motorcycle consider the following:

  • Phones are hard to read in strong direct sunlight
  • Phone can overheat can overheat easily and switch off
  • Phones are difficult to manipulate with gloves
  • Phone with moving parts (like optical image stabilization for example in your iPhone or Galaxy) are known to break when subjected to the vibrations of the motorcycle.

KTM offers a bracket for handlebar mounting p/n 61712991100 at £61, then the case for the phone into which the bracket clips is about £35 (different part numbers for different phones).

Plenty of third party provide phone mounts, and using a GPS mount with some RAM hardware is probably the better option as it moves the phone higher in the field of vision. A quadlock on a RAM ball is quite practical for example. Or a X-Grip which also mount with a RAM ball.

Next Page »