Tool/software: Code Composer Studio
Hi,
I am trying to use the mmWave demo for fluid level sensing of two liquids in a tank. For example, If I have water and oil inside of a tank, I want to detect only the levels of the two liquids. I am trying to search through the data output of the mmWave demo and find the top two distances with the highest relative power. However, I want to make sure that I am picking up the two distances of the liquids, and not the side of the tank. Here is the code I am using to search for the top two distances.
struct TopDistances {
uint16_t TopDistance1;
uint16_t TopDistance2;
uint16_t DistanceIndex1;
uint16_t DistanceIndex2;
};
struct TopDistances GetTopTwoDistances(MmwDemo_DataPathObj *obj) {
int i,j, Dist1Index, Dist2Index;
int16_t temp1, temp2, Top1, Top2;
struct TopDistances TopDist;
TopDist.TopDistance1 = 0;
TopDist.TopDistance2 = 0;
Top1 = 0;
Top2 = 0;
Dist1Index = 0;
Dist2Index = 0;
//Find first object with greatest relative power
for(i = 0; i <= obj->numObjOut ; i++) {
temp1 = obj->objOut[i].peakVal;
if(temp1 > Top1) {
Top1 = temp1;
Dist1Index = i;
}
}
TopDist.DistanceIndex1 = Dist1Index;
//Set top distance 1
TopDist.TopDistance1 = obj->objOut[Dist1Index].rangeIdx;
//Find second object with greatest relative power
for(j = 0; j <= obj->numObjOut ; j++) {
temp2 = obj->objOut[i].peakVal;
if((temp2 > Top2) && (temp2 != Top1)) {
Top2 = temp2;
Dist2Index = j;
}
}
TopDist.DistanceIndex2 = Dist2Index;
//Set top distance 2
TopDist.TopDistance2 = obj->objOut[Dist2Index].rangeIdx;
return TopDist;
}
These are my Questions:
Would finding the two distances with the highest relative power correspond to the two liquids? Is peakVal the relative power of the object? If not, what is it?
How can I make sure I don't pick up the sides of the tank when searching for the liquid levels? I just want the sensor to look straight down into the tank. Would I need to configure the antennas for this, or set certain parameters in the command line?
Thanks & Regards,
Kyle