AnsweredAssumed Answered

How to find local maximum & local Minimum for the Sensor X acceleration

Question asked by sakthivel kulandaivel on Mar 1, 2017
Latest reply on Mar 20, 2017 by sakthivel kulandaivel

Hi,

I'm Using the FXTH871xD TPMS Sensor for my development, Now I need to measure the X & Z acceleration and trying to find the X Acceleration Maximum and Minimum points to Send the RF Data.

But I'm not facing some algorithm implementation for finding Max & Min Points.

Wheel is rotating at 100RPM, XZ Acceleration "TPMS_READ_DYNAMIC_ACCEL_X" & "TPMS_READ_DYNAMIC_ACCEL_Z" Called every 100ms.

Please refer my source code for finding MAX & MIN.

 

if((u16AccelX_SearchVal > u16LocalMax))
{

if(u16AccelX_SearchVal != u16LocalMax)
{
if((u16AccelX_SearchVal - u16LocalMax) > 4)
{
Fill_RFBUFFER(0);
vfnSendRFDataRead();
}
u16LocalMin = u16AccelX_SearchVal;
u16LocalMax = u16AccelX_SearchVal;
}
}
else if((u16AccelX_SearchVal < u16LocalMax))
{
if(u16AccelX_SearchVal != u16LocalMin)
{
if((u16LocalMin - u16AccelX_SearchVal) > 4)
{
Fill_RFBUFFER(0);
vfnSendRFDataRead();
}
u16LocalMax = u16AccelX_SearchVal;
u16LocalMin = u16AccelX_SearchVal;
}
}
else
{
//do nothing
}

 

Please let me know if anything missed in my source and if any other way of algorithm use to find. 

Please anyone help me to resolve this problems 

 

Thanks,

Sakthivel K

Outcomes