Compare commits

..

2 Commits

2 changed files with 20 additions and 29 deletions

View File

@ -75,9 +75,9 @@
///水平电机减速比
#define PTZ_HORI_MOTOR_RATIO 25.0//(25.0 * 1.5)//20
///水平大齿轮减速比
#define PTZ_HORI_BIG_GEAR_RATIO 80.0//62.0
#define PTZ_HORI_BIG_GEAR_RATIO 60.0//62.0
///水平总减速比
#define PTZ_HORI_RATIO 2000.0//2325//1240.0
#define PTZ_HORI_RATIO 1500.0//2325//1240.0
///水平电机调速模拟电压最大值
#define PTZ_HORI_VR_MAX 1999
///水平电机调速模拟电压最小值
@ -89,20 +89,20 @@
///水平电机最小转速
#define PTZ_HORI_MOTOR_MIN_SPEED 400.0//600.0
///水平云台最大转速
#define PTZ_HORI_MAX_SPEED 1.5//1.29//2.4
#define PTZ_HORI_MAX_SPEED 2//1.29//2.4
///水平云台最小转速
#define PTZ_HORI_MIN_SPEED 0.2//0.3//0.26//0.4
#define PTZ_HORI_MIN_SPEED 0.26//0.3//0.26//0.4
///水平云台默认最佳速度
#define PTZ_HORI_BEST_SPEED 1.2//2.0
#define PTZ_HORI_BEST_SPEED 1.5//2.0
/**********************************************************/
///磁编码器和电机之间的减速比
#define PTZ_VERT_MOTOR_RATIO 75.0//(50.0 * (52.0 / 35.0))//20.0
///磁编码器与云台轴之间的减速比
#define PTZ_VERT_BIG_GEAR_RATIO 80.0//54.00
#define PTZ_VERT_BIG_GEAR_RATIO 60.0//54.00
///垂直总减速比
#define PTZ_VERT_RATIO 6000.0//4011.429//1080.0
#define PTZ_VERT_RATIO 4500.0//4011.429//1080.0
///垂直电机调速模拟电压最大值
#define PTZ_VERT_VR_MAX 1999
///垂直电机调速模拟电压最小值
@ -114,11 +114,11 @@
///垂直电机最小转速
#define PTZ_VERT_MOTOR_MIN_SPEED 400.0//600.0
///垂直云台最大转速
#define PTZ_VERT_MAX_SPEED 0.5//0.74//2.7
#define PTZ_VERT_MAX_SPEED 0.67//0.74//2.7
///垂直云台最小转速
#define PTZ_VERT_MIN_SPEED 0.07//0.1//0.15//0.5
#define PTZ_VERT_MIN_SPEED 0.09//0.1//0.15//0.5
///垂直云台默认最佳速度
#define PTZ_VERT_BEST_SPEED 0.4//0.7//2.0
#define PTZ_VERT_BEST_SPEED 0.5//0.7//2.0
//电机磁极对数

View File

@ -2882,27 +2882,18 @@ static char ptz_hori_get_angle_a()
// tem4 = tem4 + 360.0;
// }
}
//避免出现异常
for(uint8_t i = 0; i < 3; i++)
{
if(tem4 == 360.0)///////解决既显示360又显示角度0的问题
{
tem4 = 0;
}
else if( tem4 < 0 )
if(tem4 < 0)
{
tem4 = tem4 + 360.0;
}
else if( tem4 > 360.0 )
if(tem4>360.0)
{
tem4 = tem4 - 360.0;
}
if (tem4 >=0 && tem4 <= 360.0)
{
break;
}
}
g_ptz.hori_angle_actual = tem4;