DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

diadem functions

Hi

I work on data receive from many sensor during work internal combustion engine, I will try explain you everything, i thing it is the best way to help me. In attachments i have piece of my data where:

 

1)CYCLE CHANNEL

In 1 channel I have data from sensor which show one moment during rotate crankshaft when is beginning  new cycle ( sensor are very  quickly so in my data beginning of cycle isn’t one line of data but estimated 10 line, but I was change this channel to good-looking and I have in this channel many “0” and when is firs line which show beginning new cycle is “ 1”  ( one cycle it is two revolution=720 degrees)

 

2)channel which data who will use to axle X on graph

This is my second channel, I have the data from sensor who measure change angle of revolution (rotate) crankshaft, sensor  react to rotate every 0,5 degree and it change data for every next 0,5 degree. For every 0,5 degree I have few line of data (sometimes 3 sometimes even 6), I was try make this channel good loking and now in this chanell data are like this: 0 , 0, 0, 0, 0.5 , 0.5, 0.5, 0.5, 0 , 0…., every change in this data means next 0,5 degree. I want summation this data, but it is not finish.for expmple: Between 0,5 and 1 degree I have few line of data(data with pressure), I want calculate average for every   range (bracket) and have average data for 0,75 degree, 2examploe for range 12-12,5 i want have average form data with pressure for value on axle X=12,25 degree

 

3)channel which data who will use to axle Y on graph

I have two channels(channel A and channel B) which I must take together and calculation real pressure in cylinder in internal combustion engine. I must calculated difference between channel A and B (channel A –channel B) in moment when is star new cycle (data in channel 1 =1) and this difference is important for all this cycle. For all this cycle I must calculate function= (channel B +difference value). In next cycle difference value is  other. To make this thing I have  idea: first i will want use  function iff(chanel1=1, chennelA – channelB, 0) next I want make channel witch summation differences value for every cycle separated (i dont have idea how i can do it) and this way I will have in all chanell differences value who i need to calculate last function = (channel B +difference value). This way I will have real pressure but next I must calculate average for every 0,5 degree angle of revolution (rotate) crankshaft and it will be dato to axle Y on graph

 

All cycles I must have on one graph (many curve on one graph)

Axle X- angle of revolution (rotate) crankshaft

Axle Y- real pressure in cylinder

 

From this data I want calculate average pressure in cylinder ( one curve on graph) and calculate deviation ( in my language it is call standard deviation, I hope you will understand what I mean)

And this is estimate 30% of my work but if I will can do this, next things will be no hard for me

I give in attachment piece of my data . I don’t know how much you can help me, but for any help I will be grateful. if you will write to me what function shoul use and what this functions have parameters i will be grateful. the most helpful will be scripts, but I think this is too much work for you but please help me how you can. it is my first work in diadem and i think beginning is always hard but i hope that with your help it will be easier ( sorry for my English, I hope you understand everything)

0 Kudos
Message 1 of 18
(5,662 Views)

Hi elwis,

 

What is your native language?

 

Brad

0 Kudos
Message 2 of 18
(5,636 Views)
my native language is polish
0 Kudos
Message 3 of 18
(5,624 Views)
my work all time going ahead but i have one big problem i dont know how i can one chanel separeted to many cycle (every cycle can have les or more line of data) but other chanell show when new cycle is started. i have estimated 150 cycle so how i can make it automaticly.
0 Kudos
Message 4 of 18
(5,616 Views)
i want to close this topic because i solved most of this problems myslef
0 Kudos
Message 5 of 18
(5,600 Views)

Hi elwis,

 

I think I have understood how you need to process your cycle data.  I have attached below an example application that does the following:

 

1)  Resolves the duplicate angle rows into one representative row for all the channels

2)  Sums the Cycle and Angle channels to obtain the cumulative values (instead of differential values)

3)  Calculates the (ChannelA - ChannelB) value at the exact start of each cycle

4)  Adds the (ChannelA - ChannelB) value from each cycle start to the all ChannelB values from that cycle

5)  Currently leaves all the resulting channels in 1 Group-- not broken out the cycles into separate Groups

 

Let me know what you think,

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 6 of 18
(5,564 Views)

you are realy close to understand everything, you  make  some mistakes like:

- you can not sumation chanel "angel"in this way, you dont understand one thing, in this channel value is not important , importanty is only change of value, when value is changing from 0 to 0,5 it is mean that i have next 0,5 deegres, when in some cell i have 0,5 and in the next  cell (next line) i have 0,5 is not change so i have still the same deegres(the same angle), and it was problem because i want calculate average of preasure (channelB) for the same value of deegree.

- sum in chanell angel cant be more than 720, one cycle is only 720 degres

-i make some change in calculation , now i dont care about channel A, i was thinking about this and i know one thing, in my result of preassure i cant have values less than 0 (<0) because next i will want calculate integral and derivative of this curve, so i add to all chanelB minimum of this channel

 

- in attachments i have my work, i didnt know how use fuction like "FOR i = 1 TO ChnLength(1),......."so i make this very slowly and i must created many new chanells. (now i understand a litlle bit this function, i was analyzed your script)

in my work i have still few problems:

1. on graph i dont have curve but only many points because in many line of data i have novalues

2. i dont know how i can from many cycle calculate on average cykle, 

3. when i will have average curve i must calculate  derivative of this function (f(x)-my average curve, f ' (x)- derivative), so i must calculated d(pressure)/d(angle)
Message 7 of 18
(5,541 Views)
in attachments is my work, in this example is 2 small mistakes, value on axis X and axis Y should be >0, so i want to chanel "axisX"+min of "axisX", and to channel "axisY" add min of channel "axisY", in this way i will have only value > 0.now i dont know how i can from many cycle calculate one average cykle, second attachments show how look graph for all data
Download All
0 Kudos
Message 8 of 18
(5,532 Views)
sorry to channel "axisX" i must subtract minimum of chanel "axis X", this way i will have on my graph on axis X range (0.........720)
0 Kudos
Message 9 of 18
(5,529 Views)
i have idea how i can make one average cycle. in my "example (elwis.zip)" when scipts will finish work i have 2 channels, first "axis X" and second "axis Y". i need function which will make next chanel for every cycle. every cycle (data from "axis Y") will be in other channel. when function will copy every cycle to every new channel they should copy only values (to omit cell where is "novalue"). New channels should have value in line (row) from line 1 to line 1440 because all cycle on axis X have 720 degres(angle) (0.25, 0.75, 1.25, 1,75 .....718.75, 719.25, 719.75 and in this way it will be 1440 lines). Next i can make result chanel where i will calculate average from all cycles (average values will be on graph on axis Y) it will be look that :

line number        angle        result chanel(average cycle)
1                       0,25        result value
2                       0,75        result value
3                       1,25        result value
.                          ....        ..........
.                          ....        ..........
1438                 718,75        result value
1439                 719,25        result value
1440                 719,75        result value
        the end 🙂

i dont have idea how write this function. let me know what you think about my idea, if you heve better idea let me know :). I am very grateful for your help 🙂
0 Kudos
Message 10 of 18
(5,493 Views)