基于雙核多接口的智能汽車控制系統(tǒng)設(shè)計
Value=Gyro_Data_BUF[i];
本文引用地址:http://www.ex-cimer.com/article/97039.htmSum+=Value;
if(Max
Max=Value;
if(Min>Value)
Min=Value;
}
Sum= Sum-Max-Min ;
SUM_Test = Sum;
CarAngel_V=((((signed long)(Sum/10)- (signed long)Gyro_MidValue)*10000)>>16);
/限幅處理/
if(CarAngel_V > 0)
{
CarAngel_V = (CarAngel_V *
1013) / 1000;
}
if(CarAngel_V<0)
{
CarAngel_V = (CarAngel_V *
1004)/ 1000;
}
if(CarAngel_V>32767)
{
CarAngel_V=32767;
}
if(CarAngel_V<-32767)
{
CarAngel_V=-32767;
}
if(Gyro_Calibration_Flag == 1)
CarAngelRate = (unsigned int)
(CarAngel_V + 32767);
else
CarAngelRate = 32767;
}
}
伺服電機相關(guān)文章:伺服電機工作原理
評論