Maths is cool

Ask any questions about using PicoScope Automotive software here.
Steve Smith
Pico Staff Member
Pico Staff Member
Posts: 711
Joined: Sun Aug 25, 2013 7:22 am

Re: Maths is cool

Post by Steve Smith » Fri Jul 19, 2019 3:59 pm

Following on from our Pico Practical engine evaluation Q&A here, I wanted to dig a little deeper into the benefits of 48 V MHEV in comparison to 12 V systems.

The current Audi A8 proved to be the perfect vehicle for such an experiment given it has the ability to crank either by a conventional 12 V starter motor or a 48 V Motor/Generator (MG) system.

From a cranking perspective, the 48 V system offers more torque & power without the accompanying lag of the 12 V system during the Stop/Start phase

With this in mind, I thought it would be great to do these comparisons with maths and incorporate “Time” into our math channel equations

Starting with the 12 V system, below we have crank & start of the V6 3.0 TDI engine using a conventional starter motor
IMAGE 1.png
12 V Crank & Start
Above I have calculated the power of the starter motor using the math channel Voltage x Current and the engine RPM via the frequency of the crankshaft sensor signal (incorporating a filter) see here.

Below we have added multiple math channels now looking at Torque (Nm) using power & engine speed, Energy (Wh) using power and “Time”, and Energy again (Ws) using the integral of power (Integral being the area under the power math channel)
IMAGE 2A.png
12 V Crank & Start with additional maths
Looking at the included measurements above, we can paint a picture of the events taking place during the 460 ms of cranking required to start the engine.

Now looking at the same engine starting via the 48 V MG system.
IMAGE 3.png
48 V Crank & Start
Once again looking at Torque (Nm), Energy Watt hour (Wh) and finally Energy Watt seconds (Ws) in order to draw a direct comparison between both systems.
IMAGE 4.png
48 V Crank & Start with additional maths
The first item that “stands out” is the cranking time of the 48 V system at 277 ms compared to 460 ms of the 12 V system. Let’s be honest, 460 ms is good but note the dramatic increase in cranking speed from zero rpm to idle speed with the 48 V system.

Here we achieve over 600 rpm in a quarter of a second!

To summarize
IMAGE 5.png

I need to revisit the results for Energy via “Time” for the 12 V system as they do not appear true! This may be due to the fact that the capture contains 3 x crank and start events in one waveform buffer, where the 48 V system contains just 1 crank and start event. I will feedback ASAP

All in all these additional benefits of power, torque and speed originate from a totally independent power source (48 V system) resulting in the absolute minimal impact on the 12 V system during the Stop/Start phase.

Couple this to the fact that fuel consumption, emissions, energy recuperation and starting torque all improve I can now see the benefits.

Another interesting fact is that the 48 V MG system has the ability to compensate for the effects of typical engine vibration orders such as E3 with this V6 engine which is mind boggling!

Another BIG thank you to our Math Guru Pico Martyn for all his support on this adventure

I hope this helps, take care…..Steve

Posts: 10
Joined: Sat Oct 15, 2016 3:29 am

Re: Maths is cool

Post by Droidkiller » Wed Sep 25, 2019 5:23 am

Hi all!
I'm looking for a useful math channel for theoretical MAF on turbo engine.
Steve Smith,have you any suggestion how to add up the actual turbo pressure(and more air amount)to the math channel that you used here?

"Calculating MAF
The maths channel formula for MAF is written as follows:
PicoScope calculates the RPM (as above) but now incorporates the additional formula to account for 2 intake strokes and a 1.8 litre engine
Once again select Tools>Maths Channels and then Create. Click on Advanced and type the exact formula as above for RPM 60/36*freq(A)Â but now add /60/2*1.8.
The whole formula looks like 60/36*freq(A)/60/2*1.8 "

I mean to measure actual turbo pressure with WPS(or turbo pressure sensor of the car),RPM from crankshaft,as you did by Celica,and somehow add the increased volume of air to theoretical MAF math channel.

Thanks for any suggestion.

Steve Smith
Pico Staff Member
Pico Staff Member
Posts: 711
Joined: Sun Aug 25, 2013 7:22 am

Re: Maths is cool

Post by Steve Smith » Thu Oct 10, 2019 8:11 am

Hello and thank you for the post.

Sorry its taken so long to reply as I have missed your post.

I will look into this and post here as I have something that should work

Take care......Steve

Posts: 10
Joined: Sat Oct 15, 2016 3:29 am

Re: Maths is cool

Post by Droidkiller » Thu Oct 10, 2019 11:52 am

Thanks for reply Steve.

Steve Smith
Pico Staff Member
Pico Staff Member
Posts: 711
Joined: Sun Aug 25, 2013 7:22 am

Re: Maths is cool

Post by Steve Smith » Sun Oct 20, 2019 11:31 am

Calculating and graphing MAF for turbocharged engines

Following on from the Valvetronic forum post here I felt this would be a good candidate to test out the relevant formulas to calculate airflow where turbochargers are installed

I must give a huge thanks to Andy Crook at GotBoost Ltd as his input has been invaluable once again.

The engine in question is a BMW 114i N13, 4-Cylinder producing 102 PS @ 4000 rpm

In order to determine MAF we need to calculate the Volumetric Efficiency (VE) of the engine

In a perfect world with 100% VE this engine should consume approximately 102 gm/sec of air
This is derived from the quoted power output of the engine
Max power: 102 PS @ 4000 rpm
VE at 100 % = 102 PS x 1.0 = 102 gm/sec (1.0 is 100% expressed as a decimal: 100% / 100 = 1.0)
This provides an approximation of maximum airflow through this engine if VE were 100%

In reality VE will be around 80 to 90 % and is constantly changing based on numerous variables such as inlet & exhaust lengths/diameters, turbocharger loading (exhaust side) valve lift, valve timing & valve duration to name but a few. Note that this engine has VVT, VVT-L (Inlet) and a turbocharger which is enough variables to consider for one day!

Therefore, a typical peak MAF value would use VE at 80% and look like, 102 PS x 0.8 = 81.6 gm/sec
The reverse can also be used as an indication of engine power:
Measured Peak Airflow (gm/sec) / 0.8 = Engine power
81.6 gm/sec / 0.8 = 102 PS

These “rules of thumb” can be used as indicators only for “expected” MAF/Power values when diagnosing engine running issues

To calculate MAF for a given engine speed (here we use 4000 rpm, max power) we need to capture manifold pressure

For this we can use a custom probe but need to understand the output characteristics of the Manifold Absolute Pressure sensor (MAP) if a WPS500 is not available. After hours of research I believe the following specifications to be correct for our Bosch MAP sensor 0 261 230 253 (DS-S3 3- wire sensor)
IMAGE 1A.png
Image 1A
IMAGE 1.png
Image 1
Based on the data in the image above we know:
Sensor supply voltage = 5.0 V
Nominal sensor voltage = 0.5 V
Sensor voltage measurement range = 0.5 V to 4.5 V
0.5 V to 4.5 V utilizes 80% of 0 V to 5 V supply voltage 80% / 100 = 0.8
Sensor pressure measurement range 2.05 bar

The pressure measurement range is derived as follows:
Sensor Measurement range = 0.15 bar to 1.2 bar absolute (1 bar = atmospheric pressure)
0.15 bar (sensor minimum value) is below atmospheric, adding 0.85 bar returns this value to atmospheric pressure @ 1 bar
1.2 bar (sensor maximum value) is the value above atmospheric pressure @ 1 bar
0.85 + 1.2 = 2.05 bar measurement range

To determine the sensor incline/slope we use the formula:
Sensor voltage measurement range x Voltage supply / Sensor pressure measurement range
Sensor Incline = 0.5 - 4.5 V expressed as a decimal 0.8 x 5.0 V / 2.05 bar
Sensor incline = 0.8 x 5.0 / 2.05 = 1.951

To define sensor output at 1 V we use 1 / 1.951 = 0.512 bar
Sensor incline therefore follows the rule, 1 V = 0.512 bar and because this sensor has a linear output 2 V would equal 1.024 bar and 3 V 1.536 bar etc.
To create a Custom Probe such as to display MAP sensor voltage as a physical pressure we use the linear equation y = 0.512 x + 0

More information on custom probe creation and a short video can be seen here and here

To qualify the math’s, you can always use the scan tool “data list” to monitor MAP whilst simultaneously capturing the MAP sensor output via the scope using the custom probe created above. With the ignition on engine off, both scan tool and scope should display approx. 1 bar (atmospheric pressure)

A similar technique can be adopted using a vacuum or pressure gauge where you apply a known pressure to the MAP sensor whilst comparing values at the scope and scan tool across the entire operating range of the sensor. This technique allows you to plot the MAP sensor output voltage in relation to the applied pressure, these values can then be entered into a Lookup-table. (See pages 10-14 here )

Moving on…….
The following waveform uses the above linear equation/custom probe for both channel A (Boost pressure sensor) and channel B (MAP sensor) Both sensors have the same output characteristics and therefore the same linear equation applies. The part number of the boost pressure sensor (pre throttle/post intercooler) is 0 261 230 252 (DS-S3-TF 4 wire sensor) where the 4th wire provides inlet air temperature data to the PCM. The channel labels identify all the remaining inputs to assist with MAF calculation.
IMAGE 2.png
Image 2
Now to apply math’s to bring about clarity.
In the waveform below we have captured vehicle acceleration in 2nd gear on a level road surface (Valvetronic active) with the gas pedal to the floor until the engine speed peaks at 4000 rpm.

Note how channel E (purple) indicates throttle plate position (Sensor 2). This sensor operates in reverse where the voltage decreases as the throttle opening increases.
In the interest of interpretation, I have used the math channel “-E” to invert this channel. (Simply adding the minus symbol before any channel letter will invert your chosen channel)

To convert the crankshaft signal on channel C to indicate engine speed with the math channel: LowPass(freq(C), 50)

To graph the airflow from the digital MAF sensor (channel D) we use the math channel:

To calculate the differential pressure between the Boost presser sensor and MAP sensor we use the “built-in” math channel:

Here we can detect possible air leakage or intake anomalies as theoretically, if the throttle plate is open, boost pressure should approximately equal manifold pressure. Note below how the differential pressure is minuscule (62.41 mbar) until the throttle plate partially closes (@ 11.49 s) when the gas pedal is released. Here the boost pressure momentarily peaks against a partially closed throttle plate, whilst manifold pressure falls into a depression.
IMAGE 3.png
Image 3
Calculating MAF (with turbocharger)
• BMW N13 engine with Valvetronic active, gas pedal held to the floor in 2nd gear to 4000 rpm
• Data captured simultaneously by scan tool and scope

Using data captured from the scan-tool we obtained the following results:
MAF: 268 kg/h (74.44 gm/sec)
Engine speed: 3998 rpm
Intake pressure: 1267 mbar
Throttle: 2.5 V
Boost pressure: (Before throttle) 1286 mbar
VE Calculated from scan tool data: VE = 74.44 / 102 = 72.98 % (rounded to 73% / 100 = 0.73)

The fundamental requirements for calculating airflow (turbo charged engine) are:
• Engine capacity (liters)
• Engine Speed (RPM)
• Manifold Absolute Pressure (Bar)
• Volumetric efficiency (% expressed as a decimal)

The equation is:

Engine Capacity (1.6) x VE (Derived using 74.44 gm/sec = 0.73) x 3998 rpm x 1.267 bar / 2 intake strokes per crankshaft revolution = MAF in Litres per minute
1.6 x 0.73 x 3998 rpm x 1.267 / 2 = 2958.232 L/min
1 litre of air = 1.223 gm @ sea level (15°C)
2958.232 L/min x 1.223 gm/litre for air mass = 3617.918 gm/min
3617.918 gm/min / 60 = 60.30 = gm/sec (using VE calculated from scan tool data)

In order to graph airflow within PicoScope we can incorporate one of the following VE values into our math channel:
1. VE calculated from scan tool data 73% (0.73)
2. VE @ 80% 0.8 which is a typical average
3. VE @ 100% 1.0 to obtain the theoretical maximum airflow

If we use VE calculated from scan tool data (0.73) the math channel is as follows:

LowPass(freq(C),50)*(1.6*0.730)*B/2*1.223/60 = Air flow @ 73% VE (air mass at 1.223 gm/L)

If we use VE at 100% (1.0) the math channel changes to

LowPass(freq(C),50)*(1.6)*B/2*1.223/60 = Air flow @ 100% VE (air mass at 1.223 gm/L)

The graphed airflow can be seen in the waveform below:
IMAGE 4.png
Image 4
As you can see above the airflow values calculated above do not tally with the scan tool calculation of MAF 268 kg/h (74.44 g/sec)!
At 73% VE the math channel airflow peaks at 60.81 gm/sec
At 100% VE the math channel airflow peaks at 83.37 gm/sec
Had we used VE at 80% (average) the math channel airflow would peak at approx. 66.88 gm/sec
One possibility is the update speed of the scan tool as we cannot confirm the accuracy and correlation between parameters. With the scan tool we have a momentary snapshot of data such as Engine Speed: MAF: Throttle Position over “Time”.

For example, the displayed airflow (268 kg/h) could relate to an engine speed momentarily above 3998 rpm! This is a real issue as we use 268 kg/h to calculate VE and then incorporate the value into our math channel! This of course is another variable to consider and perhaps a good reason to use VE at 80 % (Typical Average) and VE at 100% within such math channels.

Another variable to consider is an error within the custom probe setting based on inaccuracies within the acquired data sheet containing the MAP sensor output characteristics! (Images 1 & 2)
I am not 100% convinced the data is applicable to the sensor with part number 0 261 230 253 but the scope data for manifold pressure does match the scan tool data. To remove this variable, a WPS500 installed into the inlet manifold with deliver actual pressure values requiring no “processing” via the PCM/Scan tool or Custom Probe!

Valvetronic inactive
Given we are using a Valvetronic engine, an identical (Max power) road test was carried out to determine the effects upon air flow with the Valvetronic actuator disconnected. Here the engine can run as normal utilizing the throttle plate for conventional air intake control with a fixed valve lift (set to maximum)

Using data captured from the scan-tool we obtained the following results:
MAF: 263 kg/h (73.05 g/sec)
Engine speed: 3999 rpm
Intake pressure: 1249 mbar
Throttle: 1.8 V
Boost pressure: (Before throttle) 1255 mbar
VE Calculated from scan tool data: VE = 73.05 / 102 = 71.61% (71.61% / 100 = 0.72)

This is another statistic that surprised me as I thought airflow with Valvetronic active would have been greater than inactive. As we can see here at max power, there is little to choose between airflow and calculated VE with VT active or inactive.
Once again, thinking this through, at WOT (or should I say “gas pedal to the floor” as the PCM decides where to position the throttle plate) airflow will be similar for both running conditions (VT active/inactive) based on intelligent throttle plate control!

With VT active, airflow is controlled via a clever combination of throttle plate position and inlet valve lift.
With VT inactive, the inlet valves default to maximum lift and therefore airflow is controlled solely by the position of the throttle plate

In the capture below take a look at the throttle plate position compared to the waveform above!
VT active throttle plate position 2.5 V, VT inactive throttle plate position 1.8 V
Remember TPS 2 operates in reverse where the voltage decreases as the throttle opening increases.
Here we have a larger throttle opening when VT is inactive!
IMAGE 5B.png
Image 5
Looking at the capture above we can see how throttle plate intervention (due to VT inactive) introduces a considerable pressure differential between the inlet manifold (post throttle) and intake assembly (pre- throttle) given the air intake is now controlled in the conventional fashion. Once again, the good news here is that with the throttle plate opening increased, the pressure differential under boost conditions is 0 bar.

All in all, VE and MAF calculations are immensely challenging given the numerous variables associated with intake control systems (more so with turbo charger applications). However, I hope the formulas above (which incorporate boost/manifold pressure) will help with such calculations

Take care………Steve

Post Reply