4
\$\begingroup\$

I am thinking to use something like this to connect an Arduino to a motorbike engine control unit (ECU): Arduino CAN-Bus Shield with uSD Card Holder.

I never did something like this; using CAN bus, can I only read some diagnostic parameters in the ECU or can I also remap some ECU parameters?

\$\endgroup\$
  • \$\begingroup\$ You can change few parameters, but not all! \$\endgroup\$ – Swanand Mar 27 '13 at 11:30
3
\$\begingroup\$

You may be able to, but it definitely isn't going to be easy.

One problem is that most vehicles have not one but at least three CAN buses:

  • High criticality bus
    • Engine/power train
    • Braking
    • ESP/ABS
    • Air bags
    • All other safety critical things that need low latency and high priority
  • Convenience/medium importance equipment bus
    • Ventilation / AC / heating
    • Lighting (interior, sometimes also exterior)
    • Dashboard information (dial values, displays, indicators etc.)
    • All other convenience features on your car
  • Entertainment control bus
    • Radio/CD player control
    • Onboard entertainment systems
    • Navigation systems
    • Phone car integration kits (muting the radio when in a call etc.)

Your mileage may vary, but most manufacturers use this type of subdivision.

Your problem is that the ODB-II connector fitted on modern cars/bikes isn't directly connected to one of these buses. Instead, it's usually hooked up to an optically isolated "gateway" device. It allows the diagnosis equipment to query some basic values and get a response back. It hence provides a layer of abstraction, so that all vehicles can be diagnosed using the same generic diagnosis device.

Some gateways have a method to jump into "service mode", which then allows you to send raw messages directly into one of the CAN buses and watch what's already on there. However, that's not even possible in all models, and it's always locked with some sort of vehicle specific PIN code (which you need to either sniff at the garage or crack using brute force).

An alternative is to hook your Arduino shield straight into one of the CAN buses. You'll have to find the wires in your engine compartment or elsewhere, and splice them into your own connector. Don't take this lightly; if your engine management CAN bus fails while driving at high speed, you are in actual and immediate danger. Not only does your engine stall, but depending on the level of automation and electronic control your car has, all sorts of systems fail to varying degrees. Power steering, brake assist, ESP, ABS, brake lights, throttle control, air bags... All may stop working.

If you want to actually be able to configure your engine management ECU, that's completely different from simple diagnosis. Realistically speaking, you aren't going to be able to reverse-engineer that process within your lifetime - unless you have some form of inside knowledge. At the very least, you'd need to have access to an official configuration/programming tool from the vehicle's manufacturer that you can borrow to sniff the CAN/ODB messages it sends and receives back. Still, you'd have to invest months of work (and a few cars that blow up in the process) just to be able to change a few parameters.

If you do persist on connecting directly to the engine management CAN bus, always use a racing car style battery disconnector switch mounted within your direct reach. When things go wrong, you should always be able to interrupt the power.

In short: you'll be best off just purchasing manufacturer specific (third party) equipment. That's the sort of equipment professional chip-tuning services tend to use as well, usually with great success.

For example, for Renault cars like my own, I would recommend getting a Renault CLIP. That's the tool Renault dealers use to diagnose and configure ECUs and it comes with full software and documentation.

Last but not least, note that it's often illegal to increase top speed and/or power output of your vehicle without authorization or registration with the relevant authority.

For your reference: much of my practical knowledge of CAN bus experimentation was gleaned from this awesome thread.

\$\endgroup\$
0
\$\begingroup\$

Some you can, some you can't, it depends on the make/model/year.

However, the main problem is knowing what you are doing engine-wise - very few people are good at tuning (and almost no-one can really do better than the manufacturer) and if you get it wrong you will melt a piston or seriously shorten the lifespan of your engine.

A different route to tuning is to look at a system like Megasquirt, it's DIY retro-fit and has a good support community. For a bike there's a compact version called Microsquirt.

\$\endgroup\$
  • \$\begingroup\$ I explain you the siutation more in detail. I am an informatic and I am studying on Arduino at this time. I have a friend that is a mechanical engineer and he have a collaboration with a racing motorcycles team. He know what is the parameter that have to be modified because after every qualifying lap they remap some ECU parameter using a laptop. Since the parameter that have to be modifies are fiew and there is a mathematic formula to calculate them he asked me if, using Arduino, I can implement a simple system that work in this way: 1) connects to the ECU 2) Read some parameter from the ECU \$\endgroup\$ – AndreaNobili Mar 27 '13 at 9:54
  • \$\begingroup\$ 3) Calculate the new value for some parameter 4) Update this parameter with the news values. Nothing else. \$\endgroup\$ – AndreaNobili Mar 27 '13 at 9:55
  • \$\begingroup\$ So, in teory, if he can modify these ECU parameters using a laptop so the ECU allows you to change the values ​​of these parameters. What I would know if using the CAN BUS I can only read or also update parameters that in the ECU are modifiable. And in the specific case I would know ifm in your opinion, using Arduino (and a shield as the linked one) I can try to modify these parameters. TNX \$\endgroup\$ – AndreaNobili Mar 27 '13 at 9:56
  • \$\begingroup\$ @AndreaNobili AFAIK, He must be using some software to modify this parameter from his laptop. Generally, Engine manufactures provide their custom software only through which you can change engine parameters. Hence I doubt, you can do same using any other device. (FYI, I work for a giant Diesel Engine Manufacturer and We don't allow any one to modify values... We have encryptions in place :) \$\endgroup\$ – Swanand Mar 27 '13 at 11:28
  • 1
    \$\begingroup\$ If the laptop can read/modify it, the arduino can too. You just need to know the commands being sent. \$\endgroup\$ – John U Mar 27 '13 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.