Переглянути джерело

启动电机运转的方式由模式3改为Walk。

Deyauo 1 рік тому
батько
коміт
3efa9d7b6c

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 31 - 1
Welling_Motor_Debug_Tool/mainForm.cs

@@ -5912,6 +5912,9 @@ namespace Welling_Motor_Debug_Tool
                         Code[0] = 0x00;//5S协议
                         Code[1] = 0x00;
                         mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
+                        Delay_ms(500);
+                        mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
+                        Delay_ms(500);
                         richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
                     }
                     
@@ -6003,9 +6006,12 @@ namespace Welling_Motor_Debug_Tool
                 Code[0] = 0x00;//5S协议
                 Code[1] = 0x00;
                 mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
+                Delay_ms(500);
+                mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
+                Delay_ms(500);
                 richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
             }
-            Delay_ms(2000);
+            
 
             //检查是否有故障
             if (textBox_ErrorCode.Text.Contains("H"))
@@ -6317,6 +6323,7 @@ namespace Welling_Motor_Debug_Tool
                 //发送指令启动电机
                 do
                 {
+#if false //通过运行模式3启动电机
                     //发送指令读取调试信息
                     richTextBox_DebugParam.Clear();
                     mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4500, null);
@@ -6357,10 +6364,33 @@ namespace Welling_Motor_Debug_Tool
                     mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x463C, Code);
                     label_FacModeStatus.Text = "启动电机";
                     richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "启动电机" + "\r\n");
+#else //通过Walk模式启动电机
                     //设置转速100%
                     var Data = new byte[1];
                     Data[0] = (byte)100;
                     mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2C01, Data);
+                    //启动电机进入WALK模式
+                    richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "基础功能检测,进入WALK" + "\r\n");
+                    Code[0] = 0x22;
+                    Code[1] = 0xF0;
+                    mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2802, Code);
+                    WriteACK = false;
+                    WriteCnt = 0;
+                    ACK_WaitCnt = 0;
+                    while (ACK_WaitCnt <= 2) ; //1s
+                    if ((textBox_RunInfo_GearSt.Text != "WALK") || (Convert.ToInt32(textBox_RunInfo_MotorSpeed.Text.Split(' ')[0]) < 200))
+                    {
+                        richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入WALK异常" + "\r\n");
+                        label_FacModeStatus.Text = "存在故障!";
+                        label_FacModeResult.BackColor = Color.Red;
+                        label_FacModeResult.Text = "测试异常";
+                        Delay_ms(500);
+                        //存储异常并上传
+                        FacMode_Stop(false);
+                        return;
+                    }
+                    richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "已进入WALK,开始检测" + "\r\n");
+#endif                    
                     Delay_ms(3000);
                 } while (false);
 

BIN
Welling_Motor_Debug_Tool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.AssemblyReference.cache


+ 1 - 1
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.CoreCompileInputs.cache

@@ -1 +1 @@
-7d07050510310e55bf8550d9eca9cee89d28efbe0ae4d90d40193d6cce53ea30
+de075b059cc2fb100d69e5bca5dc0683faf30372

+ 1 - 0
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.FileListAbsolute.txt

@@ -83,3 +83,4 @@ D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.csproj.CoreCompileInputs.cache
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.exe
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.pdb
+C:\Users\hero\Documents\Work\SoftDesign\Welling-MidMotor\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.Version.resources

BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.GenerateResource.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb