From: kyz Date: Mon, 2 Mar 2026 01:01:10 +0000 (+0800) Subject: 数据记录实际扭矩值,修改为用实时压力按照五点参数表换算得到 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=1a13f3ff87924afedfb934a4abb9c16ab11b6fe1;p=yn%2Fyn-qdbs.git 数据记录实际扭矩值,修改为用实时压力按照五点参数表换算得到 --- diff --git a/QiDong/APP/src/DflashM.c b/QiDong/APP/src/DflashM.c index d08c98b..1627ea7 100644 --- a/QiDong/APP/src/DflashM.c +++ b/QiDong/APP/src/DflashM.c @@ -190,6 +190,7 @@ void displayInRangeValues( void ) extern float temppress; extern float finish_compareFac; +extern int pressure_to_torque( float pressure ); void Save_WrenchOperationData(SysMemoryPara* pSysMemoryParaVar) { float compareFac = finish_compareFac; @@ -204,7 +205,8 @@ void Save_WrenchOperationData(SysMemoryPara* pSysMemoryParaVar) { case 1: //1ΪŤ¾ØÄ£Ê½ pSysMemoryParaVar->tarque = ModifyVarStructVar.TartorVal_TorMode ; - pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + //pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + pSysMemoryParaVar->actque = pressure_to_torque( pSysMemoryParaVar->WorkPress/100.0 ); //pSysMemoryParaVar->WorkPress = temppress /10000 *compareFac *100; ///pSysMemoryParaVar->tigresult = 1; //Å¡½ô½á¹û printf("Ť¾ØÄ£Ê½¹¤×÷ѹÁ¦ =%d\r\n", pSysMemoryParaVar->WorkPress); @@ -213,7 +215,8 @@ void Save_WrenchOperationData(SysMemoryPara* pSysMemoryParaVar) break; case 2: // 2ΪÂÝ˨ģʽ pSysMemoryParaVar->tarque = ModifyVarStructVar.TartorVal_BoltMode; - pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + //pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + pSysMemoryParaVar->actque = pressure_to_torque( pSysMemoryParaVar->WorkPress/100.0 ); //pSysMemoryParaVar->WorkPress = temppress /10000 *compareFac *100; printf("ÂÝ˨ģʽĿ±êŤ¾Ø =%d\r\n",pSysMemoryParaVar->tarque); printf("ÂÝ˨ģʽʵ¼ÊŤ¾Ø =%d\r\n",pSysMemoryParaVar->actque); @@ -270,7 +273,8 @@ void Save_WrenchOperationData(SysMemoryPara* pSysMemoryParaVar) ///ROUND_TO_UINT32(TorquePatternVar[ ModifyVarStructVar.fabricName-1].Factor* ModifyVarStructVar.gearpress/10000) ; //Ä¿±êŤ¾ØÖµ pSysMemoryParaVar->tarque = ModifyVarStructVar.geartor ; - pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + //pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + pSysMemoryParaVar->actque = pressure_to_torque( pSysMemoryParaVar->WorkPress/100.0 ); //pSysMemoryParaVar->WorkPress = temppress /10000 *compareFac *100; ///pSysMemoryParaVar->tigresult = 1; @@ -283,7 +287,8 @@ void Save_WrenchOperationData(SysMemoryPara* pSysMemoryParaVar) pSysMemoryParaVar->actangle = 0; //´«¸ÐÆ÷²É¼¯µÄֵʵ¼Ê½Ç¶È pSysMemoryParaVar->tarque = ModifyVarStructVar.MaxtorVal_TorMode; - pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + //pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + pSysMemoryParaVar->actque = pressure_to_torque( pSysMemoryParaVar->WorkPress/100.0 ); //pSysMemoryParaVar->WorkPress = // (pSysMemoryParaVar->actque*100)/TorquePatternVar[ModifyVarStructVar.fabricName-1].Factor/10; @@ -296,7 +301,8 @@ void Save_WrenchOperationData(SysMemoryPara* pSysMemoryParaVar) case 5: // 5Ϊ´«¸ÐÆ÷ģʽ pSysMemoryParaVar->tarque = ModifyVarStructVar.presettor_sensor; printf("´«¸ÐÆ÷ģʽĿ±êŤ¾Ø = %d\r\n",pSysMemoryParaVar->tarque); - pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + //pSysMemoryParaVar->actque = pSysMemoryParaVar->tarque*(compareFac+0.0001*Seed); + pSysMemoryParaVar->actque = pressure_to_torque( pSysMemoryParaVar->WorkPress/100.0 ); //pSysMemoryParaVar->WorkPress = // (pSysMemoryParaVar->actque*100)/TorquePatternVar[ModifyVarStructVar.fabricName-1].Factor/10; diff --git a/QiDong/System/WrenchManage.c b/QiDong/System/WrenchManage.c index 291447d..5946c1f 100644 --- a/QiDong/System/WrenchManage.c +++ b/QiDong/System/WrenchManage.c @@ -197,7 +197,7 @@ static void Machine_DoPress(void) //״̬ if(qiya < pressure_start_threshold(temppress) && SleepState == 1 && Adjusting_torque_flag == 1) //°âÊÖ°´Ï ÕâÀïÈç¹ûÏÖ³¡ÆøÑ¹Ò»Ö±±È½ÏµÍ£¬ÉèÖõÄѹÁ¦Èç¹û¸ß ¾ÍûÓа취¼ì²âµ½°âÊÖ°´ÏµÄ״̬ { turn_flag = 1; - if(wrench_device.rotate_start_count++ >= (ROTATE_START_NUM_5MS)/2) + //if(wrench_device.rotate_start_count++ >= (ROTATE_START_NUM_5MS)/2) { LED_SetLedStatus(LED_ID_DETECT_WORK,1); //LED¼ì²â¹¤×÷״̬µÆÁÁ Beep_SetbeepStatus(BEEP_ID_DETECT_WORK,1); //·äÃùÆ÷¼ì²â¹¤×÷״̬Ïì @@ -232,7 +232,8 @@ static void Machine_DoPress(void) //״̬ //Flash_RecordData(); printf("upUsingStructVar.UsingTimeupUsingStructVar.UsingTime\r\n"); SysMemoryParaVar.tigresult = 1; //±íʾš½ôÁË - SysMemoryParaVar.WorkPress = pressure_finish_threshold(temppress) *100; + //SysMemoryParaVar.WorkPress = pressure_finish_threshold(temppress) *100; + SysMemoryParaVar.WorkPress = ADCGetPress[0] *100; if(SaveFlag[UsingTimesMem] == 0) {