Maths is cool

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

Maths is cool

Post by Steve Smith » Fri Sep 21, 2018 4:03 pm

Following on from forum post topic17181.html
I wanted to begin a new post on the power of maths.

There is so much that can be revealed using math channels applied to the raw data we have captured.

The real beauty of math channels is that they are applied post capture to existing saved files (that maybe years old) to reveal new information about past faults

Once again the message is…………..
MATHS IS COOL.jpg
Maths is cool
For information how to access the math channel menu/wizard the following link will help https://www.picoauto.com/library/traini ... onus-class where we discuss the “Built-in” math channel A-B

With regards to the application of math channels:

1. Ensure you have enough samples on screen. (Ideally, 1 million samples minimum)
1MS SAMPLES.jpg
1 MS Minimum
2. Ensure you have sufficient data on screen containing the relevant information required. This may be voltage fluctuations or a number of specific cycles/events

3. Allow PicoScope time to fill the screen with data, do not stop the capture midway across the screen.

4. Ensure your captured signal does not over range at any point during the capture

5. Low pass filtering of the original signal may be required to remove noise/spikes from the waveform. This will have the effect of “smoothing” the displayed math channel as it does the original signal

The following waveform is a typical example.

Here we have battery voltage and starter motor current of a cranking engine during a relative compression test (i.e. crank non start)

The waveform has sufficient samples, a complete screen/buffer of data with a number of compression events and does not over-range at any point.

A 1 kHz low pass filter was applied to channel A and B in order to improve the results displayed by the math channels

Starting with the math channel A / B (Voltage divided by Current) we can display the circuit resistance during cranking. Note how the resistance decreases in proportion to the current flow through the starter motor during each compression event. (Ohms law in action)
RESISTANCE 2.jpg
Resistance
If we now multiply channel A and B, Voltage x Current (A x B) we obtain Watts (Power) where peak electrical power occurs at peak compression, measuring approx. 1.28 kW
POWER.jpg
Power
Given we know the number of cylinders for this engine (4) we can determine the frequency of 2 x peak compression events based on peak current. (These are evident between the time rulers)

A 4 stroke, 4 cylinder engine will produce 2 x compression events per engine revolution, if we know the frequency of these events, we multiply by 60 to graph & obtain RPM (Cranking speed as indicated in the Frequency/RPM legend)

The formula for RPM in this scenario is 60/2*freq(B)
Notice the excellent and stable cranking speed across the whole capture of approx. 280 RPM
RPM.jpg
RPM
Finally as if that wasn’t enough, given we know Power and RPM, add in a constant of 95 (for Nm) and we can obtain torque! Here is the formula 9.5*(A*B)/(60/2*freq(B))
Torque.jpg
Torque
The above waveform reveals how peak torque occurs at peak compression, using channel B (current) as our reference.
As you can see, we originally started this capture with no more than voltage and current, but used maths to obtain Resistance, Power, Speed & Torque.

Please add any math channels you use during diagnosis to this post and rest assured I will add more as we move on together.

Please also find the psdata file below containing all the above waveforms and math channels.
Remember to activate the low pass filter for channels A and B.
Toyota_Auris_2007_Petrol_20180920-0001.psdata
psdata file
(6.71 MiB) Downloaded 81 times
I hope this helps, take care……Steve

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

Re: Maths is cool

Post by Steve Smith » Fri Sep 28, 2018 10:01 am

The following math channel once again uses Ohms law to divide voltage by resistance to obtain current. I am thinking here of prolonged parasitic drain measurements via a 0.1 Ohm resister placed in series (via a fuse) with the battery negative lead and battery negative post.
parasitic volt drop resistor.jpg
Volt Drop Method
Whilst the current clamp method remains an accurate and rapid non-intrusive test (see links below)
prolonged measurements in excess of 12 hours can become challenging at best. (Clamp internal battery and thermal drift spring to mind)
https://www.picoauto.com/library/automo ... tic-drain/
https://www.picoauto.com/library/traini ... in-testing

Measuring the volt drop across the resister and dividing this voltage value by 0.1 we can display current using a Math Channel
A DIVIDED BY 0.1.jpg
A/0.1
Whilst this method is intrusive, we free ourselves from all the limitations presented when using a current clamp over prolonged measurements.

It is vital to insert the resister at precisely the correct time during the shutdown period of the vehicle whilst maintaining contact between the battery negative terminal and negative lead. Momentary disconnection of the battery negative lead (to insert the resister) will most probably shutdown the device we are attempting to diagnose.

Be aware of current flow through the 0.1 ohm resister should a device wake up or activate during your measurement. Ensure your resister has a wattage rating sufficient to carry a specified amount of current to allow for such events. A 0.1 ohm resister rated at 50 watts should carry 4 amps comfortably if mounted in a heat sink. (Watts = Volts x Amps) 50 W / 12.6 V = 3.96 A

For such parasitic drain (4 amps) a current clamp will be far superior, however if this 4 amp discharge only occurs after 12 hours, then the resister method is perfect, safe in the knowledge it will carry 4 A comfortably. If all else fails, your inline fuse will act as a “fail-safe.”

Given the small voltage levels concerned, filtering will be essential. Most certainly bandwidth limit (4425 and 4225) accompanied with low pass filtering (1 kHz minimum)
https://www.picoauto.com/library/training/filtering

Here is a great example of the resister volt drop method capturing parasitic drain over long time periods.
The math channel confirms a component waking up every 15 minutes for approximately 2 minutes 16 seconds. Total test time, 13 hours and 16 seconds with no concerns surround current clamp battery failure or thermal drift
OVER NIGHT TEST.jpg
Over night test
For increased accuracy you could modify your math channel to allow for the resistance of the inline fuse too (Food for thought)
Volvo_XC60_2018_Diesel_20180928-0001.psdata
Math psdata file
(1.84 MiB) Downloaded 62 times
Volvo_V70_2008_Diesel_battery test overnight.psdata
Overnight test
(1.22 MiB) Downloaded 63 times
I hope this helps, take care……Steve

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

Re: Maths is cool

Post by Steve Smith » Fri Oct 05, 2018 12:56 pm

Following on from the following case study that tripped me over numerous times
https://www.picoauto.com/library/case-s ... -operation
I thought this would be a good place to revisit graphing road speed via the ABS speed sensor signal.

Using a math channel to calculate road speed from an ABS wheel speed signal could be very useful in the future for those faced with such diagnosis or those who wish to qualify vehicle speeds against serial data.

Using a tyre size of 215 x 45 17 and an ABS pole/tooth count of 48 we require:
• Number of teeth or pole count at the ABS pick up ring. (Physical count = 48)
• Tyre circumference. = Diameter (0.625 meters) x π (3.14)
• The number of wheel/tyre revolutions in one minute. 60/48 poles x signal frequency = RPM
The formula for wheel speed in mph is written:
Wheel/Tyre Speed (Frequency Hz x 60 = RPM) x Tyre Circumference (Meters) = Meters per minute
Meters per minute x 60 = Meters per hour
Meters per minute / 1000 = Kilometres per hour
Kilometres per hour x 0.621371 = Miles per hour

Math channel formula required to calculate mph from the wheel speed signal on channel B:
60/48*freq(B)*(3.14 * 0.625)*60/1000*0.621371

To create a mph math channel for the wheel speed signal on channel B, open the Math Channel Wizard by clicking on Tools > Math Channels > Create > Next > Advanced > and type in the formula above. Follow the Math Channel Wizard to completion by selecting a colour, measurement unit (mph) and range for your math channel. To help with recognition of your created math channel, select a matching colour for the channel input to be graphed. (E.g. Channel A frequency math channel Blue, Channel B frequency math channel Red etc.)

The image below highlights the math channel formula entry procedure
MATH FORMULA.jpg
Formula entry
Should you require KM/H as your desired unit for road speed, assuming your ABS signal is on channel A, your ABS pick up has 48 teeth and a tyre size of 215 x 45 17 the formula would read as follows:
60/48*freq(A)*(3.14*0.625)*60/1000

The psdata file below has the maths channels for MPH in red and blue whilst KM/H can be seen in the magenta channel
ABS TO ROAD SPEED.psdata
ABS TO ROAD SPEED
(2.69 MiB) Downloaded 17 times
Using the psdata files in these posts you can import the math channels into your own library for later use and editing accordingly.
Highlight the "Loaded" math channel and click on "Duplicate". The "Loaded" math channel will now appear in your math channel "Library" See the image below:
DUPLICATE MATH .jpg
Duplicate maths
PS. I have edited the math channel within the psdata file to correct the entry of the MPH and KM/H formula. If you have downloaded the above psdata file before 09/11/18 please either download again or edit the math channel as written in the descriptions above

I hope this helps, take care…….Steve
Last edited by Steve Smith on Fri Nov 09, 2018 3:28 pm, edited 2 times in total.

Steve J
Newbie
Posts: 5
Joined: Fri Aug 17, 2018 9:19 pm

Re: Maths is cool

Post by Steve J » Sat Oct 06, 2018 11:07 am

I love this type of posts and are absorbing this stuff like a sponge. So please keep it up even if there are not much feedback from the readers on this one.

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

Re: Maths is cool

Post by Steve Smith » Mon Oct 22, 2018 6:10 am

There are times when I could kick myself for not obtaining the crank sensor signal during a typical engine capture! Whilst we may not be looking for a crank sensor related fault, it just helps to graph engine speed
(https://www.picoauto.com/support/topic11511.html) during waveform analysis to determine if the engine/vehicle was accelerating or decelerating etc.

We can however use other inputs to determine rpm and here is a typical example using an ignition trigger signal (IGT) from number 1 Coil-On-Plug unit

Below we have the WPS500 pressure transducer connected to the coolant expansion bottle in order to detect a change in pressure attributed to water pump impellor activity. (Confirming water pump impellor is actually rotating)
Initial capture 2.jpg
Initial capture
Whilst the above capture appears cluttered, we can use a number of software features to improve the view of the data required.

1. Right click on screen and hide Channel B (Ignition coil secondary voltage) as not required
2. Close the Notes and Channel Labels to increase the size of our scope grid
3. Click on the input ranges (V, Bar etc.) and slide each waveform to a chosen position
4. Use the Channel Option button to apply a “Low Pass” filter to any noisy channel
(Channel A below has an 8 kHz low pass filter applied)
Cleaned capture 2.jpg
Modified capture
Now for the maths.

To obtain engine rpm from the IGT signal (Channel A) we need to know the number of cylinder 1 IGT events per engine revolution.

Given the number 1 IGT signal is present once every 2 rotations of the crankshaft we represent this as:
1 (IGT event) / 2 (Engine revolutions) = 0.5

We now need to convert “cycles per second” (Hz) to “cycles per minute” (RPM)

One to remember here: Frequency (Hz) x 60 = RPM and likewise RPM / 60 = Frequency (Hz)

So how does this all fit together into a math channel?

The formula required to obtain engine rpm from channel A is written
60/0.5*freq(A) and can be seen written below in the math channel equation box.
Math channel rpm formula.jpg
Math channel wizard equation box
Here we now graph engine speed from 678 rpm through to a maximum of 5808 rpm
Engine RPM .jpg
Engine rpm
Now we have engine speed, if we know the relationship between the crankshaft and water pump pulleys we can obtain water pump speed!

Example:
Crankshaft pulley 175 mm
Water pump pulley 145 mm
Using the formula “Driven / Driver”
145 mm (Water pump pulley) / 175 mm (Crankshaft pulley) = 0.83:1
0.83 rotations of the crankshaft to 1 rotation of the water pump

Example:
Engine at 1000 rpm / 0.83 = Water pump 1204 rpm
We can now create another math channel in order to graph the water pump speed
The formula is exactly the same as engine speed but now we include the water pump speed ratio
60/0.5/0.83*freq(A)
Water pump speed.jpg
Water pump speed
I have included the psdata file below with the relevant math channels. Remember to low pass filter Channel A to 8 kHz and to view channel B, “right click” on screen and select Channel B
TEST 8 IGT IGN WATER PUMP.psdata
Test 8 Psdata file
(2.14 MiB) Downloaded 29 times
Food for thought here, an injector signal could also be used to graph rpm but remember during overrun the injector signal will be cut and so no data will exist for the math channel calculation.

With direct injection vehicles we have the added complexities of variable injection strategies too. Either during the induction or compression events and often during the same waveform time span.

I hope this help, take care…….Steve

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

Re: Maths is cool

Post by Steve Smith » Fri Oct 26, 2018 12:11 pm

The "Invert" option is already a “Built-In” math channel that allows you to invert channel A or B should it be necessary for improved analysis.
Built In.jpg
Invert-Built In
Built In.jpg (42.26 KiB) Viewed 1263 times
This is fine if the channel you wish to invert is Channel A or B, but what about Channel C or D?

Here’s a typical example where I have the current clamp (Channel C) installed in the wrong orientation for the current flow! (How often does that happen?)
I know it’s a 50/50 guess but for some reason, 90% of the time I have the current clamp the wrong way round!
Incorrect flow.jpg
Incorrect current clamp orientation
Placing the minus symbol (-) in front of any channel letter will invert the relevant channel
Using the formula –(C) we can invert channel C to read the current in the correct “positive” direction
-C.jpg
Invert formula
Here is the math channel –(C) now with the current flow displayed in the correct orientation
Math channel applied.jpg
Math channel applied
Whist the formula is straight forward, it can be applied within other formulas to reverse the value.

Negative duty cycle is a typical example where the formula “duty(B)” would present the positive duty cycle of the signal on channel B but “duty(-B)” reveals the more typical negative duty for our applications. The forum post below has negative duty covered
https://www.picoauto.com/support/topic10051.html

Below you can import a number of negative duty cycle math channels
https://www.picoauto.com/support/post53131.html#p53131

I hope this helps, take care…….Steve

liviu2004
TwoWaves
TwoWaves
Posts: 122
Joined: Sat Mar 19, 2016 8:23 am
Location: Netherlands

Re: Maths is cool

Post by liviu2004 » Fri Oct 26, 2018 2:22 pm

Can I ask, how to connect to expansion tank?

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

Re: Maths is cool

Post by Steve Smith » Mon Oct 29, 2018 8:38 am

Hello and thank you for the post.

The WPS was connected via the Sykes quick couple Adapter Kit B https://www.picoauto.com/products/press ... ptor-kit-b that will convert your compression hose (TA212) from Foster to the Sykes style coupler.

Below the Adapter Kit B connects the relevant coolant pressure testing cap supplied in the Sykes coolant pressure testing kit to the compression hose and then WPS
IMG_3429.JPG
Coolant application
Please be aware there is no pressure bleed off other than through the WPS bleed port.
If testing for "over-pressure" allow the excess pressure to bleed away naturally before disconnection or via the WPS bleed port/hose. There is alittle more informtaion here: https://www.picoauto.com/support/post70 ... ket#p70211

I hope this helps, take care......Steve

davidwag
Newbie
Posts: 4
Joined: Wed Feb 10, 2016 3:01 pm

Re: Maths is cool

Post by davidwag » Fri Nov 02, 2018 9:50 pm

Great post Steve.
The voltage drop across a resistor is exactly the same way as an ECU uses to monitor current flow in a circuit.
The 50 watt resistor is probably a bit over spec as you are not going to see 12.6 volts drop across it unless you short it across the battery. At 4 Amps it will be more like 0.4V (V = 4A x 0.1 Ohms), so will dissipate about 1.6 W. A 50W resistor should be good for about 22 Amps.

I have attached a photo of the circuit from a parking brake controller showing the 0.1 ohm resistors they use when monitoring motor current (5-10 Amps?).

Cheers

David
Attachments
IMG_1286_LI.jpg

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

Re: Maths is cool

Post by Steve Smith » Sat Nov 03, 2018 9:37 am

Thank you for the feedback and insight too, it all helps to bring theory to life.

This next post looks at cylinder pressure compensation

Until the arrival of the pressure transducer, peak cylinder pressure was our primary concern when measuring engine compression.

With the WPS500x on the scene we are introduced to superior cylinder pressure analysis in the form of positive/negative cylinder pressures, valve open/close events and valve duration to name but a few.

What soon becomes apparent is the discrepancy between peak cylinder pressures when measured by a traditional compression gauge, compared to the WPS pressure transducer
The following forum post has this covered topic16131.html

The internal volume of our pressure sensor (sensor volume) must be considered and compensated for if we require an accurate peak cylinder compression values using the pressure transducer

Therefore I wanted to revisit the maths involved regarding “Compensation” when measuring peak cylinder pressure with a pressure transducer using PicoScope (Not Pico Diagnostics)

Here is another occasion where our users are right and my theory was wrong. (Not for the first time either)
I have (in the past) incorrectly assumed our pressure transducer to have an internal volume of 5 ml, but thanks to PicoKev, Volrem and others, the internal volume of the pressure transducer alone is approx. 1.22 mL

If we then add our compression hose to the pressure transducer (with an approximate internal volume of 2 mL) we have total of approx. 3.22 mL.

Add to this the internal volume of a compression hose adapter (for spark plug replication) and we have an average of 5 mL to cover the internal volume of the transducer, compression hose and spark plug adapter.

This is a “one size fits all” sensor volume measurement for petrol engine compression testing
Remember this will increase dramatically when we add a dummy glow plug (diesel compression testing) which can vary in size and so volume.

Basically what I am trying to say here is:
For petrol engine peak compression measurements via the pressure transducer use 5 mL as your sensor volume value when applying the relevant math channel

For diesel engine peak compression measurements via the pressure transducer use 5 mL + the volume of your dummy glow plug as your sensor volume value when applying the relevant math channel

To quote now from forum post topic16131.html here is the maths:
When using PicoScope 6 Automotive software, to measure peak cylinder pressure with a pressure transducer coupled to a compression hose (internal volume 5 mL) we need to calculate a multiplication factor based upon the cylinder volume, compression ratio and sensor volume value.

Here we have a Vauxhall Astra Diesel, 1.7 Litre, 4 cylinder engine with a compression ratio of 18:1 using a sensor volume value of 7 ml (Transducer and compression hose 5 mL + 2 mL for our dummy glow plug)
Compensation formula required when using the WPS500x Pressure Transducer to measure peak cylinder pressure with PicoScope 6 Automotive software:

Cylinder displacement / (Compression Ratio -1) = Combustion chamber volume
Combustion chamber volume + Sensor volume value / Combustion chamber volume = Multiplication Factor
The Multiplication factor is then used to multiply the pressure results obtained by WPS500x

4 Cylinder engine displacement 1686 cc Compression ratio 18:1
1686 / 4 = 421.50 cc Displacement per cylinder
421.50 cc / (18 -1) = 24.79 cc Combustion chamber volume
24.79 cc + 7 mL / 24.79 cc = 1.28
1.28 is the Multiplication factor required to correct peak cylinder pressure.

Multiplication factor x Obtained pressure = Correct peak cylinder pressure allowing for the internal volume of the Pressure Transducer, compression hose and dummy glow plug.

Math Channel for WPS cylinder pressure captured on channel B
Pressure x Multiplication factor = B X 1.28
MATH CHANNEL.jpg
Compensation formula
Here we now have the corrected peak cylinder pressure value.
PS WITH MATH CHANNEL.jpg
Compensation math channel
Be aware that temperature will also affect our compensation values and so temperature can be incorporated into alternative formulas if required
Example waveform.psdata
Compensation psdata file
(1.7 MiB) Downloaded 8 times
Given the maximum operating pressure of the WPS500x is 34.5 bar (500 psi) there may be times when diesel engine cylinder pressure will exceed this value. (Especially if the injector remains connected during the compression test!)

Whilst the following is not applicable to all engines, we could take advantage of pressure transducers that are integrated into glow plugs.
GLOW PLUG-PRESSURE SENSOR.jpg
Glow plug image
Now we can measure peak cylinder pressure with combustion across all engine speeds and loads without intrusion and without increasing the volume of the combustion chamber

The following formula applies to the pressure transducer incorporated into the glow plug of a current VAG TDI engine

With thanks to VAG regarding an approximation of the specifications for this sensor, we can create a math channel that converts the measured voltage from the glow plug (pressure transducer) into a pressure value (bar)

The formula required:
Pressure = (Sensor Measured Voltage – Nominal Sensor Voltage) / Sensor Incline or slope

Sensor measured voltage = Voltage output from sensor in proportion to cylinder pressure
Nominal sensor voltage = Voltage output from sensor at ignition on engine off (0 bar) Approx. 0.575 V
Sensor incline or slope refers to the characteristic output of the sensor across its entire operation range (0-210 bar) in response to cylinder pressure (1 V = Approx. 55.555 bar)

Think of this value as similar to a current clamp with a specified characteristic output of 1 mV/A. For every mV output of the current clamp the scope display reads 1 A, therefore a 1 V output from the clamp (1000 mA) the scope display reads 1000 A

Be aware, the sensor incline (or slope) is a rounded approximation which is dependent upon the pressure sensor supply voltage (Ratiometric). Here we assume the sensor is supplied with 5 V but in the real world this could deviate from 4.8 V to 5.2 V etc. and this most certainly impacts upon the behaviour of the pressure sensor across its operating range. Consider the pressure values obtained from your math channel as relative cylinder pressure.

The math channel (assuming your glow plug pressure sensor is connected to channel A) is (A-0.575)/55.555
PRESSURE MATH FORMULA.jpg
Pressure formula
The waveform below highlights the dramatic increase in cylinder pressure under acceleration of the engine. This certainly brings home the “events” taking place inside the cylinder during combustion and reveals the stresses these engine are placed under during a typical driving cycle
PRESSURE DISPLAY.jpg
Glow plug pressure
Please be aware of the limitations of the glow plug pressure sensor at low engine speeds/pressures given the sensor is designed to measure pressure up to 210 bar. The resolution is also questionable but certainly invaluable for an insight into combustion events across the entire engine speed/load range.
HIGH LOW SPEEDS.jpg
High low speeds
The psdata file below contains the relevant math channel along with cylinders 2 and 4 pressure waveforms. These can be revealed by right clicking on screen and selecting “Channels”
AUDI A4 TDI GLOW-PRESSURE.psdata
Glow plug pressure psdata file
(3.16 MiB) Downloaded 23 times
I hope this helps take care…….Steve

Post Reply