请问高手,SVPWM方式软件如何控制电机反转?谢谢!
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.
谢谢!
我在程序里找不到Iq.ref.
rampgen.h:
typedef struct { _iq Freq; // Input: Ramp frequency (pu)
_iq StepAngleMax; // Parameter: Maximum step angle (pu)
_iq Angle; // Variable: Step angle (pu)
_iq Gain; // Input: Ramp gain (pu)
_iq Out; // Output: Ramp signal (pu)
_iq Offset; // Input: Ramp offset (pu)
void (*calc)(); // Pointer to calculation function
} RAMPGEN;
RotateVector.h:
typedef struct{
void (*calc)(void *);
//输入
_iq Angle; //旋转的角度 -1 ~ 1
_iq k; //输出电压乘的系数 0~1
//输出
_iq Ualpha; // Input: reference alpha-axis phase voltage
_iq Ubeta; // Input: reference beta-axis phase voltage
}ROTATEVECTOR;
svgen_dq.h:
typedef struct { _iq Ualpha; // Input: reference alpha-axis phase voltage
_iq Ubeta; // Input: reference beta-axis phase voltage
_iq Ta; // Output: reference phase-a switching function
_iq Tb; // Output: reference phase-b switching function
_iq Tc; // Output: reference phase-c switching function
void (*calc)(); // Pointer to calculation function
} SVGENDQ;
vhzprof.h:
typedef struct { _iq Freq; // Input: Input Frequency (pu)
_iq VoltOut; // Output: Output voltage (pu)
_iq LowFreq; // Parameter: Low Frequency (pu)
_iq HighFreq; // Parameter: High Frequency at rated voltage (pu)
_iq FreqMax; // Parameter: Maximum Frequency (pu)
_iq VoltMax; // Parameter: Rated voltage (pu)
_iq VoltMin; // Parameter: Voltage at low Frequency range (pu)
void (*calc)(); // Pointer to calculation function
} VHZPROF;
以上是我头文件里的定义,你帮我看看。
好像没有环,开环。开环也应该可以反向吧?
下面是中断程序,你看有没有,其他地方找不到了。
interrupt void T1UFINT_ISR(void) // EV-A
{
// asm (" ESTOP0");
PieCtrl.PIEACK.bit.ACK2=1;
EvaRegs.EVAIFRA.bit.T1UFINT=1; //清中断标志位
//rampgen模块 产生矢量旋转的角度 需要设置StepAngleMax
// rampgen.Freq = _IQ(50)>>7;
rampgen.Freq = _IQ((float)f_now)>>7;
rampgen.calc(&rampgen);
//vhzprof模块 vvvf控制,根据频率比例控制输出电压的量
// vhzprof.Freq = _IQ(50);
vhzprof.Freq = _IQ((float)f_now)+_IQ(0.11);
vhzprof.calc(&vhzprof);
//RotateVector模块 产生旋转矢量对应的Ualpha Ubeta
rotatevector.Angle = rampgen.Angle;
rotatevector.k = vhzprof.VoltOut;
rotatevector.calc(&rotatevector) ;
//svgendq模块 根据Ualpha Ubeta 产生比较器需要的TA TB TC
svgendq.Ualpha = rotatevector.Ualpha;
svgendq.Ubeta = rotatevector.Ubeta ;
svgendq.calc(&svgendq) ;
//ev模块
eva.Ta = svgendq.Ta;
eva.Tb = svgendq.Tb;
eva.Tc = svgendq.Tc;
eva.SetPwm(&eva);
evb.Ta = svgendq.Ta;
evb.Tb = svgendq.Tb;
evb.Tc = svgendq.Tc;
evb.SetPwm(&evb);
}
http://www.ti.com/tool/controlsuite 下载offline的版本。
这是TI所有的电机控制的代码和文档,楼主先看下,对照文档讨论比较好。