2023/3/13第五次参数飞行测试
This commit is contained in:
@ -175,11 +175,12 @@ double getAngle(unsigned char motor)
|
||||
{
|
||||
TLE_CS1_ENABLE;
|
||||
angle_data = ReadTLE5012B_1(READ_ANGLE_VALUE);
|
||||
// printf("angle_data:%d\n",angle_data);
|
||||
d_angle = angle_data - motory_angle_data_prev;
|
||||
if(fabs(d_angle) > (0.8*cpr) ) motory_full_rotation_offset += d_angle > 0 ? -_2PI : _2PI;
|
||||
motory_angle_data_prev = angle_data;
|
||||
TLE_CS1_DISABLE;
|
||||
return (motory_full_rotation_offset + ( angle_data / (float)cpr) * _2PI) ;
|
||||
return (motory_full_rotation_offset + ( angle_data / (float)cpr) * _2PI) /2.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -189,7 +190,7 @@ double getAngle(unsigned char motor)
|
||||
if(fabs(d_angle) > (0.8*cpr) ) motorx_full_rotation_offset += d_angle > 0 ? -_2PI : _2PI;
|
||||
motorx_angle_data_prev = angle_data;
|
||||
TLE_CS2_DISABLE;
|
||||
return (motorx_full_rotation_offset + ( angle_data / (float)cpr) * _2PI) ;
|
||||
return (motorx_full_rotation_offset + ( angle_data / (float)cpr) * _2PI) /2.f;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user