[SQL] syntaxhighlighter_viewsource syntaxhighlighter_copycode
select TestId,eleStandardSpeed,SetTorque,GetTorque,eleCurrent,Temperature
from t_d_ExteCharacter where eleStandardSpeed<>0 and testId in ('20200723172513_2513_877','20200723172517_2517_171') ORDER BY id asc
SELECT TestId,SetSpeed,GetSpeed,eleCurrent
from t_d_PointMoveTest where testId in ('20200723172513_2513_877','20200723172517_2517_171') ORDER BY id asc
SELECT TestId,PosSetPos,PosGetPos,NegSetPos,NegGetPos
from t_d_PosAccuracy where testId in ('20200723172513_2513_877','20200723172517_2517_171') ORDER BY id asc
SELECT TestId,SetSpeed,GetSpeed,eleCurrent,Temperature
from t_d_Precondition where testId in ('20200723172513_2513_877','20200723172517_2517_171') ORDER BY id asc
SELECT TestId,SetSpeed,GetSpeed,eleTorque,eleCurrent
from t_d_SpeedAccuracy where SetSpeed<>0 and testId in ('20200723172513_2513_877','20200723172517_2517_171') ORDER BY id asc
[C] syntaxhighlighter_viewsource syntaxhighlighter_copycode
#define ADC_ARR_SIZE (20)
//结构体
typedef struct {
uint16_t cur;
uint16_t ADC_Sample_Buffer[ADC_ARR_SIZE];
uint32_t sumVal;
} ADC_Arr_Struct;
// TIM1 更新中断回调函数 杨总源代码
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
ADC_Arr_Struct *p;
p=&ADC_Data_Arr[0];
if(htim == &htim1) // 如果是TIM1的更新中断
{
uint8_t i;
for(i=0; i<sizeof(sampleBuffer); i++)
{
ADC_AddSample2Arr(p+i, sampleBuffer);
}
}
}
[C] syntaxhighlighter_viewsource syntaxhighlighter_copycode
for(uint8_t i = 0; i < 10; i++)
{
WTX_Spd = (i + 1) * 100;
WTX_Tq = 2000;
}
static void ExtnCharacterTest(ExtnCharacterTest_Structure* pExtnCharac)
{
respDebugMsg("外特性测试", TestEndFlag, ENABLE);
uint8_t ErrCode = 0xFF, ErrCode_t;
uint8_t Idc = 0;
TorqueMeasure_Structure Tq;
PowerOFF(TestMotor); //电机断电
PowerOFF(StdMotor);
HAL_Delay(1000);
Power_ON(&(motorParaDta.power_ON_Data));
SetMotorState(TestMotor, Stop);
SetMotorState(StdMotor, Stop);
HAL_Delay(500); //停止后必须延时一段时间,否则Stop->Run无法成功切换
SetMotorModel(TestMotor,TorqueModel);
SetMotorModel(StdMotor,SpeedModel);
SetTorqueData(TestMotor,0);
SetSpeedData(StdMotor,0);
SetMotorState(TestMotor, Run);
SetMotorState(StdMotor, Run);
//////////////////////////////////////////////////////
//////以下代码由李维强修改 区分到底是哪里出了故障
for(uint8_t i = 0; i < sizeof(WTX_Spd)/sizeof(WTX_Spd[0]); i++)
{
SetTorqueData(TestMotor,WTX_Tq);
SetSpeedData(StdMotor,-WTX_Spd);
HAL_Delay(EXTNCHARAC_TIME_MS - 1000);
ErrCode = MotorErrCheck_Li(TestMotor);
if(ErrCode == 0)
{
Tq.setTorque = WTX_Tq;
Tq.measureTorque = GetTorqueMeasure(StdMotor);
Idc = GetIdc(TestMotor);
pExtnCharac->timeStmp = sysCnt;
pExtnCharac->current_mA = Idc;
pExtnCharac->speedStdMotor = GetSpeedMeasure(StdMotor);
pExtnCharac->tempMeasure = GetMotorT(TestMotor);
pExtnCharac->torqueMeasure= Tq;
// ErrCode = TqErrCheck(Tq.measureTorque - Tq.setTorque, EXTNCHARAC_TQERR); //扭矩误差检测
ErrCode_t = MotorErrCheck_Li(StdMotor); //标准电机故障检测
if(ErrCode_t != 0) ErrCode = ErrCode_t;
if(ErrCode == 0)
{
ErrCode_t = MotorErrCheck_Li(TestMotor); //被测电机故障检测
if(ErrCode_t != 0) ErrCode = ErrCode_t;
if(ErrCode == 0)
{
pExtnCharac->ErrorCode = ErrCode;
HAL_Delay(1000);
}
}
}
if(TestEndFlag == 1) break;
}
//最后再赋值一次错误代码
pExtnCharac->ErrorCode = ErrCode;
///////////////////////////////////////////////////////
SetMotorState(TestMotor, Stop);
SetMotorState(StdMotor, Stop);
motorParaDta.finallyProc = 4;
}