Jump to content
  • 0

Convert time between falling edges to RPM math channel?


qwertylex

Question

As in the attached screenshot, the falling edge to falling edge time is 84.31663Hz which would be a data point of 5,058.996 RPM
is there a way to use the math channel to convert this to an RPM graph?
I've also attached an acquisition example.
Thanks!

Screen Shot 2024-05-08 at 1.56.48 PM.png

test1.dwf3scopeacq

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @qwertylex

You can use a custom Math in Scope where the RPM value is for the previous pulse.
You can also use Logic Analyzer Custom interpreter to show the value of each pulse.

image.png

image.png

var f = C1>1.5;
if(prev==false && f==true){
    last = sum;
    sum = 0;
}
sum++;
prev = f;
return Rate/last*3600;

image.png

image.png

// rgData: input, raw digital data array
// rgValue: output, decoded data array
// rgFlag: output, decoded flag array

var c = rgData.length;
var prev = 1;
var idx = 0;
var sum = 0;

for(var i = 0; i < c; i++){
    var f = rgData[i]&1;
    if(prev==0 && f==1){
        for(var j = idx; j < i; j++){
            rgValue[j] = hzRate/sum*3600;
            rgFlag[j] = 1;
        }
        idx = i;
        sum = 0;
    }
    prev = f;
    sum++;
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...