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

Maths is cool

Post by Steve Smith »

Following on from forum post topic17181.html
I wanted to begin a new post on the power of maths using PicoScope 7 Automotive software

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
Maths is cool
For information how to access the math channel menu/wizard the following link will help viewtopic.php?p=100244#p100244 where we discuss the creation of a Negative duty math channel
A video on the above process can also be seen here download/file.php?id=32851

With regards to the application of math channels:

1. Ensure you have enough samples on screen. (Ideally, 1 million samples minimum)
1 MS Minimum
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) Note: All displayed measurements are taken between the time rulers.
Resistance
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
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
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
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
Maths is cool
(6.72 MiB) Downloaded 113 times
A word to the wise regarding the above math channel calculations; there is no accounting for losses and what we have acquired is a theoretical conversion using voltage and current based on 100% motor efficiency (which could never be)

Considerations must be given to thermal, electrical and mechanical losses of which additional functions could be added to our math channel formulas to derive a more "real-world" result.


I hope this helps, take care……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 »

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.
Volt Drop Method
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/0.1
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 22.5 Amps maximum if mounted in a heat sink.

For example: 2.25 V drop measured across our 0.1-ohm resister
(Volts x Resistance = Amps)
2.25 V / 0.1-ohm = 22.5 A
(Volts x Amps = Watts)
2.25 V drop x 22.5 A = 50.63 Watts

For such parasitic drain (22.5 Amps) a current clamp will be far superior, however if this 22.5 Amp discharge only occurs after 12 hours, then the resister method is perfect, safe in the knowledge it will carry 22.5 A maximum. 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 / 4225 & 4425A / 4225A) accompanied with low pass filtering (1 kHz minimum)
Refer to 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 6 minutes with no concerns surrounding current clamp battery failure or thermal drift
Overnight
Overnight
For increased accuracy you could modify your math channel to allow for the resistance of the inline fuse too (Food for thought)

Please find below the captures from above
Volt drop.psdata
Volt drop method
(1.85 MiB) Downloaded 116 times
Volvo_V70_2008_Diesel_battery test overnight.psdata
Overnight test
(1.22 MiB) Downloaded 110 times
I hope this helps, take care……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 »

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 math channel, refer to the following forum post here viewtopic.php?p=100244#p100244

The image below highlights the math channel entry procedure (described in the link above) for graphing mph from the ABS wheel speed signal
1
1
Below we have the completed math channels for channel A & B in mph
2
2
Should you require kph 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 (See magenta waveform above)

The psdata file below has the maths channels for mph in red and blue whilst kph can be seen in the magenta channel
ABS TO ROAD SPEED AUTO.psdata
(2.7 MiB) Downloaded 99 times
Using the psdata files in these posts, you can import the math channels into your own math channel library for later use and editing accordingly.

Simply download the above psdata file, click on the relevant math channel lozenge to reveal the math channel dialog box

Tick on the applicable “loaded from file” math channel and the “Save” box to move the loaded math channel to your math channel library (See below)
3
3
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: 9
Joined: Fri Aug 17, 2018 9:19 pm

Re: Maths is cool

Post by Steve J »

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: 1581
Joined: Sun Aug 25, 2013 7:22 am

Re: Maths is cool

Post by Steve Smith »

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
(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)
1
1
Whilst the above capture appears cluttered, we can use a number of software features to improve the view of the data required.

• Click on Views (1) and hide Channel B (Ignition coil secondary voltage) as not required
• Close the Notes and Channel Labels to increase the size of our scope view
• Click on the input scales (V, Bar etc.) and slide each waveform to a chosen position
2
2

Click on a Channel lozenge to apply a “Low Pass” filter (DSP) to any noisy channel
(Channel A below has an 8 kHz low pass filter applied)

3
3

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 dialog box.
4
4
Here we now graph engine speed from 670 rpm through to a maximum of 5810 rpm
5
5
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)
6
6
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, click on "Views" and select Channel B
TEST 8 IGT IGN WATER PUMP V2.psdata
psdata file
(2.15 MiB) Downloaded 91 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: 1581
Joined: Sun Aug 25, 2013 7:22 am

Re: Maths is cool

Post by Steve Smith »

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
1
1
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!
2
2
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 display the current in the correct “positive” orientation
3
3
Here is the math channel "–C" with the current flow now displayed in the correct orientation
Note channel B has been hidden from view to reduce crowding within the graph view
4
4
Please note, we now have an “Invert” feature for every active channel under the channel lozenge.

Below we use this “Invert” feature for channel C which resides in the Channel Options panel
5
5
Note above how the original waveform captured on channel C has been inverted and the math channel (-C) is now upside down! This is expected behaviour as the math channel simply inverts the data displayed on channel C

Whist the invert math formula is straight forward, it can be applied to other math channel 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; however, “duty(-B)” reveals the typical negative duty found in auto applications.

More on math channels in PS7 can be found here viewtopic.php?p=100694#p100694

I hope this helps, take care…….Steve

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

Re: Maths is cool

Post by liviu2004 »

Can I ask, how to connect to expansion tank?

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.

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
Coolant application
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 »

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: 1581
Joined: Sun Aug 25, 2013 7:22 am

Re: Maths is cool

Post by Steve Smith »

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
Compensation formula
Compensation formula
Here we now have the corrected peak cylinder pressure value.
Compensation math channel
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 1499 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 image
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 formula
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
Glow plug pressure
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
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 1899 times
I hope this helps take care…….Steve

Post Reply