Modern ECUs and dash loggers that offer flexible CAN Bus messaging greatly simplify the installation of complex electronic systems in our cars as data can often be sent between multiple devices. In this webinar we will look at how to configure a sensor in a MoTeC dash logger, send that data to a MoTeC M1 ECU via CAN, and then how to read and configure this input in the M1 ECU.

00:00 - It's Andre from the High Performance Academy.
00:01 Welcome to this webinar, where we're going to be examining the Can communications between a Motec dash and a Motec M1 ECU.
00:12 Now for this particular example, we're going to be using a Motec CDL3 dash fitted to our Toyota 86 and we're going to be sending some data from that dash through to the Motec M150ECU fitted to the 86.
00:27 The example we're going to go through though will be relevant to anyone running an M1 ECU and any of the Motec dashes, including the new C125, C185, 127, etc full color dashes so the concepts and the fundamental principles that we're going to be going over will still be applicable.
00:49 So I guess we'll start with why would we perhaps want to do this and really its going to depend a lot on your installation and your car.
00:59 It's really easy these days with a a lot of the more complex cars on the market and depending on exactly what sensors we're fitting and what we want to monitor it's very easy to end up with too many sensors to wire directly to the ECU, and alternatively we may also want different sensors heading to different pieces of hardware.
01:25 The reason we might do this will come down to how we are using out data logging setup.
01:31 So for me personally, and there's no right or wrong way of doing this, for me personally when I'm at the race track, I'm primarily using the CDL3 as my data logging hub, so want I want from that is sensor information coming from the ECU and there's also some other sensors there which may not necessarily be relevant or useful for the ECU itself and these can be wired directly to the dash.
01:58 So in this case some of the sensors that I've wired to the dash can also be of benefit in the ECU.
02:06 We may use these for logging functions in the ECU, we can also use them for control functions depending exactly what that particular sensor is.
02:15 So a good example of this which we'll be looking at today is the Motec dashes have a built in 3 axis G sensor, so this gives us for example lateral G-Force, lateral acceleration information, it's a built in sensor so we don't need to add an auxiliary sensor to get that data.
02:37 Now we can also use lateral acceleration information in the M1 ECU as a modifier for our traction control strategy.
02:48 So rather than adding a second G force sensor straight into the M150 ECU, it's possible to send that G force data that's already existing in the dash across via can to the ECU, where we can then use that in our traction control strategy.
03:06 And there's just one simple example of how and why we may want to do this.
03:11 Okay so the other thing is in our particular example here, our M150 header is completely used up, we've got no spare inputs on our M150 ECU, so this requires, when we want to add more sensors, us to get a little bit creative.
03:28 And in this case we're using a combination of both the CDL3 for some auxiliary inputs and we're also actually briefly going to have a look at the Motec E888, which is an expansion module, the communications here are relatively similar, so I'm just going to lump this in with our dash communications setup, and we'll have a look at the configuration for both the dash communications as well as each way communications and how we can get all of that data into the M150 ECU.
03:57 Okay so our first step before we actually even worry about our data is to make sure that our dash, and in this case our E888 are both wired correctly to the M1 ECU.
04:15 And there's nothing particularly complex here, we need to follow normal protocol for wiring a can bus if we could just jump to my laptop screen for a moment, we can see a quick example here of the can bus.
04:29 So the can bus itself is a twisted pair of wires.
04:32 It is important that we make sure that we have a terminating resistor at each end of the bus.
04:40 Now all of the Motec documentation will give you details on the can bus requirements much like we've got right here.
04:49 If the can bus is under 2 meters in length it is possible to get away with just using a terminating resistor at one end but we must have that terminating resistor.
05:00 And then we also must obviously make sure that our can high and our can low are correctly wired between the different units.
05:06 Right I'll just head back to my notes for a second, and once we've got our communications setup, once we've actually got our can bus wired then we can go through and make sure that all of our inputs into our dash are correctly wired, are correctly configured.
05:28 So that's one of the next steps we want to make sure that all of the channels that we've actually got going into the dash are correctly configured and correctly reading.
05:38 So what we'll do now is we'll just go to our laptop screen again, we're going to go to our dash manager software, and we'll have a look at this.
05:47 So here I'm just going to click on our inputs, and what one of the channels we're going to be looking at today is our intercooler temp channel.
05:56 So I can just double click on this, and for this particular example, this channel actually isn't doing anything right now, I'm getting intercooler temp from another source, but for the purposes of this demonstration I've just set this up so you can see that with no voltage, we're getting a reading of 22.5 degrees so that's the channel that we're going to be sending through to our M1 ECU.
06:22 Once we've done this we can also click on our monitor channels and this is going to bring up a monitor channel window where we can look at all of the data that's available, all of the channels that are coming through on the ECU, sorry on the dash.
06:38 I mentioned that we will be sending through lateral G-force, the lateral G-force is a built in sensor so we don't need to configure that as an input in the dash manager software like I just did with our intercooler temp.
06:52 So let's just have a quick look at those two aspects here, if we move down and we look at our G-force latch, so that's this particular input here, you can see at the moment I'm sitting on the dyno we haven't zeroed our sensor and we have a reading of negative 0.02 G, so this is what we're going to be wanting to see obviously in our M1 ECU once we've got our communications setup.
07:19 If we move down and we look at our channel for intercooler temp, this is the one that we've just looked at, you can see the data is reading 22.6 22.7 degrees so again that is what we're going to be expecting to see.
07:35 Now the other aspect that we're going to be sending through here, this is a really common one as well, if you're using GPS track mapping, you're going to almost inevitably end up with the GPS sensor ten hertz GPS sensor connected straight up to your dash, this is essential if you want to do track mapping GPS based lap timing, and in this case you can see that we've got our GPS latitude and our GPS longitude coming to the CDL3 dash via the GPS sensor, so it's another aspect we're going to look at.
08:12 This is a really common one because if we are using the dash we've got the GPS connected to the dash, then it's very easy and quick to send that data through to the M1 ECU, so we don't need to separate the signal mechanically and wire the GPS sensor to both the dash and the ECU at the same time, so that's just another aspect we're going to be looking at.
08:34 So now that we've got our can bus wired and we've got our inputs configured and reading correctly on the CDL3 dash, we can go and actually setup the receive communications templates in the M1 ECU.
08:52 Now I'll just mention as well with the can bus wiring this can get a little bit complex depending on your installation, in particular our 86, this is a really good example, so with the M150 and if you're running an M190 ECU these have three built in can buses which is, sounds excessive, but they're easy to actually use those up.
09:13 If you're running the M130, the M170 ECU these have one can bus which can be a little bit more limiting.
09:20 In the case of our Toyota 86 we are using one of the can buses from the factory or OE can communications, and one of the aspects of this is we do need to be a little bit careful with our communications can bus communications speed as well.
09:37 These must be matched, and one of the requirements here is that the factory can bus communicates at 500 Kilobits per second, our E888 which we'll be looking at by default communicates at 1 megabit per second, and that's pretty common for most of the Motec equipment, so we do need to make sure that we are watching our can bus communications speed.
10:00 So let's just jump back to my laptop screen, and what we'll do here is we'll just go in to, we're in our vehicle workbook and we're in our communications worksheet, and this is where we can setup the communications.
10:16 For start what we're going to do is click over here on our can option and this opens up the submenu for all of our can buses, so again in this instance we've got an M150, so we have three can buses, and I've got all three can buses operating here.
10:32 So what we can see is that, I'll just close down E triple 8 for the moment, we can see that we've got can bus 1 and can bus 2 both communicating at 500 kilobits per second.
10:44 can bus 3 on the other hand is communicating at 1 megabit per second.
10:49 Okay so there's two aspects that we're going to be looking at here, first of all we've got our ECU, and what we're going to look at is our ECU receive.
10:59 So we can see that we have setup our ECU receive to be coming through on can bus 1.
11:07 It doesn't matter which can bus you're using here this just needs to be setup based on your wiring installation for the car.
11:15 The reason we're doing this is because the dash is receiving a lot of information from the M1 ECU as well as the factory can bus.
11:26 So we're doing all of that communication on the single can bus, and this is why we're also set up at 500 kilobits per second so it matches the OE can bus speed.
11:37 One aspect we need to consider here is our can ID base and this is an area which causes a little bit of confusion.
11:45 So essentially this is just defining the base address for the messages that the M1 ECU is going to be receiving, and each of the addresses, the ECU can receive up to 16 messages, and these will come through on subsequent messages starting at this base ID address, so in this case we've chosen 16, it's an arbitrary number but it does need to be a multiple of 16 so you need to keep that in mind.
12:18 Essentially what we want to do here is just make sure whatever our base address is selected as, is not going to conflict with any other data that's being sent through on the same addresses so in this case we've chosen 16, a point that you need to keep in mind here is that this base ID address in the M1 ECU is a decimal value, so that's important to understand because particularly when we come to setting up our communications templates in the CDL3, the CDL3 works on hexadecimal values so we need to keep that in mind.
12:56 A real quick tip for you if you want to convert, just bring up your calculator, and I've shown this before but if you click on normally we'll be in standard mode, if you click on the programmer mode and we enter a decimal value of in this case we want to enter 16.
13:15 That will show us that the hexadecimal equivalent of 16 is 10, so this is how we can really quickly, if your brain doesn't work in hexadecimal, convert between decimal and hexadecimal.
13:30 This will be our base address for our communication template in the CDL3 dash.
13:37 So each of these messages, the way the M1 receive templates works, each of these messages will receive up to 8 bytes of data, and generally what we're looking for here is a particular channel will be sent at a particular base ID and then an offset.
13:57 So generally what we're going is we're sending our data from the dash in a 2 byte format so for example let's take out intercooler temperature channel, which we're going to be sending.
14:10 That temperature data will be sent over two bytes and then the M1 ECU will in turn receive that.
14:17 We're going to be looking for the correct location, the correct message, and the correct offset to find the correct two bytes of data that contain our intercooler temperature information.
14:30 So our base ID there starts at 16 and each message beyond that will step up by one value, so it's important to understand if we're sending multiple pieces of information, we're going to have a look at that, we're going to be adding to that base ID as we fill up our communications template.
14:48 Okay so now we can look over the can slots as well, let's just have a quick look here at our intercooler temperature sensor.
15:00 So we're coming over here now to the right hand side, and this one I'll just explain this goes hand in hand with what we've just looked at, so if we look here we have this parameter here that says slot.
15:15 So this is where the ECU is looking for that particular piece of information.
15:20 So at the moment we've got this particular parameter is not in use so it's not doing anything and we're not looking for any data.
15:26 Now if we open that up and look at our drop-down menu, we can see that we have message 0, offset 0, 2 4 6, message 1 offset 0 2 4 6 etc.
15:37 So this really just is what I was talking about, we're getting up to 16 messages being sent, so our first message, message 0 is on our base ID of decimal 16 or hexadecimal 10, and then each piece of data that's coming through is being sent over 2 bytes.
15:59 So for example if we selected message 0, offset 0, then the ECU is going to look at the message with the base ID 16 and it's going to look at the first two bytes of data on that particular message for our intercooler temperature channel.
16:20 Okay so that's how our can ID slots work, now once we've got data coming into the M1 ECU, we also need to do something with it so that we can actually read it so that it makes sense, and we've got a couple of options there, we'll just have a look at this.
16:40 We're going to see it in real life shortly when we actually see some data through but I just want to explain it first so we have this parameter here which is our can type, you can see at the moment that's set to calibrated, we also have the option of setting that to raw, and we'll be looking at both aspects soon.
16:57 So essentially here what we need to know is if we have an input to our dash that we have calibrated and the dash, so we're actually getting a calibrated piece of data, then we are going to choose the calibrated method.
17:12 On the other hand, for the E888 for example, we're not actually able to calibrate our channels inside the E888, the E888 essentially is taking for example analog voltage input and it's just transmitting that raw voltage input through to whatever it's communicating with, so in other words we're going to get a raw piece of data that varies from 0 to 5 volts.
17:36 So in that case we would be using the raw option, and then what we're going to need to do is actually create a calibration table exactly the same way as if we had an analog voltage input wired directly to our ECU.
17:51 When we're using the calibrated mode, we also have the next channel, next parameter down here, which is our scaling channel.
18:01 And what this does is it tells the ECU how the information is coming across, so in other words, what the precision of that piece of data is or how many units per bit are being set through.
18:14 So this allows us to get our decimal places in the correct spot and display the data in the correct method.
18:20 Okay so now that we've got a better understanding hopefully of how this all works, we're going to go through a demonstration of sending this data across, and that's going to give you a better idea of how it all looks when we're actually doing it.
18:37 After this we're going to move into some questions and answers, so if you do have anything that you'd like me to explain further, please ask those in the chat box and I'll do my best to answer those when we get to the end.
18:49 Okay so we're going to go through several examples here.
18:52 Let's go back to our dash manger, and what we're going to do is start with our lateral G and our intercooler temp channels, so what I'm going to do here, we've already got those channels, we've looked at those.
19:06 So what I'm going to do is click on connections and communications, and this is where we can setup our communications templates.
19:13 As you can see I've got quite a few already configured here in our CDL3 dash, there's a lot going on in our can buses.
19:21 What I'm going to do is focus here on our auxiliary outputs, I'll also mention that the CDL3 has two can buses available and we can also select the rate for the communications on each of those can buses.
19:40 Again we need to be making sure that we're using the correct can bus and that the communications speed for those can buses matches what the ECU is expecting to receive.
19:48 Now all of our work here at the moment is going to be done in our auxiliary outputs communication template.
19:54 By double clicking we can open that template and first of all we can see that our base address, remember I mentioned that the M1 ECU demonstrates this or displays this in a decimal value, the dashes will display these in hexadecimal.
20:09 So that's a really easy trap to fall into if you enter the base address here of 16, you're going to be communicating on the wrong address and you're going to have a lot of trouble getting this data to display.
20:21 So we've set that to our base address, so essentially the data that we've got in this particular communication template will be sending on message 0 into the M1.
20:32 So that's where we're going to be looking for it.
20:36 Okay so once we've got that setup, we can go though to our transmitted channels, and in this case we're sending two pieces of data.
20:42 First of all we have our G-force lateral and then we have our intercooler temp.
20:47 Let's have a look at our G-force lateral for example.
20:50 So our G-Force lateral, we can see here, just to confuse manners I've actually got an offset of 2 on this.
20:59 The reason I've got an offset of 2 and we're not starting at the first 2 bytes of that message is simply because I originally had another channel being sent through with an offset of 0.
21:10 It doesn't really matter, this is a good demonstration of how the offset works, and what you need to keep in mind here.
21:17 Okay so there's a couple of pieces of information we need to understand.
21:22 First of all we have our offset of 2, so that's going to be where we're going to be looking for that data when we setup our receive in the ECU.
21:30 We also have our length, now remember the M1 here is looking for the data to come across on two bytes.
21:36 So our link there is 2 bytes.
21:38 The other thing to note of here is our base resolution.
21:41 So in this case the base resolution of our G-force lateral channel is to two decimal places, or in other words .01 of a G.
21:51 That's going to be important when we're setting our scaling.
21:55 Okay so we've got that piece of data all setup to communicate, and we'll also have a quick look at our intercooler temp.
22:00 Now here we've got our offset set to 4, now remember we're sending our data over 2 bytes, our first piece of data starts with an offset of 2, and it's 2 bytes long, so the next piece of data so that it's not overlapping, will start with an offset of 4 again that's 2 bytes long.
22:16 Okay so we've got that data setup, now we can go through and have a look at our ECU.
22:24 So what we're going to do here is just go through to, I'll just do this and I'll all calibrate because it's a little easier to do here.
22:33 And what we'll do is type in lateral acceleration.
22:36 If I can spell it right, it's gonna be much easier.
22:40 And what we've got down at the bottom is our can setup for our lateral acceleration input.
22:48 So, I'll just move this around so we can view what's going on here, so the important part here, I've actually already got this setup, but you can see that the slot for our lateral G input is message 0 offset 2.
23:05 Remember just to clarify why that's the case, if we come back to our auxiliary outputs and we look at our lateral G, our offset is 2.
23:15 So we're on the same base ID and we're on the same offset, so great our data is coming through.
23:20 Let's go back to our ECU.
23:22 Now the problem with this particular input is in the M150, the G-force lateral channel is only displayed to one decimal place, so we'll see at the moment it's showing negative 0.0 this becomes a little bit problematic because we can't really display what exactly our ECU is seeing.
23:41 What we need to do is set our scale parameter here so that our data comes through.
23:47 Just to demonstrate how this works, let's enter a value of 1.
23:53 So now what you can see is our value being read in that particular channel, is showing minus 1 to minus 2.
24:01 Now you'll remember, let's just go back and have a quick look at it.
24:09 If we get back out of here, and we'll go to our monitor channels and we'll look at our lateral G-force channel.
24:17 If I can find that, G-Force lateral.
24:20 Okay so you can see that this particular channel is sitting between -0.01 and 0.02 so the data's working, we've got that channel coming through, but our scaling is all messed up, because we're showing -1 to -2 G.
24:34 That's also being shown up here, this is our final input once all of the data is coming through via can, so this is the data that the ECU will receive, which we can then use for whatever tasks we want to perform with it.
24:47 Okay so what we want to do is actually, into the same scaling as our base resolution, which in this case is 0.01.
24:54 I'm going to enter than but it becomes problematic because our scale will only show to one decimal place as well.
25:02 Even though the scale only shows to one decimal place, this will still correctly scale our input, I'm going to press enter, so now of course our Can value drops to 0.
25:12 So this is working though as soon as we go over 0.1 G then we'll actually start seeing that value being displayed correctly.
25:22 So that's our lateral G input setup, we've now got that communicating correctly using the on-board G force sensor on the CDL 3 dash that's being sent via can and now being read correctly into the ECU and we know that our scaling is correct despite the fact that that particular channel in the M1 only displays to one decimal place.
25:44 Now the next aspect we're going to have a look at is our intercooler temp.
25:47 So let's do that now, I'm just going to again do this in our all-calibrate menu just because I can get a little more data easily.
25:54 So I've got all of our information here, related to our intercooler temperature and what we want to do is come down to our can setup.
26:03 Okay so you'll remember that the intercooler temp data is again being transmitted on message 0, this time you'll recall that our offset was 4.
26:13 So what we want to do is select message 0 offset 4.
26:19 Now again this is a calibrated input, this is calibrated in the dash and it's being sent through as a calibrated piece of information but we need to set our scaling.
26:34 Again in this case we've got our scaling value only displays to zero decimal places, whole numbers, our scaling for this particular parameter was 0.1 degrees centigrade, that's the resolution of the precision that it will read to.
26:49 I'm entering that now, and straight away we can see that via can, our value is 23 degrees, again this is displaying with no decimal places.
26:57 If we jump up to the top though, we can see that our intercooler temperature is now displaying as 22.6 to 22.7 degrees.
27:05 Let's just jump back to our dash manger and we'll go down to intercooler temp channel and you can see that that is also varying between 22.6 and 22.7 degrees.
27:16 Okay so, we've got our two channels now being communicated via can, being correctly read in, correctly scaled in the M1 ECU, and being correctly read.
27:30 Now the other aspect that I just want to quickly look at here is getting our GPS data across, so we'll actually look at that first of all in our dash manager.
27:43 So again what I'm going to do is go through to our connections and communications, and there's a variety of data being sent here via can from the GPS.
27:52 The one I'm just going to focus on for this demonstration is our GPS coordinates, and this is our longitude and latitude positions.
28:00 Okay so GPS is quite unique in that the numbers are very large or they contain very very high precision, so in order to correctly communicate this sort of data we actually need to send the data over four bytes instead of two, otherwise we wouldn't get enough accuracy.
28:20 So if I double click, have a look at our transmitted channels.
28:24 First of all, you'll notice here that our base address has now jumped up.
28:28 Remember our base address in hexadecimal was 10, we've now jumped up to our second message which is on base address 11.
28:37 Let's look at our transmitted channels, we've got our GPS longitude and latitude.
28:43 I'll just have a quick look at one of these.
28:44 Our offset for longitude is 0, and our length is four.
28:50 Okay, let's go over to our ECU again, and what we'll do is we'll jump back down to our vehicle menu, vehicle workbook I should say.
28:59 And we're going on a communications worksheet and we click on GPS we have all of the GPS inputs that the M1 will be looking for.
29:07 Let's look at longitude for the moment, which I think was the first one we were looking at and we have our message 1, so remember we've jumped up, we've gone from our base ID 16, we're now on 17, or hexadecimal 11.
29:22 And the data was coming through on offset 0.
29:25 With the GPS setup, the ECU is already configured to be looking for this data across 4 bytes of information.
29:31 So as long as that's how we're sending it, that's what we'll get.
29:35 So again, I can't show you the actual channel here but if we come across to our calibrate all, and I'll just.
29:43 If I can spell it right again.
29:46 Okay so there we have our GPS longitudinal data coming in via can, so just going through this and setting up all of the data that we need to receive you can see that it's actually relatively quick and easy when we don't have to hard wire our GPS sensor to two locations or alternatively perhaps fit a second GPS sensor and we have all of the required data.
30:11 Okay so we've looked at lateral G, we've looked at our intercooler temp channel, we've looked at GPS latitude and longitude.
30:16 We're going to look at one other parameter now which is the E888.
30:22 So what I'm going to do here is we're going to look at a channel for turbo coolant temperature.
30:29 This actually isn't a standard channel in the standard M1 GPA or GPR package, this is one that I've added in using build, but the demonstration is really going to be exactly the same regardless of what channel you're bringing in via your E888.
30:45 So what I'm going to do is, I'll do this again and all calibrate, so I'll enter the channel that I'm after, which is Turbo Coolant Temperature.
30:55 And we have all of the data relating to that.
30:58 So as normal, we could set this up as a hard wired sensor if required, if we had space.
31:06 And we could do that by selecting a relevant resource on the ECU header for that particular input, in this case obviously we're bringing it in via can.
31:18 We've already looked at the setup for our E888 communications previously, remember E888 communications was on a seperate can bus communicating at 1 megabit per second, which is the standard communication rate for the E triple 8 and it's communicating on decimal address 2, 4, 0.
31:35 So that's all setup, what we need to do however is come down here to our can configuration and this time what we're going to do is choose the correct input.
31:47 So if I just open our drop down menu, what we want to do is move down and we see once we go past all of our addresses, remember we had 16 messages being send 0-15.
32:01 We start seeing our E888 channels, so for this particular sensor it is wired to E888 analog voltage 3 inputs, so I'm going to select that.
32:15 Now in this case as I've already mentioned, with the E888 we've got raw data coming through so essentially the E888 is just sending through a 0 to 5 volt data stream via can.
32:27 And we can actually see that voltage being displayed here, it's 3.621 volts at this point.
32:34 So in order to get this data displaying and doing something useful, we are this time going to be using the raw option for the can data type.
32:45 Remember last time we were using calibrated because the data was pre-calibrated in the dash.
32:50 When we're using raw, this scale parameter has no effect whatsoever.
32:55 So now that we've selected this as raw, now what we need to do is actually set a calibration and we do this exactly the same way as how we would select a calibration if we had a hard wired sensor.
33:08 So what I'm going to do, I've already got one pre configured, so I'm just going to import from file, and I'm going to select our turbo charger coolant temperature calibration and hopefully that's going to give us, no let's just also import the calibration data.
33:30 Right, Okay.
33:31 It is now displaying, and we've got our data being displayed there, something's gone a little bit screwy at the bottom of that table, not quite sure why, but it doesn't really matter, we can see that now we have our turbo charger coolant temperature being displayed, sitting at 20.8 20.9 degrees, so we've now got our data coming from our E888, we've got our sensor wired to our E888, our E888 is correctly communicating to our M1 ECU, and the data is now being imported on the correct slot, correct location.
34:11 We're using the raw channel and we've entered the correct calibration table for that particular sensor, so we've got our data being displayed.
34:19 Now, this is basically going to be a rinse and repeat for any other channels that we want to setup.
34:27 It's just exactly the same process regardless of whether we're bringing the data in via the dash or via an E888.
34:36 So at this point we've got a good understanding hopefully of how to wire up the can bus between the M1 ECU and the dash or alternatively the E888.
34:46 How to set up the receive templates or the receive ID inside the M1 ECU, how the message and slot parameters work in the M1 ECU, and then how we can send data from our dash through and then receive it and scale it correctly in the M1 ECU.
35:07 Right now we'll move on to some questions so I'll just see if we do have any questions.
35:12 If you do have any more questions please feel free to ask those.
35:16 It looks like we haven't, so hopefully what that means is that I've done a great job of explaining everything already.
35:24 Of course, as usual, if you do have any other questions that crop up, please feel free to ask those in the forum and I'll be happy to answer them there.