From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove drift function

Hello, 

 

I'm working with a Diadem for the first time.

 

I have problem with remove drift function. I don´t know where I find function drift. I need speed give to back to zero. 

 

Could you give me an advice please ?

 

Lukas_MIS_0-1651585193063.png

 

 

0 Kudos
Message 1 of 11
(2,328 Views)

Hi Lukas_MIS,

 

The function for this is “Detrend” and is based on the linear regression.

 

Walter_Rick_0-1651751301325.png

 

 

Greetings

Walter

Message 2 of 11
(2,274 Views)

Hello Walter_Rick,

 

Many thanks for your advice,

 

I tried these function, but still it´s same. Could you give me an advice please ?

 

Below you can see the picture where the graph is before I integrate the signal into the speed. If you want these data send so I have file .DTM

 

Lukas_MIS_1-1652188843604.png

 

Thank you very much for your answer.

 

Lukas_MIS

 

 

0 Kudos
Message 3 of 11
(2,248 Views)

Hi Lukas_MIS,

 

In DIAdem we have implemented a detrending function which is based on the linear regression function. The example “Detrending an Oscillation Signal” shows how it is working.

This function is well suitable for more or less linear trends.

Your signal seems to have two different trend directions. It can be that DIAdem detrend function is not the best for your type of signal.

 

Greetings

Walter

Message 4 of 11
(2,229 Views)

Hello Walter_Rick

 

Thank you for your answer. 

 

Could you please help with my problem and advise how to proceed ? Would it help to create a script ?

 

Thank you very much for your answer.

 

Lukas_MIS

 

 

0 Kudos
Message 5 of 11
(2,207 Views)

Hello Lukas_MIS,

 

Yes, I can try to help. First we need some realistic data and must know what is the expected signal. Then we can try to find an algorithm to eliminate the trend. And finally we define a script for it.

 

Greetings

Walter

Message 6 of 11
(2,196 Views)

Hello Walter_Rick,

 

OK, super many thanks. Realistic data are in attachment.  I need integrate signal from acceleration to speed. I used filter 300

 

Expected signal: I need get signal back to zero. 

 

Lukas_MIS_0-1652812186314.png

 

Greetings

 

Lukas_MIS

0 Kudos
Message 7 of 11
(2,182 Views)

Hello Lukas_MIS,

 

Finding an algorithm which fits quiet well can be time-consuming and very complex. In general, you need a function which follows the original curve well but without too much peaks. This curve must then be subtracted from the original curve.

I think a good compromise can be the approximation function with these parameters:

 

Walter_Rick_0-1652873843907.png

 

 

The subtraction result is then:

 

Walter_Rick_1-1652873843909.png

 

 

Comparing the result and original curve looks like this:

 

Walter_Rick_2-1652873843912.png

 

This is just a suggestion for this curve and other curves may need other functions.

Here is the script code.

dim iLoop
for iLoop = 1 to 26
  ApprAnsatzFct(iLoop) = "-"
next
ApprAnsatzFct(2) = "Yes"
ApprAnsatzFct(6) = "Yes"
ApprAnsatzFct(7) = "Yes"
ApprAnsatzFct(8) = "Yes"
ApprAnsatzFct(9) = "Yes"
ApprAnsatzFct(10) = "Yes"
call ChnApprXYCalc("", "[1]/Integrated", "", "/ApproximatedY", "Partition complete area", 2501, 1)
call = ChnSub("[1]/Integrated", "[1]/ApproximatedY", "/Subtracted1")

 

Greetings

Walter

 

Message 8 of 11
(2,160 Views)

Hello Walter_Rick

 

Many thanks for your answer. This look fantastick.

 

I need your support because I have still problem with settings. I use same curve and I used same settings as you and it's writing me this message.

 

Can you please advise me where i am making a mistake ?

 

Lukas_MIS_0-1653316542957.png

 

Many thanks,

 

Lukas_MIS

 

0 Kudos
Message 9 of 11
(2,140 Views)

Hi Lukas_MIS,

 

You are calculation quantity based, which is in general good, because DIAdem handles in the background the correct calculation regarding the physical units. But for this it is necessary to have correct SI units which your dataset doesn’t have.

For this you need to change two things. The unit for gravity (in your case “g”) is for SI “m/s^2”. In addition, your waveform channels have no time parameters. As an example I added the name  “Time”, the unit “ms” and the step width “1” for your input channels.

Then I recalculated everything.

 

Walter_Rick_0-1653371609262.pngWalter_Rick_1-1653371621308.png

 

Greetings

Walter

Message 10 of 11
(2,113 Views)