Maths is cool

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

Re: Maths is cool

Post by Steve Smith »

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
12 V Crank & Start
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)
12 V Crank & Start with additional maths
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.
48 V Crank & Start
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.
48 V Crank & Start with additional maths
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
INITIAL TEST RESULTS
INITIAL TEST RESULTS

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

Droidkiller
OneWave
OneWave
Posts: 13
Joined: Sat Oct 15, 2016 3:29 am

Re: Maths is cool

Post by Droidkiller »

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?
https://www.interworldna.com/pico/automotive/celica_scope_scan_tool_together.php

"Calculating MAF
The maths channel formula for MAF is written as follows:
60/36*freq(A)/60/2*1.8
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: 1581
Joined: Sun Aug 25, 2013 7:22 am

Re: Maths is cool

Post by Steve Smith »

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

Droidkiller
OneWave
OneWave
Posts: 13
Joined: Sat Oct 15, 2016 3:29 am

Re: Maths is cool

Post by Droidkiller »

Thanks for reply Steve.

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

Re: Maths is cool

Post by Steve Smith »

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
Image 1A
Image 1
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
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:
freq(D)

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

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
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
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 & 1A)
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 5
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

KimAndersen
TwoWaves
TwoWaves
Posts: 246
Joined: Fri Nov 30, 2012 2:53 pm
Location: Denmark

Re: Maths is cool

Post by KimAndersen »

Hi Steve

What a great writing you have done here. It is not an easy task to calculate the correct airflow that the engine consumes when there are so many parameters / variables to be include in this calculation.

One thing that you were a little suspicis about were the pressure sensor range and if you ask me is diagram/graph over this sensor not the correct one. Its the right OEM number to that particular vehicle, but as you can see here I´ve found a Meat & Doria 82503 pressure sensor where the pressure range goes from 38 kpa to 260 kpa. This will offcourse create a totally different calculation which in the end could result in the correct output in terms of gram per second (g/s).

BMW 114I - PRESSURE SENSOR 38 -260 Kpa
BMW 114I - PRESSURE SENSOR 38 -260 Kpa

Once again thanks for great case study. :wink:

Regards
Kim

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

Re: Maths is cool

Post by Steve Smith »

Hello Kim and thank you for the feedback.
I cannot tell you how long I searched for the MAP sensor data and never found your Meat & Doria data sheet. If the truth be told, I would not know where to look as I have never heard of the manufacturer, thank you.

I think this proves just how challenging it can be to obtain such data and more importantly, how reliable is the data you discover!

Using the new measurement range 38 kPA – 260 kPA (absolute)
Convert to kPA to bar we divide the pressure value by 100
38 / 100 = 0.38 bar
260 / 100 = 2.6 bar
Sensor Measurement range = 0.38 bar to 2.6 bar absolute (1 bar = atmospheric pressure)
0.38 bar (sensor minimum value) is below atmospheric, adding 0.62 bar returns this value to atmospheric pressure @ 1 bar
2.6 bar (sensor maximum value) is the value above atmospheric pressure @ 1 bar
0.62 + 1.6 = 2.22 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.22 bar
Sensor incline = 0.8 x 5.0 / 2.22 = 1.801

To define sensor output at 1 V we use 1 / 1.801 = 0.555 bar
Sensor incline therefore follows the rule, 1 V = 0.555 bar and because this sensor has a linear output 2 V would equal 1.11 bar and 3 V 1.665 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.555 x + 0

The difference between custom probe settings means our manifold pressure will now read approx. 8 % higher!

I think this is a perfect example of why we should capture the MAP sensor signal voltage simultaneously when using a custom probe setting to measure manifold pressure. (If you have enough channels)

In this scenario you can apply math’s to the signal voltage (post capture) to obtain the revised manifold pressure value

In the example below I have captured manifold pressure using the original custom probe setting
y = 0.512 x + 0 (channel B) whilst capturing manifold pressure sensor signal voltage (channel A) along with a WPS500 installed into the manifold (channel C)
Image 6
Image 6
We can see above how the original custom probe (channel B) displays 1.279 bar peak whilst the math channel A*0.555 (Magenta) displays 1.394 bar given the revised value of 0.555 is applied to the MAP sensor signal voltage of channel A

To confirm the accuracy of both, the WPS is then used to qualify our physically measured manifold pressure where we obtain 330 mbar (Gauge) or 1.330 bar (absolute)

So how does this affect our final MAF calculation?

VE calculated from the scan tool data (Valvetronic active @ 1.394 bar manifold pressure)

Engine Capacity (1.6) x VE (Derived using 74.44 gm/sec = 0.73) x 3998 rpm x 1.394 bar / 2 intake strokes per crankshaft revolution = MAF in Litres per minute
1.6 x 0.73 x 3998 rpm x 1.394 / 2 = 3254.756 L/min
1 litre of air = 1.223 gm @ sea level (15°C)
3254.756 L/min x 1.223 gm/litre for air mass = 3980.567 gm/min
3980.567 gm/min / 60 = 66.34 = gm/sec

This value is approx. 8% higher than originally calculated thanks to the increased boost pressure value

Using VE at 100 %

1.6 x 3998 rpm x 1.394 / 2 = 4458.570 L/min
1 litre of air = 1.223 gm @ sea level (15°C)
4458.570 L/min x 1.223 gm/litre for air mass = 5452.831 gm/min
5452.831 gm/min / 60 = 90.88 = gm/sec

Once again, 8% higher than the calculations seen at image 4

Thank you again Kim and I hope this helps with future calculations

Take care, Steve

Droidkiller
OneWave
OneWave
Posts: 13
Joined: Sat Oct 15, 2016 3:29 am

Re: Maths is cool

Post by Droidkiller »

Thank you for the meticulous thorough explanation Steve.Nice case study again :wink:

JLRSA TA
Newbie
Posts: 3
Joined: Wed Apr 01, 2020 8:09 am

Re: Maths is cool

Post by JLRSA TA »

Hi Steve, members...

I have a question related to duty cycle calculations as discussed earlier in this post;

With the latest software version I noted that one could now also use a automatic measurement to measure negative duty cycle, an awesome addition thank you.

Working quite a bit on JLR products, we deal with negative applied/switched PWM very often (I suppose many other brands as well).

In the attached psdata file, you will notice the scope is setup to measure the voltage applied (PWM) on channel A, current on channel D (Rising when V is low, confirming the -PWM) and then an auto measurement and a math channel measuring the negative duty cycle %.

My query is regarding measuring or calculating the effective voltage the component will experience, due to the applied PWM. In my head it feels as easy as simply taking the total applied V (14.65V) and calculate the applied Voltage by using the "on time" percentage...

How would one do this using a math channel?
I tried using "duty(-A)/5", with V as the unit, to give me a range of 20v (from the 5V example earlier in this post), but the values are way off compared to actual multi-meter measurements across the component.

Thanks a mil for you and your teams' continuous support.
Attachments
negative duty cycle.psdata
(24.55 MiB) Downloaded 447 times

User avatar
PicoKev
TwoWaves
TwoWaves
Posts: 236
Joined: Thu Apr 05, 2012 9:16 am

Re: Maths is cool

Post by PicoKev »

Plenty of measurements to play with. :D The Question (AS always!) is what value are you expecting and what are you reading on your DVOM?
Pico Forum.PNG

"
JLRSA TA wrote:
Thu Apr 16, 2020 1:44 pm
but the values are way off compared to actual multi-meter measurements across the component

Any Value you get from a DVOM will have a huge variance depending on the number of samples being used for the calculation, the sample rate and also the conversion Factor (Average, RMS,Mean plot etc etc)

Post Reply