This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

28377s, TI MonoMtrServo_377s 例程问题

MonoMtrServo_377s 例程

1,对电机A相和B相电流采样,示波器显示如附件中,我是按照TI给的步骤设置的,不知道是示波器参数设置原因还是其他程序原因。

这个是我的电流采样程序

inline void motorCurrentSense()
{
motor1.currentAs = 2 * ((float)IFB_A1 * ADC_PU_SCALE_FACTOR - 0.5);//(float)IFB_A1_PPB* ADC_PU_PPB_SCALE_FACTOR;
motor1.currentBs = 2 * ((float)IFB_B1 * ADC_PU_SCALE_FACTOR - 0.5); //(float)IFB_B1* ADC_PU_SCALE_FACTOR;//(float)IFB_B1_PPB* ADC_PU_PPB_SCALE_FACTOR;
motor1.currentCs = -motor1.currentAs - motor1.currentBs;
motor1.volt.DcBusVolt = _IQ((float)VFB_DC1* ADC_PU_SCALE_FACTOR * VFB_DC1_FACT);
return;
}

2,对编码器QEP_MACRO(v,motor->qep)中,电角度的计算不是很明白,从最后的结果显示电角度一直为零,而机械角度在0~60变化。

/* Compute the mechanical angle */ \
v.MechTheta= v.MechScaler*v.RawTheta; \
/* Compute the electrical angle */ \
v.ElecTheta = (v.PolePairs*v.MechTheta) -floor(v.PolePairs*v.MechTheta); /* Q24 = Q0*Q24 */ \