更改速度计算
This commit is contained in:
parent
de3940a003
commit
acc2096d7b
|
@ -550,11 +550,22 @@ static void ptz_hori_pid_task()
|
||||||
g_ptz.hori_pid.hall_h2_count +
|
g_ptz.hori_pid.hall_h2_count +
|
||||||
g_ptz.hori_pid.hall_h3_count;
|
g_ptz.hori_pid.hall_h3_count;
|
||||||
|
|
||||||
|
static uint32_t time, lastTime, horiTime;
|
||||||
|
time = OSTimeGet();
|
||||||
|
horiTime = time - lastTime;
|
||||||
|
if (horiTime < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lastTime = time;
|
||||||
|
|
||||||
if(g_ptz.hori_pid.hall_h123_count >= 2)
|
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 =
|
g_ptz.hori_pid.hall_h123_motor_speed =
|
||||||
60000.0 * (float)(g_ptz.hori_pid.hall_h123_count/* - 1*/) /
|
60000.0 * (float)(g_ptz.hori_pid.hall_h123_count/* - 1*/) /
|
||||||
(float)PTZ_HORI_PID_T / PTZ_HORI_ONE_CYCLE_HALL_NUM;
|
(float)horiTime / PTZ_HORI_ONE_CYCLE_HALL_NUM;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1191,11 +1202,23 @@ static void ptz_vert_pid_task()
|
||||||
g_ptz.vert_pid.hall_h2_count +
|
g_ptz.vert_pid.hall_h2_count +
|
||||||
g_ptz.vert_pid.hall_h3_count;
|
g_ptz.vert_pid.hall_h3_count;
|
||||||
|
|
||||||
|
static uint32_t time, lastTime, vertTime;
|
||||||
|
time = OSTimeGet();
|
||||||
|
vertTime = time - lastTime;
|
||||||
|
if (vertTime < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lastTime = time;
|
||||||
|
|
||||||
if(g_ptz.vert_pid.hall_h123_count >= 2)
|
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 =
|
g_ptz.vert_pid.hall_h123_motor_speed =
|
||||||
60000.0 * (float)(g_ptz.vert_pid.hall_h123_count /*-1*/) /
|
60000.0 * (float)(g_ptz.vert_pid.hall_h123_count /*-1*/) /
|
||||||
(float)PTZ_VERT_PID_T / PTZ_VERT_ONE_CYCLE_HALL_NUM;
|
(float)vertTime / PTZ_VERT_ONE_CYCLE_HALL_NUM;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGChipSelectEditMenu</name>
|
<name>OGChipSelectEditMenu</name>
|
||||||
<state>GD32F450xE GD GD32F450xE</state>
|
<state>GD32F470xE GigaDevice GD32F470xE</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>GenLowLevelInterface</name>
|
<name>GenLowLevelInterface</name>
|
||||||
|
@ -120,17 +120,17 @@
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>GFPUDeviceSlave</name>
|
<name>GFPUDeviceSlave</name>
|
||||||
<state>GD32F450xE GD GD32F450xE</state>
|
<state>GD32F470xE GigaDevice GD32F470xE</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>FPU2</name>
|
<name>FPU2</name>
|
||||||
<version>0</version>
|
<version>0</version>
|
||||||
<state>0</state>
|
<state>4</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>NrRegs</name>
|
<name>NrRegs</name>
|
||||||
<version>0</version>
|
<version>0</version>
|
||||||
<state>0</state>
|
<state>1</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>NEON</name>
|
<name>NEON</name>
|
||||||
|
@ -825,7 +825,7 @@
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>IlinkIcfFile</name>
|
<name>IlinkIcfFile</name>
|
||||||
<state>D:\psx\Pan-Tilt\1.software\HY\6.0 MW22-01A\BSP\IAR\GD32F450xE_APP.icf</state>
|
<state>D:\psx\Pan-Tilt\1.software\HY\6.0 MW22-01A\BSP\IAR\GD32F450xE.icf</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>IlinkIcfFileSlave</name>
|
<name>IlinkIcfFileSlave</name>
|
||||||
|
|
Loading…
Reference in New Issue