|
|
@@ -36,10 +36,10 @@ static void show(uint8_t ch,int32_t ad)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void LEFTUP_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
void LEFTUP_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(abs(AD - App.LeftUpCS1237_TrendArray[0]) > 2000000)
|
|
|
|
// if(abs(AD - App.LeftUpCS1237_TrendArray[0]) > 2000000)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
AD = App.LeftUpCS1237_TrendArray[0];
|
|
|
|
// AD = App.LeftUpCS1237_TrendArray[0];
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
show(1,AD);
|
|
|
|
show(1,AD);
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -51,10 +51,10 @@ void LEFTUP_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
void LEFTLOW_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
void LEFTLOW_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if(abs(AD - App.LeftLowCS1237_TrendArray[0]) > 2000000)
|
|
|
|
// if(abs(AD - App.LeftLowCS1237_TrendArray[0]) > 2000000)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
AD = App.LeftLowCS1237_TrendArray[0];
|
|
|
|
// AD = App.LeftLowCS1237_TrendArray[0];
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
show(2,AD);
|
|
|
|
show(2,AD);
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -65,10 +65,10 @@ void LEFTLOW_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void RIGHTUP_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
void RIGHTUP_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(abs(AD - App.RightUpCS1237_TrendArray[0]) > 2000000)
|
|
|
|
// if(abs(AD - App.RightUpCS1237_TrendArray[0]) > 2000000)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
AD = App.RightUpCS1237_TrendArray[0];
|
|
|
|
// AD = App.RightUpCS1237_TrendArray[0];
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
show(3,AD);
|
|
|
|
show(3,AD);
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -79,10 +79,10 @@ void RIGHTUP_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void RIGHTLOW_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
void RIGHTLOW_CS1237AinADataProcessCallBack(int32_t AD)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(abs(AD - App.RightLowCS1237_TrendArray[0]) > 2000000)
|
|
|
|
// if(abs(AD - App.RightLowCS1237_TrendArray[0]) > 2000000)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
AD = App.RightLowCS1237_TrendArray[0];
|
|
|
|
// AD = App.RightLowCS1237_TrendArray[0];
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
show(4,AD);
|
|
|
|
show(4,AD);
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
for(int i = OSC_CNT-1; i > 0; i--)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -222,10 +222,10 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
|
|
|
|
|
|
|
|
int32_t LeftSlopeSum = abs(App.LeftUpCS1237_SlopeArray[0]) + abs(App.LeftLowCS1237_SlopeArray[0]);
|
|
|
|
int32_t LeftSlopeSum = abs(App.LeftUpCS1237_SlopeArray[0]) + abs(App.LeftLowCS1237_SlopeArray[0]);
|
|
|
|
int32_t RightSlopeSum = abs(App.RightUpCS1237_SlopeArray[0]) + abs(App.RightLowCS1237_SlopeArray[0]);
|
|
|
|
int32_t RightSlopeSum = abs(App.RightUpCS1237_SlopeArray[0]) + abs(App.RightLowCS1237_SlopeArray[0]);
|
|
|
|
int32_t LeftLowDiff = abs(Oll_diff1);
|
|
|
|
int32_t LeftDiff = abs(Oll_diff1) + abs(Olu_diff1);
|
|
|
|
int32_t RightLowDiff = abs(Orl_diff1);
|
|
|
|
int32_t RightDiff = abs(Orl_diff1) + abs(Oru_diff1);
|
|
|
|
int32_t LeftDiffSum = abs(lu_diff[0]);
|
|
|
|
int32_t LeftDiffSum = abs(lu_diff[0]) + abs(ll_diff[0]);
|
|
|
|
int32_t RightDiffSum = abs(ru_diff[0]);
|
|
|
|
int32_t RightDiffSum = abs(ru_diff[0]) + abs(rl_diff[0]);
|
|
|
|
|
|
|
|
|
|
|
|
if(App.EmeFlag == true)
|
|
|
|
if(App.EmeFlag == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -253,17 +253,33 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
App.LeftRunFalg = false;
|
|
|
|
App.LeftRunFalg = false;
|
|
|
|
App.RightRunFalg = false;
|
|
|
|
App.RightRunFalg = false;
|
|
|
|
App.CentreRunFalg = false;
|
|
|
|
App.CentreRunFalg = false;
|
|
|
|
if(((lu_ad[0] < App.ADTrack.LeftUp_Org_AdZero-1000)
|
|
|
|
if(((lu_ad[0] < App.ADTrack.LeftUp_Org_AdZero-CENTRE_VPT)//判断中间操作
|
|
|
|
&& (ll_ad[0] > App.ADTrack.LeftLow_Org_AdZero+1000)
|
|
|
|
&& (ll_ad[0] > App.ADTrack.LeftLow_Org_AdZero+CENTRE_VPT)
|
|
|
|
&& (ru_ad[0] < App.ADTrack.RightUp_Org_AdZero-1000)
|
|
|
|
&& (ru_ad[0] < App.ADTrack.RightUp_Org_AdZero-CENTRE_VPT)
|
|
|
|
&& (rl_ad[0] > App.ADTrack.RightLow_Org_AdZero+1000))
|
|
|
|
&& (rl_ad[0] > App.ADTrack.RightLow_Org_AdZero+CENTRE_VPT)
|
|
|
|
|| ((lu_ad[0] > App.ADTrack.LeftUp_Org_AdZero+1000)
|
|
|
|
&& (lu_ad[1] < App.ADTrack.LeftUp_Org_AdZero-CENTRE_VPT)
|
|
|
|
&& (ll_ad[0] < App.ADTrack.LeftLow_Org_AdZero-1000)
|
|
|
|
&& (ll_ad[1] > App.ADTrack.LeftLow_Org_AdZero+CENTRE_VPT)
|
|
|
|
&& (ru_ad[0] > App.ADTrack.RightUp_Org_AdZero+1000)
|
|
|
|
&& (ru_ad[1] < App.ADTrack.RightUp_Org_AdZero-CENTRE_VPT)
|
|
|
|
&& (rl_ad[0] < App.ADTrack.RightLow_Org_AdZero-1000)))
|
|
|
|
&& (rl_ad[1] > App.ADTrack.RightLow_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (lu_ad[2] < App.ADTrack.LeftUp_Org_AdZero-CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ll_ad[2] > App.ADTrack.LeftLow_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ru_ad[2] < App.ADTrack.RightUp_Org_AdZero-CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (rl_ad[2] > App.ADTrack.RightLow_Org_AdZero+CENTRE_VPT))
|
|
|
|
|
|
|
|
|| ((lu_ad[0] > App.ADTrack.LeftUp_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ll_ad[0] < App.ADTrack.LeftLow_Org_AdZero-CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ru_ad[0] > App.ADTrack.RightUp_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (rl_ad[0] < App.ADTrack.RightLow_Org_AdZero-CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (lu_ad[1] > App.ADTrack.LeftUp_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ll_ad[1] < App.ADTrack.LeftLow_Org_AdZero-CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ru_ad[1] > App.ADTrack.RightUp_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (rl_ad[1] < App.ADTrack.RightLow_Org_AdZero-CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (lu_ad[2] > App.ADTrack.LeftUp_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ll_ad[2] < App.ADTrack.LeftLow_Org_AdZero-CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (ru_ad[2] > App.ADTrack.RightUp_Org_AdZero+CENTRE_VPT)
|
|
|
|
|
|
|
|
&& (rl_ad[2] < App.ADTrack.RightLow_Org_AdZero-CENTRE_VPT)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
App.CentreRunFalg = true;
|
|
|
|
App.CentreRunFalg = true;
|
|
|
|
if(abs(Oll_diff1) > abs(Orl_diff1))
|
|
|
|
if(LeftDiff > RightDiff)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
App.LeftRunFalg = true;
|
|
|
|
App.LeftRunFalg = true;
|
|
|
|
if((Oll_diff1+Orl_diff1) < -(App.ADTrack.Stop_VPT))
|
|
|
|
if((Oll_diff1+Orl_diff1) < -(App.ADTrack.Stop_VPT))
|
|
|
@@ -285,7 +301,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
App.RunCollDelay1mSCnt = RUN_TIME_MS;
|
|
|
|
App.RunCollDelay1mSCnt = RUN_TIME_MS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(abs(Oll_diff1) < abs(Orl_diff1))
|
|
|
|
else if(RightDiff > LeftDiff)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
App.RightRunFalg = true;
|
|
|
|
App.RightRunFalg = true;
|
|
|
|
if((Oll_diff1+Orl_diff1) < -(App.ADTrack.Stop_VPT))
|
|
|
|
if((Oll_diff1+Orl_diff1) < -(App.ADTrack.Stop_VPT))
|
|
|
@@ -308,21 +324,27 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if((LeftSlopeSum > RightSlopeSum && LeftDiffSum > RightDiffSum))
|
|
|
|
else if((LeftSlopeSum > RightSlopeSum && LeftDiffSum > RightDiffSum))////判断左边操作
|
|
|
|
{
|
|
|
|
{
|
|
|
|
App.LeftRunFalg = true;
|
|
|
|
App.LeftRunFalg = true;
|
|
|
|
if(((App.LeftUpCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT)
|
|
|
|
if(((App.SlopeCollDelay1mSCnt <= 0)
|
|
|
|
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT) //判断正面按压
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT))
|
|
|
|
&& (App.SlopeCollDelay1mSCnt <= 0))
|
|
|
|
|
|
|
|
|| ((Oll_diff1 <= -(App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
|| ((Oll_diff1 <= -(App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
&& (Oll_diff2 <= -(App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
&& (Oll_diff2 <= -(App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
&& (Oll_diff3 <= -(App.ADTrack.LeftLowVPT*5/6))))
|
|
|
|
&& (Oll_diff3 <= -(App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
|
|
|
|
&& (Olu_diff1 >= (App.ADTrack.LeftUpVPT*5/6))
|
|
|
|
|
|
|
|
&& (Olu_diff2 >= (App.ADTrack.LeftUpVPT*5/6))
|
|
|
|
|
|
|
|
&& (Olu_diff3 >= (App.ADTrack.LeftUpVPT*5/6))))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if((abs(Oll_diff1) > abs(Orl_diff1) + App.ADTrack.LeftLowShieldVPT)
|
|
|
|
if((abs(Oll_diff1) > abs(Orl_diff1) + App.ADTrack.LeftLowShieldVPT)//判断侧面推拉
|
|
|
|
|
|
|
|
&& (abs(Olu_diff1) > abs(Orl_diff1) + App.ADTrack.LeftUpShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Oll_diff1) > abs(Oru_diff1) + App.ADTrack.LeftLowShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff1) > abs(Oru_diff1) + App.ADTrack.LeftUpShieldVPT)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_UP();
|
|
|
|
BDC_UP();
|
|
|
@@ -333,18 +355,24 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
App.RunCollDelay1mSCnt = RUN_TIME_MS;
|
|
|
|
App.RunCollDelay1mSCnt = RUN_TIME_MS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(((App.LeftUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
|
|
|
|
else if(((App.SlopeCollDelay1mSCnt <= 0)
|
|
|
|
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT) //判断上下拉方向
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftUpCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.LeftLowCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT))
|
|
|
|
&& ((App.SlopeCollDelay1mSCnt <= 0)))
|
|
|
|
|| ((Oll_diff1 >= (App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
|| ((Oll_diff1 >= App.ADTrack.LeftLowVPT)
|
|
|
|
&& (Oll_diff2 >= (App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
&& (Oll_diff1 >= App.ADTrack.LeftLowVPT)
|
|
|
|
&& (Oll_diff3 >= (App.ADTrack.LeftLowVPT*5/6))
|
|
|
|
&& (Oll_diff1 >= App.ADTrack.LeftLowVPT)))
|
|
|
|
&& (Olu_diff1 <= -(App.ADTrack.LeftUpVPT*5/6))
|
|
|
|
|
|
|
|
&& (Olu_diff2 <= -(App.ADTrack.LeftUpVPT*5/6))
|
|
|
|
|
|
|
|
&& (Olu_diff3 <= -(App.ADTrack.LeftUpVPT*5/6))))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if((abs(Oll_diff1) > abs(Orl_diff1) + App.ADTrack.LeftLowShieldVPT)
|
|
|
|
if((abs(Oll_diff1) > abs(Orl_diff1) + App.ADTrack.LeftLowShieldVPT)//判断侧面推拉
|
|
|
|
|
|
|
|
&& (abs(Olu_diff1) > abs(Orl_diff1) + App.ADTrack.LeftUpShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Oll_diff1) > abs(Oru_diff1) + App.ADTrack.LeftLowShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff1) > abs(Oru_diff1) + App.ADTrack.LeftUpShieldVPT)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_DOWN();
|
|
|
|
BDC_DOWN();
|
|
|
@@ -356,21 +384,27 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(LeftSlopeSum < RightSlopeSum && LeftDiffSum < RightDiffSum)
|
|
|
|
else if(LeftSlopeSum < RightSlopeSum && LeftDiffSum < RightDiffSum)//上下拉屏幕右边
|
|
|
|
{
|
|
|
|
{
|
|
|
|
App.RightRunFalg = true;
|
|
|
|
App.RightRunFalg = true;
|
|
|
|
if(((App.RightUpCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT)
|
|
|
|
if(((App.SlopeCollDelay1mSCnt <= 0)
|
|
|
|
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT) //判断上下拉方向
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT))
|
|
|
|
&& (App.SlopeCollDelay1mSCnt <= 0))
|
|
|
|
|
|
|
|
|| ((Orl_diff1 <= -(App.ADTrack.RightLowVPT*5/6))
|
|
|
|
|| ((Orl_diff1 <= -(App.ADTrack.RightLowVPT*5/6))
|
|
|
|
&& (Orl_diff2 <= -(App.ADTrack.RightLowVPT*5/6))
|
|
|
|
&& (Orl_diff2 <= -(App.ADTrack.RightLowVPT*5/6))
|
|
|
|
&& (Orl_diff3 <= -(App.ADTrack.RightLowVPT*5/6))))
|
|
|
|
&& (Orl_diff3 <= -(App.ADTrack.RightLowVPT*5/6))
|
|
|
|
|
|
|
|
&& (Oru_diff1 >= (App.ADTrack.RightUpVPT*5/6))
|
|
|
|
|
|
|
|
&& (Oru_diff2 >= (App.ADTrack.RightUpVPT*5/6))
|
|
|
|
|
|
|
|
&& (Oru_diff3 >= (App.ADTrack.RightUpVPT*5/6))))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if((abs(Orl_diff1) > abs(Oll_diff1) + App.ADTrack.RightLowShieldVPT)
|
|
|
|
if((abs(Orl_diff1) > abs(Oll_diff1) + App.ADTrack.RightLowShieldVPT)//判断侧面推拉
|
|
|
|
|
|
|
|
&& (abs(Oru_diff1) > abs(Oll_diff1) + App.ADTrack.RightUpShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Orl_diff1) > abs(Olu_diff1) + App.ADTrack.RightLowShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Oru_diff1) > abs(Olu_diff1) + App.ADTrack.RightUpShieldVPT)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_UP();
|
|
|
|
BDC_UP();
|
|
|
@@ -381,19 +415,24 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
App.RunCollDelay1mSCnt = RUN_TIME_MS;
|
|
|
|
App.RunCollDelay1mSCnt = RUN_TIME_MS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(((App.RightUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
|
|
|
|
else if(((App.SlopeCollDelay1mSCnt <= 0)
|
|
|
|
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT) //判断上下拉方向
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightUpCS1237_SlopeArray[2] >= App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT)
|
|
|
|
&& (App.RightLowCS1237_SlopeArray[2] <= -App.ADTrack.Slope_VPT))
|
|
|
|
&& (App.SlopeCollDelay1mSCnt <= 0))
|
|
|
|
|| ((Orl_diff1 >= (App.ADTrack.RightLowVPT*5/6))
|
|
|
|
|| ((Orl_diff1 >= App.ADTrack.RightLowVPT)
|
|
|
|
&& (Orl_diff2 >= (App.ADTrack.RightLowVPT*5/6))
|
|
|
|
&& (Orl_diff2 >= App.ADTrack.RightLowVPT)
|
|
|
|
&& (Orl_diff3 >= (App.ADTrack.RightLowVPT*5/6))
|
|
|
|
&& (Orl_diff3 >= App.ADTrack.RightLowVPT))
|
|
|
|
&& (Oru_diff1 <= -(App.ADTrack.RightUpVPT*5/6))
|
|
|
|
)
|
|
|
|
&& (Oru_diff2 <= -(App.ADTrack.RightUpVPT*5/6))
|
|
|
|
|
|
|
|
&& (Oru_diff3 <= -(App.ADTrack.RightUpVPT*5/6))))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if((abs(Oru_diff1) > abs(Olu_diff1) + App.ADTrack.RightUpShieldVPT)
|
|
|
|
if((abs(Oru_diff1) > abs(Olu_diff1) + App.ADTrack.RightUpShieldVPT)//判断侧面推拉
|
|
|
|
|
|
|
|
&& (abs(Oru_diff1) > abs(Oll_diff1) + App.ADTrack.RightUpShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Orl_diff1) > abs(Olu_diff1) + App.ADTrack.RightLowShieldVPT)
|
|
|
|
|
|
|
|
&& (abs(Oru_diff1) > abs(Olu_diff1) + App.ADTrack.RightUpShieldVPT)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_DOWN();
|
|
|
|
BDC_DOWN();
|
|
|
@@ -441,6 +480,9 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
else if((abs(Oll_diff1) + EME_STOP_VPT) < abs(Orl_diff1)
|
|
|
|
else if((abs(Oll_diff1) + EME_STOP_VPT) < abs(Orl_diff1)
|
|
|
|
&& (abs(Oll_diff2) + EME_STOP_VPT) < abs(Orl_diff2)
|
|
|
|
&& (abs(Oll_diff2) + EME_STOP_VPT) < abs(Orl_diff2)
|
|
|
|
&& (abs(Oll_diff3) + EME_STOP_VPT) < abs(Orl_diff3)
|
|
|
|
&& (abs(Oll_diff3) + EME_STOP_VPT) < abs(Orl_diff3)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff1) + EME_STOP_VPT) < abs(Oru_diff1)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff2) + EME_STOP_VPT) < abs(Oru_diff2)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff3) + EME_STOP_VPT) < abs(Oru_diff3)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_STOP();
|
|
|
|
BDC_STOP();
|
|
|
@@ -481,6 +523,9 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
else if(abs(Oll_diff1) > (abs(Orl_diff1) + EME_STOP_VPT)
|
|
|
|
else if(abs(Oll_diff1) > (abs(Orl_diff1) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff2) > (abs(Orl_diff2) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff2) > (abs(Orl_diff2) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff3) > (abs(Orl_diff3) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff3) > (abs(Orl_diff3) + EME_STOP_VPT)
|
|
|
|
|
|
|
|
&& abs(Olu_diff1) > (abs(Oru_diff1) + EME_STOP_VPT)
|
|
|
|
|
|
|
|
&& abs(Olu_diff2) > (abs(Oru_diff2) + EME_STOP_VPT)
|
|
|
|
|
|
|
|
&& abs(Olu_diff3) > (abs(Oru_diff3) + EME_STOP_VPT)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_STOP();
|
|
|
|
BDC_STOP();
|
|
|
@@ -524,6 +569,9 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
else if((abs(Oll_diff1) + EME_STOP_VPT) < abs(Orl_diff1)
|
|
|
|
else if((abs(Oll_diff1) + EME_STOP_VPT) < abs(Orl_diff1)
|
|
|
|
&& (abs(Oll_diff2) + EME_STOP_VPT) < abs(Orl_diff2)
|
|
|
|
&& (abs(Oll_diff2) + EME_STOP_VPT) < abs(Orl_diff2)
|
|
|
|
&& (abs(Oll_diff3) + EME_STOP_VPT) < abs(Orl_diff3)
|
|
|
|
&& (abs(Oll_diff3) + EME_STOP_VPT) < abs(Orl_diff3)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff1) + EME_STOP_VPT) < abs(Oru_diff1)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff2) + EME_STOP_VPT) < abs(Oru_diff2)
|
|
|
|
|
|
|
|
&& (abs(Olu_diff3) + EME_STOP_VPT) < abs(Oru_diff3)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_STOP();
|
|
|
|
BDC_STOP();
|
|
|
@@ -564,6 +612,9 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
else if(abs(Oll_diff1) > (abs(Orl_diff1) + EME_STOP_VPT)
|
|
|
|
else if(abs(Oll_diff1) > (abs(Orl_diff1) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff2) > (abs(Orl_diff2) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff2) > (abs(Orl_diff2) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff3) > (abs(Orl_diff3) + EME_STOP_VPT)
|
|
|
|
&& abs(Oll_diff3) > (abs(Orl_diff3) + EME_STOP_VPT)
|
|
|
|
|
|
|
|
&& abs(Olu_diff1) > (abs(Oru_diff1) + EME_STOP_VPT)
|
|
|
|
|
|
|
|
&& abs(Olu_diff2) > (abs(Oru_diff2) + EME_STOP_VPT)
|
|
|
|
|
|
|
|
&& abs(Olu_diff3) > (abs(Oru_diff3) + EME_STOP_VPT)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
&& App.EmergencyDelay1mSCnt <= 0 && App.CentreRunFalg == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BDC_STOP();
|
|
|
|
BDC_STOP();
|
|
|
@@ -573,32 +624,33 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (lu_K.peaks_positive
|
|
|
|
if (
|
|
|
|
&& lu_K.valleys_negative
|
|
|
|
// lu_K.peaks_positive
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
// && lu_K.valleys_negative
|
|
|
|
|
|
|
|
App.LeftUpCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[1] > -FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[1] > -FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[2] < FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[2] < FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[2] > -FOLLOW_VPT
|
|
|
|
&& App.LeftUpCS1237_SlopeArray[2] > -FOLLOW_VPT
|
|
|
|
&& ll_K.peaks_positive
|
|
|
|
// && ll_K.peaks_positive
|
|
|
|
&& ll_K.valleys_negative
|
|
|
|
// && ll_K.valleys_negative
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[1] > -FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[1] > -FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[2] < FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[2] < FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[2] > -FOLLOW_VPT
|
|
|
|
&& App.LeftLowCS1237_SlopeArray[2] > -FOLLOW_VPT
|
|
|
|
&& ru_K.peaks_positive
|
|
|
|
// && ru_K.peaks_positive
|
|
|
|
&& ru_K.valleys_negative
|
|
|
|
// && ru_K.valleys_negative
|
|
|
|
&& App.RightUpCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[1] > -FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[1] > -FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[2] < FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[2] < FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[2] > -FOLLOW_VPT
|
|
|
|
&& App.RightUpCS1237_SlopeArray[2] > -FOLLOW_VPT
|
|
|
|
&& rl_K.peaks_positive
|
|
|
|
// && rl_K.peaks_positive
|
|
|
|
&& rl_K.valleys_negative
|
|
|
|
// && rl_K.valleys_negative
|
|
|
|
&& App.RightLowCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
&& App.RightLowCS1237_SlopeArray[0] < FOLLOW_VPT
|
|
|
|
&& App.RightLowCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.RightLowCS1237_SlopeArray[0] > -FOLLOW_VPT
|
|
|
|
&& App.RightLowCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
|
&& App.RightLowCS1237_SlopeArray[1] < FOLLOW_VPT
|
|
|
@@ -646,6 +698,8 @@ static void AppInit(void)
|
|
|
|
RIGHTUP_CS1237_Init();
|
|
|
|
RIGHTUP_CS1237_Init();
|
|
|
|
RIGHTLOW_CS1237_Init();
|
|
|
|
RIGHTLOW_CS1237_Init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BDC_STOP();
|
|
|
|
|
|
|
|
|
|
|
|
App.Status = APP_STATUS_WAIT;
|
|
|
|
App.Status = APP_STATUS_WAIT;
|
|
|
|
App.TD1mSDelayCnt = 1000;
|
|
|
|
App.TD1mSDelayCnt = 1000;
|
|
|
|
// App.Status = APP_STATUS_UP1;
|
|
|
|
// App.Status = APP_STATUS_UP1;
|
|
|
|