Compare commits
No commits in common. "2" and "master" have entirely different histories.
|
@ -73,7 +73,7 @@
|
|||
#ifdef PTZ_MEDIUM_WORM_L6235D_AS5047D
|
||||
///*******************************标准云台******************************/
|
||||
///水平电机减速比
|
||||
#define PTZ_HORI_MOTOR_RATIO 25.0 //(25.0 * 1.5)//20
|
||||
#define PTZ_HORI_MOTOR_RATIO 25.0//(25.0 * 1.5)//20
|
||||
///水平大齿轮减速比
|
||||
#define PTZ_HORI_BIG_GEAR_RATIO 80.0//62.0
|
||||
///水平总减速比
|
||||
|
@ -89,7 +89,7 @@
|
|||
///水平电机最小转速
|
||||
#define PTZ_HORI_MOTOR_MIN_SPEED 400.0//600.0
|
||||
///水平云台最大转速
|
||||
#define PTZ_HORI_MAX_SPEED 1.5 //1.5//1.29//2.4
|
||||
#define PTZ_HORI_MAX_SPEED 1.5//1.29//2.4
|
||||
///水平云台最小转速
|
||||
#define PTZ_HORI_MIN_SPEED 0.2//0.3//0.26//0.4
|
||||
///水平云台默认最佳速度
|
||||
|
@ -98,11 +98,11 @@
|
|||
/**********************************************************/
|
||||
|
||||
///磁编码器和电机之间的减速比
|
||||
#define PTZ_VERT_MOTOR_RATIO 75.0 //75.0//(50.0 * (52.0 / 35.0))//20.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_RATIO 6000.0 //6000.0//4011.429//1080.0
|
||||
#define PTZ_VERT_RATIO 6000.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.5//0.74//2.7
|
||||
#define PTZ_VERT_MAX_SPEED 0.5//0.74//2.7
|
||||
///垂直云台最小转速
|
||||
#define PTZ_VERT_MIN_SPEED 0.07 //0.07//0.1//0.15//0.5
|
||||
#define PTZ_VERT_MIN_SPEED 0.07//0.1//0.15//0.5
|
||||
///垂直云台默认最佳速度
|
||||
#define PTZ_VERT_BEST_SPEED 0.4 //0.4//0.7//2.0
|
||||
#define PTZ_VERT_BEST_SPEED 0.4//0.7//2.0
|
||||
|
||||
|
||||
//电机磁极对数
|
||||
|
|
|
@ -550,22 +550,11 @@ static void ptz_hori_pid_task()
|
|||
g_ptz.hori_pid.hall_h2_count +
|
||||
g_ptz.hori_pid.hall_h3_count;
|
||||
|
||||
static uint32_t timeH, lastTimeH, horiTime;
|
||||
timeH = OSTimeGet();
|
||||
horiTime = timeH - lastTimeH;
|
||||
if (horiTime < 0) {
|
||||
continue;
|
||||
}
|
||||
lastTimeH = timeH;
|
||||
|
||||
if(g_ptz.hori_pid.hall_h123_count >= 2)
|
||||
{
|
||||
// g_ptz.hori_pid.hall_h123_motor_speed =
|
||||
// 60000.0 * (float)(g_ptz.hori_pid.hall_h123_count/* - 1*/) /
|
||||
// (float)PTZ_HORI_PID_T / PTZ_HORI_ONE_CYCLE_HALL_NUM;
|
||||
g_ptz.hori_pid.hall_h123_motor_speed =
|
||||
60000.0 * (float)(g_ptz.hori_pid.hall_h123_count/* - 1*/) /
|
||||
(float)horiTime / PTZ_HORI_ONE_CYCLE_HALL_NUM;
|
||||
(float)PTZ_HORI_PID_T / PTZ_HORI_ONE_CYCLE_HALL_NUM;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1202,25 +1191,14 @@ static void ptz_vert_pid_task()
|
|||
g_ptz.vert_pid.hall_h2_count +
|
||||
g_ptz.vert_pid.hall_h3_count;
|
||||
|
||||
static uint32_t timeV, lastTimeV, vertTime;
|
||||
timeV = OSTimeGet();
|
||||
vertTime = timeV - lastTimeV;
|
||||
if (vertTime < 0) {
|
||||
continue;
|
||||
}
|
||||
lastTimeV = timeV;
|
||||
|
||||
if(g_ptz.vert_pid.hall_h123_count >= 2)
|
||||
{
|
||||
// g_ptz.vert_pid.hall_h123_motor_speed =
|
||||
// 60000.0 * (float)(g_ptz.vert_pid.hall_h123_count /*-1*/) /
|
||||
// (float)PTZ_VERT_PID_T / PTZ_VERT_ONE_CYCLE_HALL_NUM;
|
||||
|
||||
g_ptz.vert_pid.hall_h123_motor_speed =
|
||||
60000.0 * (float)(g_ptz.vert_pid.hall_h123_count /*-1*/) /
|
||||
(float)vertTime / PTZ_VERT_ONE_CYCLE_HALL_NUM;
|
||||
(float)PTZ_VERT_PID_T / PTZ_VERT_ONE_CYCLE_HALL_NUM;
|
||||
|
||||
}
|
||||
|
||||
g_ptz.vert_motor_speed_hall_actual = g_ptz.vert_pid.hall_h123_motor_speed;
|
||||
|
||||
/* ********************************** */
|
||||
|
|
|
@ -12,10 +12,6 @@ static char max_temperature_fault;
|
|||
static char ptz_temp_volt_current_fault_detect_task()
|
||||
{//只报故障,不做响应
|
||||
static unsigned short int time_ms;
|
||||
|
||||
static unsigned char hori_fault;
|
||||
static unsigned char vert_fault;
|
||||
|
||||
|
||||
time_ms ++;
|
||||
if(time_ms < 50)
|
||||
|
@ -24,32 +20,16 @@ static char ptz_temp_volt_current_fault_detect_task()
|
|||
if(H_ADC_Collect.Phase_curr_V >= PHASE_CURRENT ||H_ADC_Collect.Phase_curr_U >= PHASE_CURRENT ||H_ADC_Collect.Phase_curr_W >= PHASE_CURRENT )
|
||||
{//堵转检测,防止电机堵转烧坏,结合电机卡死故障监测,与云台工作电流监测。
|
||||
|
||||
if (g_ptz.fault_detect.Phase_curr_H != FAULT) {
|
||||
hori_fault++;
|
||||
if (hori_fault >= 10) {
|
||||
g_ptz.fault_detect.Phase_curr_H = FAULT;//水平电机相电流过大,报警
|
||||
ptz_hori_stop(PTZ_HORI_STOP_TIME);
|
||||
}
|
||||
}
|
||||
g_ptz.fault_detect.Phase_curr_H = FAULT;//水平电机相电流过大,报警
|
||||
|
||||
ptz_hori_stop(PTZ_HORI_STOP_TIME);
|
||||
}
|
||||
else {
|
||||
hori_fault = 0;
|
||||
}
|
||||
|
||||
|
||||
if(V_ADC_Collect.Phase_curr_V >= PHASE_CURRENT ||V_ADC_Collect.Phase_curr_U >= PHASE_CURRENT ||V_ADC_Collect.Phase_curr_W >= PHASE_CURRENT )
|
||||
{//堵转检测,防止电机堵转烧坏,结合电机卡死故障监测,与云台工作电流监测。
|
||||
|
||||
if (g_ptz.fault_detect.Phase_curr_V != FAULT) {
|
||||
vert_fault++;
|
||||
if (vert_fault >= 10) {
|
||||
g_ptz.fault_detect.Phase_curr_V = FAULT;//垂直电机相电流过大,报警
|
||||
ptz_vert_stop(PTZ_VERT_STOP_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
vert_fault = 0;
|
||||
|
||||
g_ptz.fault_detect.Phase_curr_V = FAULT;//垂直电机相电流过大,报警
|
||||
|
||||
ptz_vert_stop(PTZ_VERT_STOP_TIME);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -360,21 +360,21 @@ void h_bldc_six_step()
|
|||
H_Hall_state.Hall_value = h_hall_senser_value_get();
|
||||
if((H_Hall_state.Hall_value <= 6)&&(H_Hall_state.Hall_value >= 1))
|
||||
{
|
||||
if(g_ptz.hori_direction_set == PTZ_HORI_DIR_RIGHT)
|
||||
{//电机正转- 1
|
||||
h_six_step_commu[(7-H_Hall_state.Hall_value) -1]();
|
||||
}else{//电机反转
|
||||
h_six_step_commu[H_Hall_state.Hall_value -1]();
|
||||
}
|
||||
// //直齿云台转向
|
||||
// if(g_ptz.hori_direction_set == PTZ_HORI_DIR_RIGHT)
|
||||
// {//电机正转- 1
|
||||
// if(g_ptz.hori_direction_set == PTZ_HORI_DIR_RIGHT)
|
||||
// {//电机正转- 1
|
||||
// h_six_step_commu[(7-H_Hall_state.Hall_value) -1]();
|
||||
// }else{//电机反转
|
||||
// h_six_step_commu[H_Hall_state.Hall_value -1]();
|
||||
// }
|
||||
//直齿云台转向
|
||||
if(g_ptz.hori_direction_set == PTZ_HORI_DIR_RIGHT)
|
||||
{//电机正转- 1
|
||||
|
||||
// h_six_step_commu[H_Hall_state.Hall_value -1]();
|
||||
// }else{//电机反转
|
||||
// h_six_step_commu[(7-H_Hall_state.Hall_value) -1]();
|
||||
h_six_step_commu[H_Hall_state.Hall_value -1]();
|
||||
}else{//电机反转
|
||||
h_six_step_commu[(7-H_Hall_state.Hall_value) -1]();
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ void ptz_uart_dev_send(device_handle device, void *data, int len)
|
|||
if(device == uart_485_handle)
|
||||
{
|
||||
PTZ_UART_485_TX;
|
||||
OSTimeDlyHMSM(0u, 0u, 0u, 1u);
|
||||
OSTimeDlyHMSM(0u, 0u, 0u, 10u);
|
||||
|
||||
for (int i = 0; i<len; i++)
|
||||
{
|
||||
|
@ -254,7 +254,7 @@ void ptz_uart_dev_send(device_handle device, void *data, int len)
|
|||
}
|
||||
}
|
||||
|
||||
OSTimeDlyHMSM(0u, 0u, 0u, 1u);
|
||||
OSTimeDlyHMSM(0u, 0u, 0u, 10u);
|
||||
PTZ_UART_485_RX;
|
||||
}
|
||||
|
||||
|
|
|
@ -825,7 +825,7 @@
|
|||
</option>
|
||||
<option>
|
||||
<name>IlinkIcfFile</name>
|
||||
<state>D:\psx\Pan-Tilt\1.software\HY\6.0 MW22-01A\BSP\IAR\GD32F450xE.icf</state>
|
||||
<state>D:\psx\Pan-Tilt\1.software\HY\6.0 MW22-01A\BSP\IAR\GD32F450xE_APP.icf</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>IlinkIcfFileSlave</name>
|
||||
|
|
Loading…
Reference in New Issue