Vipec V44 CANBUS display

Introduction

This document aims to provide a user guide, or ‘how-to’ for building your own custom CAN display for the Vipec series ECU. The document will cover the CAN protocol in brief detail, the required CAN control systems and appropriate interfaces to allow you to extract information in real time from the Vipec via the CAN protocol and display these values on your own custom display screen or appropriate output method.

 

About CAN or CANBUS

CAN is known as Controller Area Network and it is an open source, open protocol that can be used to interface between various controllers and control systems using the CAN as a bus network. The CAN protocol simplifies the design and forces all participating devices on the BUS to a given standard (CAN) which includes error detecting, device address management and data checksums to ensure the CAN operates at a high speed suitable for simple control devices as well as providing a relatively simple solution for a complex problem. The CAN protocol allows devices on the BUS to send and receive and the CAN bus utilises CAN packets across the wire with a ‘transmit ID’ in each packet to identify which devices should receive the corresponding packets. This target ID design allows the user to select various parameters to be sent to different devices on different IDs, such as sending RPM and Speed to ‘transmit id’ 10 and sending Oil temp and Oil pressure to ‘transmit id’ 20. This allows the user to wire in multiple devices all to the same CAN Bus, and in this example and the appropriate display units extract which packets the device is interested in, based on ID. This negates every device on the bus receiving and processing every packet, again optimising the BUS for small end microprocessor units and controllers.

 

limitations of this guide / how-to

This document and the covered display unit have been modelled on the Vipec V44, more specifically the V44 top board plug-in for the Mitsubishi Evolution Lancer 8. The chosen controller interface is a CAN adapter, or shield for the Arduino micro-processor systems and a 3rd party display system by 4D Systems Australia. All of the products used in this guide are off the shelf units and available at little cost, or at least, selected to maximum user capabilities and to minimise the build costs, given it is a hobbyist style display and not a commercial grade solution.

CAN specifics on the Vipec V44

By default, the Vipec V44 and V88 support the CAN bus and have it enabled in the base product, however due to a technical design issue a field upgrade is required on the Vipec ECU board if the serial number is less than 10,000. You can check the serial # by looking at Help, ECU Information when connected in VTS. If the ECU is less than 10,000 you will need to contact Link support to have the ECU board modified to make the CAN protocol work correctly. The board modification is performed free of charge but you must send it to an authorised Link dealer locally or to Link NZ.

The CAN protocol implementation on the Vipec allows you to extract multiple sets of data (parameters) from the ECU in real-time and the user can configure these on the Vipec V44 via the VTS (Vipec Tuning Software). You cannot select every single value, nor should you as the bus is limited in bandwidth and the number of values that can be transmitted. This guide assumes you want a sub-set of basic parameters but there is no limitation on the range of values you can extract out of the Vipec.

One limitation that is found in the Vipec V44 series (and V88) is that some values out of the Vipec require arithmetic or computations before the values are correct. One example of this is water temperature (or any temperature), the value that is output from the Vipec on the CAN bus has an offset of -50. This means that the value of the water temp in the car, is for example, 80deg Celsius but the value in the CAN packet for water temp will be 30deg. This is because, some values on the Vipec V44 series require computations before the correct value is display.

This is covered in the VTS help file – ‘Device Specific CAN Information’. If you scroll down to the section titled “Generic Dash CAN Data Format” you will see a table with a range of parameters/values. The values that require arithmetic to be applied to them indicate this by display “Raw -/+” – such as water temp, shown as;

ECT
Display (deg C) = Raw – 50

The problem this poses for aftermarket display units such as the digital dash displays and expensive display units is that you need to be able to apply these arithmetic computations at the controller for the value to be shown correctly, otherwise, as identified above, your water temp is offset by 50deg Celsius. Some controllers and systems will allow you to perform this style of computation on a value but usually only the high end systems do this. The Vipec I series and G4 have addressed this limitation so it only applies to the V44 and V88 series. In this how-to guide we will perform the computation at the Arduino microprocessor so we are able to overcome these issues at interface layer.

Vipec CAN BUS connection

The Vipec v44 top board has an onboard CANBUS connector present on the ECU as shown below (CAN-RS232).

You need to purchase the CAN-RS232 cable from linkecu.com and connect it to the ECU main board. Depending on what you want to connect the CANBUS interface to you may need to modify the cable and/or cut / splice as required. In this example, the two CAN wires (CAN-HI and CAN-LO) are simply connected to the Arduino CAN shield so you need to cut the end of the CAN-RS232 plug and simply connect to the CAN wires.

This is what a fully loaded VIPEC V44 looks like, note this also has the expansion connector plugged which sits next to the CANBUS plug.

Once you have modified your CAN-RS232 cable it should look something like this;

Note that as per above, if connecting to the Arduino CAN shield you only need the two wires, so as per above I have cut the black end plug and simply used the CAN LO and CAN HI wires – the above is just for visualization.

 

Here is the plug mapping

CAN HI – White wire on CAN-RS232 cable

CAN LO – Green wire on CAN-RS232 cable

CAN bus shield for Arduino

For your Arduino host you need to order a shield so that the Arduino can natively communicate on the CANBUS protocol and talk to your Vipec ECU. There are cheap CANBUS shields on eBay and online and these are rubbish as the run a poor spec 8mhz clock and generally don’t work (I’ve tried it already).

The one you want to go for is this one

https://tronixlabs.com.au/Arduino/shields/can-bus/can-bus-shield-for-Arduino-australia/

This runs a 16mhz clock and works first shot, this is the one I am using on my evo and it works fine, worked first attempt.

Connect the CAN LO and CAN HI wires from the Vipec CAN-RS232 loom directly onto the Arduino CAN Shield using the green terminal block – don’t use the RS232 serial plug block.

The green terminal block on the CAN Shield is labeled so it’s simply a matter of matching CAN HI to CAN HI and CAN LO to CAN LO on the Arduino CAN Shield.

For the example that I have done I have also connected a digital display from 4dsystems.com.au as shown below. You can connect whatever you like or simply run your Vipec to the Arduino and do your own programming, but if you want a nifty flexible screen then the 4d display units have a range of options and they also have an Arduino shield so you can focus on the more fun things such as UI design and not worry about the complex machine code to drive the screen and make it all work.

 

CAN setup on the Vipec V44

Once you have wired the Vipec to the CANBUS adapter shield you now need to test that you have a working CAN connection. This is achieved by configuring the Vipec V44 (in VTS) to a basic CAN Setup. You can use the below as a simple test.

Set speed to 500kbps, Configure channel 1 as Transmit ID 0. Note: the can ID or channel ID makes no difference for the CANBUS adapter shield, as the code receives every packet so it doesn’t matter if your channel ID is 0, 10 or 50 for example. Use 0 as it’s nice and simple. Ensure you select ECU transmit, Compound and pick one basic sensor from your car that will always have a value. In the example I have selected “batt voltage”, i.e. battery voltage so it will always return a value even if the engine isn’t actually running (nice for simple testing). Ensure you “SAVE” this setup as CAN CONFIG file for VTS and then “Apply” the changes to the tune. Once you do this, do a full save and store to the Vipec. I also recommend you close VTS. turn car off, turn car back to ON (but don’t start it) and then open VTS and do a read and ensure your CAN settings above are still intact as configured previously.

At this point you are ready to test you can receive CAN packets from the Vipec. This is the Evolution stage, once you get past this, the rest is simply matching variables to values. If you cannot get this part working don’t bother proceeding and troubleshoot as required.

 

Data packets from the CANBUS

Data (values) comes out of the Vipec onto the CANBUS using frames. each frame contains a pair of values that make up the “sequence” ID and then the next 3 pairs of values make up the actual sensor values.

So if you have 6 values enabled in the CAN configuration screen, you will receive two CAN Frames in total because your 6 parameters are broken up to into two separate packets.

 

PACKET 0

ID VALUE, ID VALUE, SENSOR 1, SENSOR 1, SENSOR 2, SENSOR 2, SENSOR 3, SENSOR 3

PACKET 1

ID VALUE, ID VALUE, SENSOR 3, SENSOR 4, SENSOR 5, SENSOR 5, SENSOR 6, SENSOR 6

This is dealt with at the code layer when received by the CAN shield but you at least need to understand the fundamentals of this so that when you expand your code you can deal with this accordingly.

 

// read a CAN frame from the CANBUS (from the vipec)

CAN0.readMsgBuf(&rxId,& len, rxBuf);

 

// break up the frame and cut it into variables

// VFrame is the “ID” frame – don’t confuse this with “Transmit ID”

VFrame = (rxBuf[1]*256 + rxBuf[0]);

b = (rxBuf[3]*256 + rxBuf[2]);

c = (rxBuf[5]*256 + rxBuf[4]);

d = (rxBuf[7]*256 + rxBuf[6]);

 

So for the above example, if VFrame is 0 then c will equal Sensor 3 from the Vipec

If Vframe was 1, then d will equal Sensor 6 from the Vipec.

 

Simple test code

Download CAN_Recieve.rar and compile this in your Arduino (it should be error free).

http://www.paulr33.com/evo/vipec_can/CAN_receive.rar

Ensure you check the serial port details and also that it compiles OK. Download the code to your Arduino – it should “download” to the Arduino without errors.

 

Launch checklist

  1. Vipec V44 configured with CAN set to transmit at least one parameter
  2. Vipec CANBUS cable connected to CAN BUS shield on Arduino
  3. Double check colour mappings of Vipec CANBUS to Arduino pin outs (CAN LO / CAN HI) – 2 wires only
  4. Confirm you have downloaded CAN_Recieve to your Arduino and it compiles OK
  5. Confirm your CANBUS shield is installed onto your Arduino
  6. Confirm you have wired in and secured the CAN LO and CAN HI wires to the Arduino CANBUS shield

 

Turn car to ON, but don’t start it, the Arduino CANBUS shield should flash each time it receives a packet (i.e. it should be flashing almost constantly).

 

if Everything goes well you should see something like this constantly scrolling past on the output from the serial port.

if you are curious how all the numbers translate and break up into actual Vipec parameters see this brief extraction demonstration – note the numbers that come out of the Vipec raw frames are HEX.

Now what?

Once you get to this point you can now play around and experiment to your hearts content. The rest is simply extracting more values, using the values you want and dealing with the numbers as required.

From here you can choose your screen method of display. Lekonna, the original author did a simply LCD display as shown here;

http://forums.linkecu.com/index.php?/topic/1451-diy-vipec-display/

 

Other code examples

For my car I used a 4D display systems screen which came with its own Arduino shield to run the screen.

The screen is found here;

http://www.4dsystems.com.au/product/uLCD_32PTU_AR/

 

The code that makes this up is found here:

http://www.paulr33.com/evo/vipec_can/CAN_receive_4d_Display.rar

http://www.paulr33.com/evo/vipec_can/4dworkshop code.rar