This commit is contained in:
parent
f98396c3fc
commit
8ac0fd9bca
|
@ -121,7 +121,7 @@ static float ptz_hori_pid_calculate(float H_SampSpeed)
|
||||||
//е÷ËÙ·½Ê½
|
//е÷ËÙ·½Ê½
|
||||||
static void ptz_hori_pid_task()
|
static void ptz_hori_pid_task()
|
||||||
{
|
{
|
||||||
unsigned int time = 0;
|
// unsigned int time = 0;
|
||||||
char i = 0;
|
char i = 0;
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
|
@ -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 timeH, lastTimeH, horiTime;
|
||||||
|
// timeH = OSTimeGet();
|
||||||
|
// horiTime = timeH - lastTimeH;
|
||||||
|
// if (horiTime < 0) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// lastTimeH = timeH;
|
||||||
|
|
||||||
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 =
|
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)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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -767,7 +778,7 @@ static float ptz_vert_pid_calculate(float SampSpeed)
|
||||||
//е÷ËÙ·½Ê½
|
//е÷ËÙ·½Ê½
|
||||||
static void ptz_vert_pid_task()
|
static void ptz_vert_pid_task()
|
||||||
{
|
{
|
||||||
unsigned int time = 0;
|
// unsigned int time = 0;
|
||||||
char i = 0;
|
char i = 0;
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
|
@ -1191,12 +1202,24 @@ 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 timeV, lastTimeV, vertTime;
|
||||||
|
// timeV = OSTimeGet();
|
||||||
|
// vertTime = timeV - lastTimeV;
|
||||||
|
// if (vertTime < 0) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// lastTimeV = timeV;
|
||||||
|
|
||||||
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 =
|
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)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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_ptz.vert_motor_speed_hall_actual = g_ptz.vert_pid.hall_h123_motor_speed;
|
g_ptz.vert_motor_speed_hall_actual = g_ptz.vert_pid.hall_h123_motor_speed;
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
diff a/APP/Device/Device_speed/speed_to_bldc.c b/APP/Device/Device_speed/speed_to_bldc.c (rejected hunks)
|
||||||
|
@@ -121,7 +121,7 @@
|
||||||
|
//<2F>µ<EFBFBD><C2B5>ٷ<EFBFBD>ʽ
|
||||||
|
static void ptz_hori_pid_task()
|
||||||
|
{
|
||||||
|
- unsigned int time = 0;
|
||||||
|
+// unsigned int time = 0;
|
||||||
|
char i = 0;
|
||||||
|
while(1)
|
||||||
|
{
|
|
@ -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