In this webinar we’ll demonstrate the process of setting up and optimising the MIVEC variable cam control on a Mitsubishi EVO 9 using a Haltech Elite 2500.

00:00 - Hey team, Andre from High Performance Academy, welcome to another one of our webinars and in this webinar we're going to be diving into cam control on the Haltech Elite 2500 ECU.
00:10 To demonstrate this, we're going be using our Mitsubishi Lancer Evo 9 which has a 4G63 with MIVEC which essentially means continuously variable cam control on the intake cam only.
00:23 Now obviously we see continuously variable cam control applied to a range of different engines, quite often it will be only on the intake cam, generally if we've got variable cam control we find that from a performance standpoint we see larger gains from changing the cam timing on the inlet cam vs changing the cam timing on the exhaust cam.
00:45 So for cheaper variants of cam control engines, we will generally see that it's only applied to the intake cam.
00:52 Of course in all out applications it will be applied to both.
00:56 The process for setting it up and tuning it is very similar, few more iterations to your process though when you're dealing with both intake and exhaust cam control.
01:06 So what are we trying to do with cam control? Well if we actually rewind a little bit and look at the older days before continuously variable cam control was introduced, the option for the tuner was to fit vernier adjustable cam gears to a conventional camshaft.
01:23 And what that allowed us to do is very accurately move the cam timing relative to the crankshaft timing.
01:30 So basically we could advance or retard the camshaft, which basically means that we're opening and closing the intake and exhaust valves either earlier in the engine cycle or later.
01:41 And this is kind of one of those situations where there's no free lunches.
01:45 The general trend, and yes there are nuances to this but the general trend is that if we advance the cam timing, so again opening and closing the valves earlier in the engine cycle, this tends to favour cylinder fill at lower RPM where the air has less air speed and less inertia.
02:04 So what this means in simple terms is that by advancing the cam timing we tend to make more power and torque at lower RPM but of course this is at the sacrifice of power and torque at higher RPM.
02:17 And you could probably join the dots at this point and guess that if advancing the cam timing favours low RPM performance, retarding the cam timing, which of course is opening and closing the valves later in the engine cycle, tends to favour high RPM performance so with old vernier adjustable cam gears and fixed cam timing, it was really a case of making the best compromise to move that power and torque curve around to suit our own preferences and application but really once it was set on the dyno that was it, we can't adjust it.
02:47 So then manufacturers sort of saw the benefit in being able to adjust the cam timing while the engine was operating and hence we have variable cam control and this allows the ECU to advance and retard the cam timing very very quickly using hydraulic pressure from the engine oil while the engine's running.
03:07 Meaning that we can map the cam timing to get our supposed optimal cam timing throughout the rev and load range, we generally have a 3D map which we're going to have a look at in a moment.
03:19 Now I just also want to clear up that this is different to switched cam control.
03:26 There is a lot of confusion out there and there's engines such as Honda's VTEC engines which switches cam lobes from a small cam lobe that's optimised for low RPM performance to a larger cam lobe offering more lift and duration, which is optimised for high RPM performance so that is what I call switched cams.
03:48 The other element is some engines such as let's say Toyota's 20 valve 4AGE, some of Nissan's SR and RB engines, used another mode of switched cam timings.
04:01 So in this case, different to VTEC, still only operating one cam lobe per valve but what they have is a mechanism where they can advance and retard the cam timing but not continuously, meaning that they only have either an advanced or a retarded position, might be 15° difference between the two and we can only operate in one or the other.
04:22 And that was kind of a compromise in between fixed cam timing and full continuous.
04:29 So again to be clear, continuous valve timing or continuous valve cam control means that we can advance and retard the cam timing and actually target a specific cam angle throughout the engine operation.
04:44 I know that's all a bit of a mouthful and quite complex if you haven't come across this, again as we move through and have a look at a life demonstration here on the dyno, this is all going to make a lot more sense.
04:55 So for a start, what do we need for cam control? Well with very few exceptions, this isn't something that you're going to be able to add to a conventional engine that didn't come with it.
05:06 And the reason for this is it requires quite a lot of specific elements for it to work.
05:10 First of all there is the cam pulley itself or actuator or phaser as it's often called and this requires a special mechanism with basically internal lobes and oil galleries that can pressurise either side of the lobes to advance or retard the cam.
05:28 It also requires a trigger mode so that the ECU not only knows what the engine RPM is and the engine position but it also needs a bit more resolution around what the actual cam position is so it can decode that and it knows what the cam timing is so really with again very very few exceptions, and I know someone will pipe up with the fact that HKS offer the V cam conversion for the RB26, yes for every rule there is an exception but for most cases basically we're only going to be dealing with this with a supported factory cam control engine and by supported I also mean that generally your ECU that you're using is going to need a trigger mode that is designed for variable cam control or cam control in general, for your engine so that basically covers most of the popular engines including our 4G63 of course.
06:26 So let's jump into the Haltech NSP software and we'll have a quick look through and basically work through this and I'm going to go through the process of setting up cam control and actually tuning it because this is where a lot of people really don't understand the proportional, integral and derivative gains or PID gains, the effect on the cam control accuracy and operation and that's just the basic setup, basically making sure that the cam control can track the target that we're looking for.
06:59 Once we've got it actually doing its job and functioning as it should, then we've also got the task of tuning it so those are the elements that we're going to be covering off.
07:07 As usual we will have questions and answers on this topic so if you've got anything that I talk about that you want me to explain in more detail, or anything related to this specific topic, please ask them in the chat and we'll get to those at the end.
07:19 So we're in the NSP software here and for a start, what I want to point out is I've actually made up a separate page here for cam control and if you've got a fresh installation of the NSP software, that's not necessarily going to be the case but what you can do is click here on add new page or control plus shift N and then you can select page to add.
07:41 So in this case cam control, pretty self explanatory there, I'm not going to do it again.
07:45 Or you can make your own page, no big deal there.
07:49 So we'll come across to cam control, nice aspect of this is it's kind of pre defined to basically give us all of the information that we're going to need at a glance.
07:58 Now because the 4G63 MIVEC engine only has continuously variable cam control on the intake, some of this is redundant so for example up here, we've got a real time trace of our cam position vs our target and we've got the same down here for our non existant exhaust cam so obviously if you've got a dual variable cam control engine, both of these are going to be doing some work.
08:26 Got a little warning here for our wideband O2 which is not relevant to our demonstration, simply it isn't plugged in or isn't working on our installation at the moment.
08:35 Over here we've got some more information which basically mirrors what we've got in the graph, we've got our cam target sitting at 0 and our cam angle one which you can see is just moving around very slightly bit pretty much sitting on our target.
08:50 So then over in the left hand side here, we've got the functionality that we want to go over and talk about so let's actually start with our engine configuration and our trigger system.
09:03 This would need to be set up before we got started but basically we have here our trigger type which is our Mitsubishi 4G63 Lancer Evolution 9, bit of a mouthful.
09:15 The key point here is that this trigger system is key to the cam control, as I mentioned, it gives the ECU the information it needs to know about the actual cam position as opposed to just getting one input every engine cycle so that it knows where abouts in the engine cycle it is, little bit more involved with this.
09:35 Little bit of more information that we could fill in here but essentially this is preset for the 4G63 so shouldn't actually need a lot of changes being made.
09:45 The rest of it comes down to our engine functions and we come down here to our cam control of course which I've already got expanded out.
09:54 We've got intake and we've got exhaust which again doesn't exist here.
09:59 So let's have a look through this and each time I click on one of these, obviously it pops up in our cam control worksheet here or page.
10:07 We've got our target angle, so this is simply a 3D table, we've got our RPM on our vertical axis and we've got our mainfold pressure or fuel load as it's actually called here on our horizontal axis so this is just a 3D table of RPM vs load and the numbers in this table here are our cam targets, so this is what we're actually asking for.
10:32 This is simply the pre defined or base map I should say, for the 4G63 Evo 9.
10:39 Not actually a bad place to get started as it turns out, there are also some reasonably common trends that we will see when we're looking at cam targets.
10:49 Particularly if we're talking about our intake cam here, what we generally tend to see is that the cam timing will advance up to, or close to its maximum which is, when I say maximum, obviously there is a mechanical limit to how much advance and retard the cam has.
11:06 In this case I think we work out to about 35°, maybe a little bit less, we'll actually go through and find that out.
11:13 Engines like Honda's K20 actually have about 50° of movement so it's very dependent on the manufacturer.
11:20 But generally we'll find the trend will be that at lowish RPM, so around about peak torque, we'll see that the cam timing will advance up close to its maximum, which in this case we can see the numbers in this base map, sort of around about 35° from 2500 RPM up to about 4000 RPM and then as we move up in the RPM, we see that our numbers retard back to generally at or very close to the most retarded value which in this case we can see is 0 so this is always something that I will kind of look at as a bit of a sanity check, do the numbers make sense, is the pattern what I'd expect? And this is the sort of pattern we should be looking for.
11:59 Generally around about maximum advance or pretty close to, down low in the RPM, sort of 2500 to 3500 RPM before gradually tapering back to maximum retard by our red line, that's probably going to be pretty close.
12:13 Now another element with this is in terms of how we go about tuning it which again we'll have a live demonstration but this really is one of those elements that I do not believe that you can do a good job of without a quality load bearing dyno like our Mainline Pro Hub, just to name one of the brands that'll do the job.
12:34 We need something that's sensitive, this is not something that you are going to be able to do a quality job of out on the road and if you are road tuning, honestly you're probably as well to leave the base map, at least in this case with the Mitsubishi Evo 9, and call it good.
12:49 I've already found that it is actually pretty close to the mark so we're only talking about sort of rounding errors essentially in terms of the gains that you're likely to get, at least in stock form, all bets are off once you start modifying the engine and go to aftermarket cams.
13:04 Alright so let's look at the process, we've actually got at the moment the engine sitting here idling and we've got a system that's already set up and working but how do you go about doing this? Well there's a few things that we need to understand first and we need to have a chat about PID and what that means.
13:23 So if we look over here on the left hand side, we can see we've got three selections here, three parameters, proportional gain, integral gain and derivative gain.
13:33 And these really come up in just about any element with our ECU tuning which involves closed loop control and closed loop control simply means that we're controlling an output in order to achieve a target.
13:45 So this could be cam control, obviously in this case, with cam control we're controlling an actuator that's operating at probably 200 to 300 Hz, that is controlling the oil flow to our cam phaser in order to advance or retard the cam timing until it matches our target.
14:02 But this closed loop control equally would work for boost control, basically where we have a target boost pressure and the ECU is manipulating the duty cycle sent to a boost control solenoid in order to get to our target.
14:16 Idle speed, another perfect example, so this is something that actually comes up repeatedly with ECU tuning but I think in general this is probably one of the least understood topics and really a lot of tuners, I would say the majority of tuners, don't know how to approach tuning a PID algorithm and if you don't get this right, basically you're going to be starting behind the 8 ball and you're going to struggle getting good control of your cam timing, your boost control, or anything else that you're trying to tune.
14:47 So really this is the place that we need to focus on.
14:51 And before we dive into this, because I know these terms, one of the problems with them is they don't really mean anything to most people, particularly if you don't have an intricate understanding of PID control algorithms and how they function, they're meaningless terms so I always think it's better if we can get a sense of what these terms mean in the real world.
15:12 So I'm going to use a little analogy that I'm stealing from MoTeC, it's actually in our boost control course as well as our cam control tuning course.
15:21 But this breaks down how those P, I and D elements actually work so let's say we're sitting on a straight piece of road in a car and 100 metres ahead of us we've got a set of traffic lights and our aim is to accelerate the car up to the set of traffic lights and stop at the traffic lights as quickly as we can.
15:44 So for a start, let's just say that the only control we've got available to us is the accelerator.
15:50 And this is likened to the proportional gain element.
15:55 The proportional gain means that the effect it has is proportional to the size of the error.
16:01 Now let's just understand what that means.
16:04 If we're sitting in our car and we're 100 metres away from our target, then obviously that error is very large so the proportional gain would have a larger effect.
16:13 As we get closer to the target, the error is reducing so the effect of the proportional gain is reduced.
16:20 Now obviously just thinking about the physics behind this, if we are only able to use the throttle, we're going to have a problem.
16:27 Sure we can use a little bit of throttle and we're going to slowly creep up to our traffic light and we're going to be able to ease off the throttle and come to a rolling stop at the right point but it's going to take a long time.
16:37 Obviously we can use a lot more throttle, it'll accelerate us up to that line quickly but we don't have a brake at this point, we've only got the throttle so of course what we're going to end up doing is going overshooting and we're going to go past our target and then we're going to have to select reverse, we're going to do the same thing, we're going to overshoot and we're going to oscillate backwards and forwards around our target.
16:56 OK so that's what the proportional gain on its own is like.
17:01 Let's now add the next obvious element which is the brake pedal, the ability to actually use the brakes and this is like our derivative gain.
17:09 The derivative gain works based on the rate of change of error so when the error is changing very rapidly, the derivative gain will have a larger effect and it is a braking effect so now we could probably understand that we're going to be able to use a lot more throttle to get up to our target quickly and then the brake pedal can be used to slow us down and make sure that we don't overshoot.
17:34 The integral gain is a little bit harder to explain using this analogy and this is a element that works over time.
17:41 Basically if we just look at the proportional gain on its own, and the derivative gain on its own, those two elements together will never actually be able to get us right onto our target and the reason for this is if we consider the proportional gain, I said that it is relative to the size of the error.
17:57 So once we get really really close to our target, let's say boost control for example, we're targeting 15 psi and we're at 5 psi, big error, bit affect with our proportional gain to drive us towards our target.
18:09 Once we get really close, down to maybe 1 psi or half a psi, the error's really small so the proportional gain has less and less effect and it won't drive us to the point where that error is zero.
18:19 The integral gain looks at that error over time and lets us just move slowly but surely onto the target.
18:26 So I liken this to essentially now looking at our example, our traffic light on our straight piece of road, now let's consider that the traffic light's actually on a hill.
18:34 So the integral gain is likened to being able to use the handbrake to actually hold us at our target position.
18:41 So that's just a little real world analogy before we dive into it.
18:45 Let's jump into the laptop software for a moment and the first place we'd actually want to start is by zeroing out our gains.
18:54 So the reason for this is when we zero out our P, I and our D gains, this actually means that the ECU will not perform any closed loop control.
19:03 Now this puts us into essentially what's normally referred to as open loop so let's have a look at what we've got here, gone to the proportional gain and we have a 2D table relative to our coolant temperature.
19:13 You might be thinking well why do we need a 2D table, why can't we have just one number? Well we can but remember that this system is actuated via oil pressure.
19:25 Now while oil pressure isn't directly correlated to coolant temperature, there is obviously a correlation in there somewhere and in most instances we may not by default have an oil temperature sensor so coolant temperature is the default value, or default parameter for this parameter, for this gain I should say, and if you do have oil temperature and you can measure it directly, we'll simply change it so it is oil temperature.
19:52 The reason for this is the viscosity of the oil changes with temperature and with a viscosity change, so does the functionality or the effectiveness of our cam control.
20:02 Basically long and short of it is that the control strategy may quite likely need to be different when it's stone cold and compared to what it will be at operating temperature so that's why we've got that.
20:14 What I'm going to do, seeing as we are at operating temperature here, all I'm going to do is just zero out the 80° column and obviously that'll affect anything 80° and above, our coolant temperature at the moment's sitting at just on 90°.
20:28 OK so proportional gain, zero'd, let's now go ahead and do exactly the same for our integral gain and then finally our derivative gain.
20:38 Alright so all of those are zeroed out, default values in this table from our base map, give you a bit of a sense of maybe where those numbers might need to be but base maps are only for the purpose of getting the car up and running and we can't take these as gospel so we always want to confirm and optimise these values to suit our own requirements.
20:58 OK so we've got those zero'd so again we're in open loop mode.
21:02 Now the first part that we're actually going to try tuning here, if we come up here we want to come to our intake one base duty cycle.
21:10 So we've got this little solenoid that is sitting there pulsing away at sort of 200 to 300 Hz and this is just like a boost control solenoid, although this is supplying oil to our cam phaser and what we want to do is basically find the neutral point.
21:26 We can't tune cam control in the closed loop mode but we want to find the point, the duty cycle required to actually start advancing and retarding the cam control so what we're going to do here, we can see that we've got numbers of 81% in here at the moment, let's just start by zeroing these out, kind of know where we want to be.
21:46 We're going to bring the RPM up to maybe sort of 2000 RPM, we want to get to a point where we're off idle, we've got basically good realistic oil control and what we can see here on our graph, the green line is our target, so let's just see why that's moved, we come back to our target angle, we can see that we're now interpolating between zero and 10°.
22:08 Just to remove any confusion, let's just zero that out, we'll see our green line comes back.
22:13 OK let's come back to our base duty cycle so we can see our red line which is our target, sorry our measured cam angle, that's sitting at 0 so what we want to do basically is adjust these numbers here in our base duty cycle and find the point where our cam timing actually just starts to move.
22:32 So what we would generally do if we know nothing about this is we'd start at 10%, 20% and just basically jump this up in 10% increments.
22:39 I know where it's going to start moving so I'm going to cheat a little bit here, whoops.
22:45 Let's just bring that back down, I go the wrong number in there.
22:48 So we need to basically have our RPM up to a point where everything is going to move around.
22:52 So let's go up to 50% here.
22:55 Still no movement in our graph to the right, 60%, still no movement, 70%, 80% and 90%.
23:07 OK so 90% we see that red line jump straight up so of course it's going to go straight to its maximum which is a perfect time to actually see that our maximum value on the mechanical stop is 29.7°, let's call it 30°, that's important and we'll come back to why that's important shortly but basically 90%, it moved, 80% we'll come back down and you can start to see it's drifting down slowly so let's just try and page up here.
23:36 OK 81%, it's flatlined, again I'll just bring it back, the RPM up a little bit.
23:43 82 it's increasing, 81 it's staying flat, 80% it comes down, OK 81% that seems to be our neutral position there where if I go above 81% it's going to start advancing the cam timing, if I go below 81%, brings it back down.
24:00 OK so again we've got a 2D table here relative to coolant temperature, again we've got that correlation between coolant temperature and oil temperature so we wouldn't want to do this at cold start, we'd want to do this at operating temperature and then generally I wouldn't necessarily tune every single cell.
24:16 A horizontal interpolation between those numbers, once you've got good data, should be sufficient.
24:22 So that's our first point which we've now tuned that, we've found that position where the cam timing will just start to change and that is 81%.
24:30 Interestingly that's quite high, normally I would expect that to be about 50%, not always but probably between 40 and 60 but at the end of the day, we give the engine what it wants.
24:40 OK so that's an important point to start with because it's a little bit like, let's say closed loop boost control.
24:50 And one of the problems that I see, or mistakes that I see people make with closed loop boost control is not really worrying about setting up base duty cycle table and getting that accurately tuned and then trying to let the closed loop control pick up the pieces and get the target right or the boost onto the target.
25:08 And that can work but the problem is the further out our base duty cycle is, the more error we're going to end up with and the more work the closed loop control strategy has to do to get us onto our target, exactly the same with cam timing.
25:24 What we really want to do is spend the time and get our base duty cycle as close to perfect as possible and then that's going to mean that the closed loop control system can do a better job so that's why we've got this workflow, get our base duty cycle dialled in first then we'll move onto our proportional, integral and derivative gains.
25:43 So alright our proportional gain, we already have a bit of a sense of these numbers here and this does vary from one ECU to another so there isn't sort of a fixed number that you can apply to every ECU.
25:56 Base map will give you a bit of an idea but we're going to see exactly how we can go about this.
26:00 So what I'm going to do is I'll just get us up and running here on the dyno, maybe a couple of thousand RPM, 3000 will do.
26:14 OK so again we've got no proportional gain at the moment so we've got no closed loop control, we can see that our target has jumped up to I think it was about 23° there and we're sitting with our actual cam timing at 0.
26:29 So what we're going to do here is start by putting in a value of 0.1 for our proportional gain, we see on our graph, this really slow, lethargic rise up towards our target.
26:40 It's kind of doing the job but pretty slow and we really want cam control to be quite quick.
26:44 So what we're going to do is go back across to our cam target map and what we're going to do is first of all start by zeroing the values and we're going to do what's called a step test so when we're testing any PID control algorithm, and this is actually the easiest element to do with cam control, it's harder to do with idle speed control and it's harder to do with boost control but we can do such a great job with this test when we're doing cam control.
27:10 What we want to do is basically step between two values and basically monitor how well the system responds.
27:19 So let's just try exactly that, I'll just get us back onto our set point on the dyno.
27:25 So at the moment we've actually cheated a little bit.
27:29 We've gone to 0 and 0 is generally not a real good place to do our test and we also don't want to do our test at the other extreme of the travel and the reason for this is that 0, we obviously can't retard the cam timing beyond it, 30*, we already know that's the maximum advance so we can't advance beyond that.
27:49 So basically what that's going to do is artificially mask any overshoot that we want or we're going to get, we obviously don't want any overshoot so what I'm going to do, in this case we know we've got 30<i> of travel, I'm going to step between 10 and 20</i> so at the moment we've got a value of 10* in there, again I'll just get us back onto our control point.
28:08 So let's just enter the value 20 and we'll press enter and again we see this really sort of slow, lethargic rise in our control, our measured cam angle, let's go back to 10.
28:22 And yeah absolute garbage, this is not going to work for cam control.
28:27 That's cool though, we're starting somewhere, let's go back to our proportional gain.
28:31 When we're making these changes, I always recommend at least initially making big changes so you can really see the effect of them.
28:38 So big changes, let's just start by doubling it, we started with 0.1, let's go to 0.2, we'll come back to our target angle, again we're going to do our step test, going to 20°, see that's much much faster, still garbage but much much faster than it was so let's come back down to 10.
28:55 Again much faster but absolute garbage.
28:58 OK we're going in the right direction though so what are we going to do, of course we're going to double it again, 0.4.
29:03 OK let's come back to our cam target table and I'll just get us back again into our set point, seem to be struggling to keep my foot on the throttle for some reason.
29:13 Let's try 20*, OK so we can see that we step up but now we've got this little oscillation in there so much much faster response but it overshoots and then comes back, it overshoots again and then it gathers itself up and gets pretty close to our target, let's step back down the other way, exactly the same, it's undershooting then coming back to our target.
29:34 This is actually pretty good though, this is what we want to see because at the moment, remember this is just like only using the throttle to get to our traffic lights, we're always going to overshoot without some damping or braking effect which remember is our derivative.
29:47 So let's just see what happens when we've really gone too far though.
29:51 We're going to double this again, 0.8.
29:53 And let's come back to our target, again we're going to do our little steps here, get back on the throttle again and 20°, OK so now we've lost control, see it's just oscillating wildly, we've gone too far.
30:08 So if we see something like this, no problem, just go back to our last change or maybe in between.
30:14 So we went from 0.4 to 0.8, let's go back to 0.4 'cause it wasn't too bad, pretty good.
30:19 I reckon we could probably go a little bit further but we'll see how we can deal with that.
30:23 Oscillation's gone, great, what we also know if we come back to our target table, again, we know that if we go back to 10° we've got that undershoot and if we go back to 20°, we've got that overshoot, fine let's bring in our second element which is our derivative gain.
30:40 So we'll go to our derivative gain and again we can kind of get a sense of the numbers that Haltech think are going to be suitable for this.
30:45 Let's start with a value of 0.01.
30:48 So a little bit less than what's in that base map but that's OK, let's see how that works.
30:52 OK we'll do our step test again, back down to 10°.
30:58 OK see we've got a tiny little undershoot.
31:01 It was more pronounced on the way up though so let's try 20° OK still got some overshoot but less than it was so it's working, let's go back to our derivative.
31:11 Again we simply start by doubling these numbers, we're not going to do any damage here, the system mechanically can't be damaged so no harm in making these big changes.
31:21 The problem is if we make really small changes, they can be too subtle to really see the effect of that change and we don't really know if that's having the effect we want.
31:30 Alright so let's try again, our step test, 10°.
31:33 That looks really really good.
31:35 Pretty sharp, crisp and nothing, no real undershoot but we know that the overshoot was more pronounced.
31:41 Pretty good there, reasonably happy with this.
31:44 Let's just try a little bit more derivative gain.
31:48 So we're actually going a little bit above and beyond, 0.04 would be doubling it.
31:53 Don't know if we're going to need to go that far but let's go back and we'll try again our step test, 10.
31:58 Problem is if we use too much derivative gain that's going to have the effect of artificially slowing down our response anyway because remember it is a breaking or damping effect so we do want to be a little bit mindful of that.
32:10 20°, OK that's actually pretty good.
32:12 I reckon I'm probably going to split the difference there and go in between so we'll come back down to our derivative gain.
32:18 Now understand here that there is no set in stone, this is the number you use.
32:23 There could be a variety of different values that are all going to give reasonably good control, it's about you evaluating how crisp that control is and getting something that you're happy with.
32:33 Let's just go back down to 10°, yeah pretty happy with that, 20°.
32:38 Yeah nice and crisp.
32:40 OK lastly we can add some integral gain and again this just really fixes any remaining error over time so it should help improve the resonse if we get it right, again we can see the values here that look like they're about right so let's just start with 0.06.
32:58 Again we can go to our target table, we'll step back down to 10°.
33:06 Back up to 20°, OK I'm pretty happy with where we're at with that.
33:11 If we go too far with any of these elements, proportional, we're going to end up with oscillation, likewise if we go too far with our integral, let's try and demonstrate that.
33:21 Let's just go really wild with this and go to a value of 0.5, we will now do a step test and we should end up with oscillation.
33:32 Little hard to see but it's not really controlling as well as it was.
33:36 So yeah integral and proportional, we're going to end up with a oscillation.
33:42 If we use too much derivative, we're going to end up with very slow lethargic response, like we would get if we're not using enough proportional gain.
33:52 So what we can do though is basically go backwards and forwards between our proportional and our derivative gains because once we get to that point where we're just starting to overshoot and oscillate with our proportional gain, we know that we can bring in derivative, we showed that and demonstrated it and that'll fix that.
34:10 That then allows us to go back and maybe try adding a little bit more proportional gain and see if we can get away with a little more proportional and a little bit more derivative, it's all about just getting the best response that we can.
34:21 So at this point we've basically got our PID algorithm set up so that we're getting good crisp, fast response so we've now got a system that can actually track our target accurately and give us the results we want so we need to do this before we ever try actually optimising our cam timing.
34:41 Now we can go ahead and do that though and with the cam timing, optimising this, there's two separate ways of doing it, we can do it under steady state control which is what I'll demonstrate in a second and then we can do ramp runs.
34:57 So basically we're just going to be optimising the cam timing in the way that the engine's going to be used.
35:03 So steady state, what I'm talking about there is holding a fixed RPM on the dyno, like we would if we're cruising at 2000 to 3000 RPM on the open road.
35:11 And what we're trying to do is basically optimise the cam timing so that we're making the most torque we can at that combination of load, manifold pressure and engine RPM.
35:23 Now when we get this right, what we're going to see is the torque will increase on the dyno so this is why I say this is something that is difficult, arguably impossible to do accurately on the road because we don't get that instantaneous torque feedback.
35:37 The other thing that will come with this though is that as we change the cam timing, essentially what that's doing is resulting in a change in volumetric efficiency in the engine.
35:48 In simple terms, we're affecting the amount of cylinder fill we're getting or in simpler terms still, the amount of oxygen going into the cylinder.
35:56 So when we get the cam timing optimal, we've got more oxygen going into the cylinder, this is why we can make more torque.
36:03 But a side effect of this is that we're going to find that our air/fuel ratio changes.
36:09 So this becomes a bit of an iterative process.
36:12 As we optimise our cam timing, we're going to need to go back to our fuel table and we're going to have to add more fuel or subtract more fuel depending on what we're doing with our cam timing so that we stay on our lambda target, our air/fuel ratio target.
36:25 Likewise, while the effect is smaller, the cylinder fill is also going to have an effect on the optimal ignition timing so it becomes an iterative process of cam timing, then adjusting the fuelling and the ignition timing to optimise for that point.
36:40 Check our results and then go again.
36:42 So it is a bit of a slow process but it's very easy to overlook that and end up masking actual cam timing gains because the air/fuel ratio might have gone too lean and that's actually a good sign believe it or not.
36:56 When the air/fuel ratio goes too lean, it means that we know we're getting more oxygen entering the cylinders so we need to add more fuel and that's where we're going to make more torque so if we don't monitor the air/fuel ratio, we can find that because the air/fuel ratio's actually moved too lean, the torque is either plateaued or maybe fallen away but if we actually took note of the air/fuel ratio, we're back to our fuel main VE table, added more efficiency there to add more fuel, got our air/fuel ratio back on track, then we would see the true gain of that cam timing.
37:27 Alright let me try and demonstrate that and see if we can get a decent result here, so what I'm going to do, back into our cam target table, so what I'll do is I'll just start by zeroing out a big chunk of this table and we'll get back to, I think we're about 3000 RPM here so this will require our torque display where we're going to be able to see the torque from our dyno as well as the cam timing so what we're looking for is that red line on our dyno, that's showing the torque that the dyno's measuring and it's always moving around a little bit so there is a bit of an art to kind of reading this.
38:06 Basically we want to average the values, you can just see it also auto scales so I just put a little bit more throttle in and it's jumped up.
38:13 Just looking, focusing for a moment on the cam table, we've got our little crosshairs that show where we are.
38:20 Just like anything that we're optimising in our tuning, we want to make sure that we stay as close as possible to the centre of a cell and we may need to readjust that with our throttle pedal position as we make cam timing changes so anyway, we're kind of there or thereabouts at the moment.
38:37 3000 RPM and -40kPa, about in the centre, we can see that we've got about 155 pound foot of torque being displayed, just actually get off this and come back into it 'cause the dyno's torque display is doing some weird stuff.
38:57 Try and get something a little bit smoother for us.
39:00 OK that's a little bit better.
39:01 OK so what we're going to do is enter a value of 10° and look at what our torque does and we also need to make sure again we adjust our throttle as required.
39:09 So we can actually see that our torque jumped up and I'm watching the lambda as well and we've gone a little bit leaner which is exactly what we want, I'll just get back into the centre again, wait for our torque graph to settle down.
39:23 So going from 0-10 we saw a gain and let's go from 10, oops, let's go from 10 right and now we'll go to 20.
39:38 And just to make matters worse, that demonstration didn't work because I hadn't pressed enter so let's just go back and try all of that again.
39:49 Alright looking at our graph we are now on 0, I didn't press enter, key mistake there, we don't want to do that, the change won't actually take effect until we press the enter key.
39:58 So enter a value of 10, we'll press the enter key and now I want you to watch that red graph, torque graph, and we see that our torque graph jumped up a little bit.
40:09 Our cam timing actually looks like our PID, after all of that, did not do a really good job, I'll address that later but we are on our 10° now, our torque has jumped up, we'll enter a value of 20, again what we're looking for here is the change after I press enter and our cam timing this time actually does a really good job of tracking it.
40:29 And our torque has jumped up a little bit, not a massive amount.
40:32 And when we see a small change in our torque, just like when we're tuning ignition timing, that generally means that we're pretty close to optimal.
40:40 I just put a little bit too much throttle on which resulted in that jump there so I'll just get us back, this is why it's so critical to be very sensitive on our throttle and make sure we're in the middle.
40:50 So also with our lambda which I know is off graph at the moment, we started with 0° cam timing with a lambda of 0.93, 0.94.
40:59 I'm now up to 0.98 so that again shows us that we're going in the right direction so let's just try our last test here, again I'll just get us back in the centre here, waiting for our torque graph to settle down and I'll enter a value of 30, haven't pressed enter yet, let's do that now.
41:16 30, slight increase, nothing really dramatic there.
41:21 I think the number that we actually had in there in the base map was 25 but basically looking at that between 30° and 20°, it's a bit of a coin toss, lambda hasn't changed either, that's sitting at 0.97 so kind of backing up that basically nothing much between sort of 20 and 30°.
41:39 So I wouldn't be using cam control to try and chase every last 10th of a foot pound of torque, it's not that critical but we can see changes of 2-3 foot pound and that is a meaningful result.
41:56 So we can round these numbers to get where we need to be.
42:00 The other element we're getting good cam control, if we just look purely at our graph, our base map at the moment.
42:07 You can see that if we were coming up through our 60 kPa column here, we've sort of got smooth numbers, 27, 30, 35, 35, 35, 32, 25, 13, 6.
42:20 It's really important that we have a sensible step in our target that the ECU and the mechanical system can have some hope of tracking.
42:31 What I mean by this is it's a mechanical system at heart and there is always going to be some latency in the control so it can't instantly jump from 0° to 40° or 30° or whatever.
42:43 So if we can make its life a little bit easier by smoothing it out and making it step like 5° instead of 15, we're going to end up with better control.
42:52 So that's always something that I try and look at and it goes in both directions.
42:55 So if we look at it here, I mean obviously I've just zero'd, just sort of set this whole block here to fixed values but if we look at something from the, let's try and draw somewhere where we can actually see it.
43:08 If we look at horizontally at 5000 RPM here, 12, 15, 17, 20, 25, 25, we've got the same smooth trend so really important to not try and have big steps and try and chase the exact number because while yes for an individual cell you may show maybe one or two more foot pound of torque, the reality is that when we actually drive the car, it's going to struggle track and that's going to mean it's erratic and the important point here is that with a lot of OE vehicles that run continuously variable cam control, they'll generally be mass airflow meter based and that's great for them because when the cam timing changes and the airflow into the engine changes, that mass airflow sensor is directly measuring that.
43:54 With our speed density system here, that's not the case, all we're looking at is a combination of manifold pressure and RPM.
44:03 And the volumetric efficiency for that combination will change depending on our cam timing so what I'm getting at here is that the cam timing we're actually seeing, what the engine's actually receiving isn't what our target was, then our fuelling and our ignition timing will be out so really important to make sure that the cam control has the best chance of doing its job.
44:27 So the process I just showed there, that's what we go through when we're doing steady state tuning and understandably there's a lot of cells here so you could spend a huge amount of time doing this, particularly when I also mentioned that we've only looked at cam timing, there's also the need to potentially go back and revisit our fuelling and our ignition timing.
44:48 Well the good news is that we don't necessarily need to tune every single cell.
44:52 For the very reason that I've just said, we've got smooth trends in this table.
44:57 We could pick out a few key cells, let's say maybe we want to tune this 4000 RPM -60, then we might want to tune the 0 kPa 4000 RPM, we could just simply interpolate horizontally between those and obviously the same goes as we move into positive boost.
45:13 Likewise with RPM we don't necessarily have to do every 500 RPM, we could do every 1000 RPM.
45:19 Obviously we could just simply reduce the resolution of this table to get the same effect.
45:25 There's a variety of different ways to skin the proverbial cat in this case.
45:30 Anyway that's the process we're going through.
45:32 With the steady state tuning, I'll generally do this, or focus my energies mostly in the areas that I know the engine's going to spend the most time, so that'd be sort of 2500 to 4500 RPM and sort of very light throttle cruise up to our transition into boost which might be maybe 20 to 30 kPa of positive pressure.
45:52 From there, the high RPM and wide open throttle area of the map, we're going to do this under ramp run conditons because if we do this under steady state, A it's not realistic and B we're also going to end up producing a huge amount of heat and putting a lot of stress on the engine and turbocharger which just doesn't make any sense.
46:13 So the process I use for this is we'll start by basically zeroing out the entire wide open throttle running area, can do that, let's just, reduce this a little bit.
46:27 We know we're going to go up to about maybe 100 kPa, 15 psi of boost.
46:32 So we'll start by setting that to 0, press enter.
46:35 OK so now we're going to be running on our most retarded timing.
46:38 So what we'll do is perform a ramp run and again we might need to tweak our fuelling and our ignition timing to optimise that ramp run for our 0° timing.
46:47 Once we're comfortable with that, we've got it optimised, I would save that ramp run so we can refer to it later.
46:53 Then we'll simply come back into our table, enter a value of 10°, go through the same process.
46:58 Do some ramp runs, optimise our fuelling and our ignition until we've got a good result that we're happy with and we'll go through, do that to 20° and then to 30°.
47:07 And this is basically going to give us some overlapping ramp runs which we can then use to guide us in building up our ideal cam timing map.
47:18 What I call our composite cam timing.
47:20 So let's have a look, I'm not going to go through and perform those ramp runs but here's one I prepared earlier so if we jump across to the dyno screen.
47:29 And what we've got here is, let's get rid of this one for a start, so we've got the yellow run here is 0° so our most retarded and what we can see straight away is very very little power at low RPM but right up at the top, right up at sort of 7500 RPM or 7000 RPM, that looks like it's made the most power, pretty much like I said it would right at the start, almost like I've done this before.
47:57 Then we look at our green run which is our 10°, so straight away you can see how dramatic that change is through the mid range.
48:05 It's kind of splitting hairs, it's made more power here at 6500 RPM, right at the top of the run there, actually our 0° has made a whopping 0.4 of a horsepower difference which is probably a run to run variation so basically what this means is between 0 and 10° there's really not much in it.
48:27 OK looking at our white run which is our 20°, we can see again good solid gain in power and torque down low, but now we're starting to see that effect of the cam timing being over advanced at high RPM, not really optimising our cylinder fill, we see that right at 7000 RPM our white run, we've actually lost 5 odd horsepower over our maximum run so obviously we're going the wrong direction here.
48:53 Finally our purple run, 30° the maximum mechanical advance that we can get.
48:58 Another good gain in power and torque down low until we get to this point about here, 5500 RPM, we can then see the white run which was 20°, that kind of overtakes it until we get to this point here, 6200 RPM, at that point the green run overtakes.
49:16 So now we can use that data to help us tune or optimise our cam timing map.
49:21 So let's start with our first point.
49:23 So we know from this that we want to be at 30° advance up to 5500 RPM.
49:28 So let's jump back into our laptop screen.
49:31 We know also, and I haven't touched on this that we're going to struggle getting good cam control down at very low RPM and that's simply because we don't have enough oil pressure to really get good control so generally I might actually start with maybe 0 or maybe 5° at 1000 RPM, we're really not interested too much until we get up to sort of 2000 RPM.
49:52 But let's start here, 30°, let's try 15 and 20, again I'm just trying to get some smooth numbers in here that are going to be actually achievable, I'll take that actually back up to 10 to give it a nice smooth control.
50:07 Alright so we know that our first point is 5500 RPM so let's come up to 5500 RPM.
50:12 So at that point the white run which is 20°, that actually made more power so we'll enter that, then the next point coming over to our dyno graph again, it's about 6300 RPM is where our 10° run starts making more power.
50:31 Now we don't actually have a 6300 RPM break point, we can obviously add one if you want to get really fussy but let's just call that 6500 for the sake of our demonstration so we're going to drop that down to 10°.
50:45 So we want to set these ones to 20 and then we want to set this, 6500 RPM to 10°.
50:54 And then we got to that point where we really didn't see much of a change but I mean there was 0.4 of a horsepower or whatever it was at 7000 RPM so now we've got this kind of shape to our graph, what we can then do is go and perform a ramp run with our composite mapping built out from those individual runs and what we should get, if we get it right, is a run which is red, you can't see it because it's kind of being hidden by the maximum values but basically it should follow the maximum values right through here.
51:29 We actually see there's probably some run to run variation because we've actually made a little bit more power, probably heat soak because I did all of these runs quite quickly.
51:37 So basically that's where we should end up.
51:40 Now coming back to our map here, what I'd do once I've got a composite map done, I would also go ahead and bracket these and what I mean by this is this is what the dyno says should be optimal but let's try advancing them 5° or 10° and then try retarding them 5 or 10° and just see if there's anything more to be had.
52:04 Likewise you may find that the changeover points need to be tweaked a little bit.
52:10 Maybe, just maybe at 5000 RPM, we'd actually benefit from 25° instead of 30 but it's very easy to make these small subtle changes and I mean you're going to already be within the last few percent of what is going to be available anyway so this is really sort of starting to fine tune.
52:28 A lot of it comes down to how much time do you actually want to spend doing this? It's really up to the individial and if you're doing it commercially obviously time is money, if you're going to be charging this out to a customer.
52:37 Now an element that I haven't talked about yet is integral windup which is a term that you probably haven't heard of if you haven't done any PID tuning.
52:50 And this really comes back to the mechanical limit of the cam control.
52:54 So I'm going to do a demonstration on this, after we've had the demonstration we will go into questions and answers so this is a really good time to remind you if you've got questions, please start putting those in the comments.
53:07 So we already know that this mechanical system can only advance us up to about 30° or 29.6, 29.7 was what it actually was.
53:16 So what happens if we start targeting values that the mechanical system can't achieve? Well what's going to happen is that integral element, which remember looks at the error over time, what that's going to do is just continually, the longer it can't reach its target, it's going to increase the duty cycle trying to reach this target that is absolutely impossible.
53:37 No big deal you might think but the problem is that then when we come back to targeting something we can achieve, we have to unwind all of that integral element before it's going to track, much clearer and simpler to understand if we do a demonstration so of course we're going to do exactly that.
53:55 So let's just get ourselves up and running here.
54:01 Again we'll go up to about 3000 RPM.
54:05 Right so what we're going to do here is start by targeting 20°.
54:12 And there's actually some integral windup element going on there which I'll explain in a second.
54:17 Alright so on our graph here we can see that we're really nicely right on top of our target at the moment.
54:24 So let's try 25° which we know we can achieve, it jumps up really quickly, let's go back down to 20, yep it follows pretty quickly.
54:31 Let's try 50°.
54:34 OK so we see our green line step up to 50, if we're looking at our specific number here, we can see, there's a bit of interpolation going on, 50° is our target and we're banging around there at about 29.5° and obviously I've been doing this for a while because I've been talking about it.
54:51 So let's go back to something that we can target, let's change it to a value of 20.
54:57 OK our green line's changed, our red line has not budged, give it a chance, it'll get there.
55:05 Obviously I was at 50° target for quite a long time while I was talking about what was going on there.
55:11 But promise you it will happen in time, it's going to start dropping back down.
55:17 There we go, very slowly it's coming back to its target and you can see how slowly that's dropping down and that's because the integral element, when it was trying to hit 50° or whatever I'd put in, it couldn't get there so the duty cycle was just slowly but surely incrementing up to the maximum value, right now we're back on our target.
55:34 Just showing again if we go up to 25°, nice quick response, 15°, nice quick response, but as soon as we target something outside the realms of what it can actually achieve, that integral windup element is going to really really affect us and affect the performance.
55:50 So with this aspect, we are going to be getting integral windup at each extreme so if we're looking here, our cam target is zero at the moment.
56:03 Let me just turn my aircon off.
56:07 And we can see that our cam angle is moving around.
56:10 If we've got our offsets incorrectly set, so we're always seeing at the mechanical stop, a value of 0.5, 0.6 which we've got now, we're getting that integral windup working at this point as well so it's always a good idea to actually make sure that we're targeting something that is just a little bit off the mechanical stop so that we don't ever end up in a situation where we've got that integral windup occurring so that's just going to help us with response and it's always a good idea to test pretty early on in the cam tuning what the mechanical extremes are for advance and retard, make sure that you're always staying within them, otherwise you're going to end up with lethargic response and then that's going to affect the fuelling and the ignition timing because as I mentioned, we're going to have a volumetric efficiency that's different to what the ECU is expecting.
57:04 Alright let's jump into our questions and answers now, if you've got any more, please keep them coming.
57:11 We'll see how many of these we can through.
57:31 We've got, the first question is can you show how we could use quick tune feature with cam control as a 4D table is being used.
57:38 So quick tune, you could use this to quickly optimise your fuelling and get back onto target, you're not going to be using quick tune specifically for the cam control element, that's going to be something manual because the ECU has no feedback on the torque which is obviously what we actually need in order to optimise this.
58:00 So fuelling yes, cam control no.
58:03 The other question was what's the problem with the wideband controller? It's on the bench, about 50 metres away from the car, that's the problem.
58:13 The ECU just to be clear, went into this car about 3 hours ago, purely for this demonstration, we're waiting on an exhaust system that should turn up before we actually permanently fit a wideband so don't worry, nothing at all wrong with the controller at all, it's very hard for the controller to work when it's not actually connected to the vehicle and the ECU.
58:35 Bruce Lee has asked, do you need to adjust the PID when you change the viscosity of the oil from like 5w30 to 15w50 for example? The answer in my experience is maybe but normally yes.
58:48 I went through this on our FA20 powered Toyota 86, that was turbocharged and it was quite a dramatic change from the factory specified 0w20, I had the PID control really nicely dialled in for the cam control.
59:02 We ended up stepping, cause it was a race car, we ended up stepping up a 10w40 oil and that actually required quite a dramatic rethink of the PID gains so absolutely.
59:14 Basically anything that affects the responsiveness of the control system may require the PID to be tweaked.
59:24 The next question is can you tune the cam timing in closed loop lambda, kind of similar to the previous question, to keep the lambda at target and then look at the fuel trim to clean it up, yes absolutely.
59:34 And this comes down to personal preference.
59:37 I do generally use closed loop lambda control with cam timing because it does get a little bit tedious going backwards and forwards between all of those maps.
59:47 Next question, how do we test when we don't have info on the solenoid? If the frequency is 200, 500 or 1000 Hz, without sending it to the basket, any test with the oscilloscope? Honestly this has very seldom been a consideration, you're going to have a base map from the ECU manufacturer for just about any cam control engine and they'll have probably done the testing to find out a suitable frequency for that solenoid to pulse at.
01:00:16 Generally though, I can't think of an example where the range wouldn't be somewhere between about 200 and 300 Hz.
01:00:24 That generally seems to be pretty suitable for cam control systems.
01:00:29 Absolutely nothing wrong with getting it set up at 200 Hz, testing the responsiveness, looking at how it tracks your target changes and then simply doing the same as what I suggested with the PID, double it.
01:00:41 Does it make it better, does it make it worse? If it made it better, double it again, chances are if you're at 200, you go to 400, and then go to 800, at that point the solenoid's probably going to really struggle.
01:00:52 You're not going to damage anything though, it's just going to operate really poorly.
01:00:55 And then once you sort of find the range where you're seeing an effect that's in the right direction, you can start getting a little bit more granular with your changes instead of doubling it so that's the process that I use for a lot of testing where I don't really know what the magic number is going to be.
01:01:11 There is no magic number of course but make big changes to start with so you can really assess the effect of that change and then once you see which direction you need to move in, start dialling in smaller and smaller changes.
01:01:22 Last question, any major difference in approach in a forced induction vs naturally aspirated? No not really.
01:01:32 Yeah the process is identical and the trends that we see generally in the cam targets are very similar, irrespective of whether we're forced induction or naturally aspirated.
01:01:46 Alright that brings us to the end of our questions and as usual if any of our members are watching this in our archive at a later point and have questions, please feel free to ask those in the forum and I'll be happy to answer them there, thanks for watching and hopefully we'll see you next time.