From: tasar sun on
Hello Forum,

I have to do is use the 2812 to the direct torque control to control the
motor,CONTROL 6 IGBTS

Now I had a test, according to the requirements of force output on UP
BRIDGE SWITCH SETS followed by 011, then output 001, then 101, then 111,
then 110, then 010 and finally 110
Corresponding under bridge SWITCH is SETING 100 110,010,000,001,101 001

THE SET AS FOLLOWS,
BUT THE QUESTION IS WHY I CAN'T FIND DEAD-BAND
EV SET:
void InitEv(void)
{
EALLOW;
GpioMuxRegs.GPAMUX.all=0x003f;
EDIS;
/*****************************/
/***********配置ACTR**********/
/*****************************/

EvaRegs.ACTR.bit.CMP1ACT=2;
//PW1引脚高电平有效

EvaRegs.ACTR.bit.CMP2ACT=1;
//PWM2引脚低电平有效
EvaRegs.ACTR.bit.CMP3ACT=2;
//PW1引脚高电平有效

EvaRegs.ACTR.bit.CMP4ACT=1;

EvaRegs.ACTR.bit.CMP5ACT=2;
//PW1引脚高电平有效

EvaRegs.ACTR.bit.CMP6ACT=1;
//PWM2引脚低电平有效
//PWM2引脚低电平有效

/*****************************/
/*******配置死区寄存器********/
/*****************************/

EvaRegs.DBTCONA.bit.DBT=15;
//死区定时器周期为5

EvaRegs.DBTCONA.bit.EDBT1=1;

EvaRegs.DBTCONA.bit.EDBT2=1;

EvaRegs.DBTCONA.bit.EDBT3=1;
//死区定时器1使能

EvaRegs.DBTCONA.bit.DBTPS=5;
//死区定时器预定标因子,死区时钟为HSPCLK/8

/*****************************/
/*********配置COMCONA*********/
/*****************************/

EvaRegs.COMCONA.bit.CENABLE=1;
//使能比较单元的比较操作

EvaRegs.COMCONA.bit.CLD=2;
//当给CMPR1赋新值时,立即装载
EvaRegs.COMCONA.bit.ACTRLD=2;
//行为控制寄存器,立即重载

EvaRegs.COMCONA.bit.FCOMPOE=1;
//全比较操作,PWM输出由相应的比较逻辑驱动

/*****************************/
/**********设置T1CON**********/
/*****************************/

EvaRegs.T1CON.bit.TMODE=2;
//T1工作于连续增模式

EvaRegs.T1CON.bit.TPS=3;
//输入时钟预定标因子为X/8

EvaRegs.T1CON.bit.TENABLE=1;
//禁止定时器操作

EvaRegs.T1CON.bit.TCLKS10=0;
//使用内部时钟

EvaRegs.T1CON.bit.TECMPR=1;
//使能定时器比较操作


/*****************************/
/**********设置T1PR等*********/
/*****************************/
EvaRegs.T1PR =129;
//一个周期时间为(129+1)*0.107us

EvaRegs.T1CNT=0; ///定时器1初值设为0
EvaRegs.CMPR1=0;
EvaRegs.CMPR2=0;
EvaRegs.CMPR3=0;

EvaRegs.T1CON.bit.TENABLE=1;
//启动定时器T1
}
----------------------------------------------------------------------------------------------------------------------------------------------------
MAIN PROGRAM :

#include "DSP28_Device.h"

int i,k;

interrupt void ISRTimer2(void);

void main(void)
{
/*初始化系统*/
InitSysCtrl();

/*关中断*/
DINT;
IER = 0x0000;
IFR = 0x0000;

/*初始化PIE控制寄存器*/
InitPieCtrl();

/*初始化PIE矢量表*/
InitPieVectTable();

/*初始化GPIO*/
InitGpio();

EALLOW; // This is needed to write to EALLOW protected
registers
PieVectTable.TINT2 = &ISRTimer2;
EDIS; // This is needed to disable write to EALLOW protected
registers


/*初始化EV*/
InitEv();

InitCpuTimers();
ConfigCpuTimer(&CpuTimer2, 150, 70); //70us一次采样
StartCpuTimer2();

IER |= M_INT14;

EINT;
ERTM;


for(;;)
{

}

}
interrupt void ISRTimer2(void)
{

IFR=0x0000;
// PieCtrl.PIEIFR1.all = 0;
PieCtrl.PIEACK.all=0xffff;
for (i=0;i<0x96;i++)
{

}

EvaRegs.ACTR.all=0x0c33;

for (i=0;i<0x96;i++)
{

}

EvaRegs.ACTR.all=0x0cc3;

for (i=0;i<0x96;i++)
{

}

EvaRegs.ACTR.all=0x03c3;

for (i=0;i<0x96;i++)
{

}

EvaRegs.ACTR.all=0x0333;
for (i=0;i<0x96;i++)
{

}

EvaRegs.ACTR.all=0x033c;
for (i=0;i<0x96;i++)
{

}

EvaRegs.ACTR.all=0x0c3c;
for (i=0;i<0x96;i++)
{

}

EvaRegs.ACTR.all=0x033c;

}
Why can we do that? Does it matter if the signal x[n] is real or complex?

thanks
fisico32



From: Jerry Avins on
On 5/6/2010 8:42 AM, tasar sun wrote:
> Hello Forum,
>
> I have to do is use the 2812 to the direct torque control to control the
> motor,CONTROL 6 IGBTS
>
> Now I had a test, according to the requirements of force output on UP
> BRIDGE SWITCH SETS followed by 011, then output 001, then 101, then 111,
> then 110, then 010 and finally 110
> Corresponding under bridge SWITCH is SETING 100 110,010,000,001,101 001
>
> THE SET AS FOLLOWS,
> BUT THE QUESTION IS WHY I CAN'T FIND DEAD-BAND
> EV SET:
> void InitEv(void)
> {
> EALLOW;
> GpioMuxRegs.GPAMUX.all=0x003f;
> EDIS;
> /*****************************/
> /***********配置ACTR**********/
> /*****************************/
>
> EvaRegs.ACTR.bit.CMP1ACT=2;
> //PW1引脚高电平有效
>
> EvaRegs.ACTR.bit.CMP2ACT=1;
> //PWM2引脚低电平有效
> EvaRegs.ACTR.bit.CMP3ACT=2;
> //PW1引脚高电平有效
>
> EvaRegs.ACTR.bit.CMP4ACT=1;
>
> EvaRegs.ACTR.bit.CMP5ACT=2;
> //PW1引脚高电平有效
>
> EvaRegs.ACTR.bit.CMP6ACT=1;
> //PWM2引脚低电平有效
> //PWM2引脚低电平有效
>
> /*****************************/
> /*******配置死区寄存器********/
> /*****************************/
>
> EvaRegs.DBTCONA.bit.DBT=15;
> //死区定时器周期为5
>
> EvaRegs.DBTCONA.bit.EDBT1=1;
>
> EvaRegs.DBTCONA.bit.EDBT2=1;
>
> EvaRegs.DBTCONA.bit.EDBT3=1;
> //死区定时器1使能
>
> EvaRegs.DBTCONA.bit.DBTPS=5;
> //死区定时器预定� �� 子,死区时钟为HSPCLK/8
>
> /*****************************/
> /*********配置COMCONA*********/
> /*****************************/
>
> EvaRegs.COMCONA.bit.CENABLE=1;
> //使能比较单元的比较操作
>
> EvaRegs.COMCONA.bit.CLD=2;
> //当给CMPR1赋新值时,立即装载
> EvaRegs.COMCONA.bit.ACTRLD=2;
> //行为控制寄存器,立即重载
>
> EvaRegs.COMCONA.bit.FCOMPOE=1;
> //全比较操作,PWM输出由相应的比较逻辑驱动
>
> /*****************************/
> /**********设置T1CON**********/
> /*****************************/
>
> EvaRegs.T1CON.bit.TMODE=2;
> //T1工作于连续增模式
>
> EvaRegs.T1CON.bit.TPS=3;
> //输入时钟预定� �� 子为X/8
>
> EvaRegs.T1CON.bit.TENABLE=1;
> //禁止定时器操作
>
> EvaRegs.T1CON.bit.TCLKS10=0;
> //使用内部时钟
>
> EvaRegs.T1CON.bit.TECMPR=1;
> //使能定时器比较操作
>
>
> /*****************************/
> /**********设置T1PR等*********/
> /*****************************/
> EvaRegs.T1PR =129;
> //一个周期时间为(129+1)*0.107us
>
> EvaRegs.T1CNT=0; ///定时器1初值设为0
> EvaRegs.CMPR1=0;
> EvaRegs.CMPR2=0;
> EvaRegs.CMPR3=0;
>
> EvaRegs.T1CON.bit.TENABLE=1;
> //启动定时器T1
> }
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> MAIN PROGRAM :
>
> #include "DSP28_Device.h"
>
> int i,k;
>
> interrupt void ISRTimer2(void);
>
> void main(void)
> {
> /*初始化系统*/
> InitSysCtrl();
>
> /*关中断*/
> DINT;
> IER = 0x0000;
> IFR = 0x0000;
>
> /*初始化PIE控制寄存器*/
> InitPieCtrl();
>
> /*初始化PIE矢量表*/
> InitPieVectTable();
>
> /*初始化GPIO*/
> InitGpio();
>
> EALLOW; // This is needed to write to EALLOW protected
> registers
> PieVectTable.TINT2 =&ISRTimer2;
> EDIS; // This is needed to disable write to EALLOW protected
> registers
>
>
> /*初始化EV*/
> InitEv();
>
> InitCpuTimers();
> ConfigCpuTimer(&CpuTimer2, 150, 70); //70us一次采� �
> StartCpuTimer2();
>
> IER |= M_INT14;
>
> EINT;
> ERTM;
>
>
> for(;;)
> {
>
> }
>
> }
> interrupt void ISRTimer2(void)
> {
>
> IFR=0x0000;
> // PieCtrl.PIEIFR1.all = 0;
> PieCtrl.PIEACK.all=0xffff;
> for (i=0;i<0x96;i++)
> {
>
> }
>
> EvaRegs.ACTR.all=0x0c33;
>
> for (i=0;i<0x96;i++)
> {
>
> }
>
> EvaRegs.ACTR.all=0x0cc3;
>
> for (i=0;i<0x96;i++)
> {
>
> }
>
> EvaRegs.ACTR.all=0x03c3;
>
> for (i=0;i<0x96;i++)
> {
>
> }
>
> EvaRegs.ACTR.all=0x0333;
> for (i=0;i<0x96;i++)
> {
>
> }
>
> EvaRegs.ACTR.all=0x033c;
> for (i=0;i<0x96;i++)
> {
>
> }
>
> EvaRegs.ACTR.all=0x0c3c;
> for (i=0;i<0x96;i++)
> {
>
> }
>
> EvaRegs.ACTR.all=0x033c;
>
> }
> Why can we do that? Does it matter if the signal x[n] is real or complex?
>
> thanks
> fisico32


What character encoding does this use? I can't read it.

You appear to assume that the reader knows the working of your
processor. That greatly limits the help you can get.

Dead band is caused by backlash and hysteresis. What can't you find?

Jerry
--
"I view the progress of science as ... the slow erosion of the tendency
to dichotomize." --Barbara Smuts, U. Mich.
�����������������������������������������������������������������������
From: Tim Wescott on
Jerry Avins wrote:
> On 5/6/2010 8:42 AM, tasar sun wrote:
>> Hello Forum,
>>
>> I have to do is use the 2812 to the direct torque control to control the
>> motor,CONTROL 6 IGBTS
>>
>> Now I had a test, according to the requirements of force output on UP
>> BRIDGE SWITCH SETS followed by 011, then output 001, then 101, then 111,
>> then 110, then 010 and finally 110
>> Corresponding under bridge SWITCH is SETING 100
>> 110,010,000,001,101 001
>>
>> THE SET AS FOLLOWS,
>> BUT THE QUESTION IS WHY I CAN'T FIND DEAD-BAND
>> EV SET:
(lots -o- mangled code snipped)
>> EvaRegs.ACTR.all=0x033c;
>>
>> }
>> Why can we do that? Does it matter if the signal x[n] is real or complex?
>>
>> thanks
>> fisico32
>
>
> What character encoding does this use? I can't read it.
>
> You appear to assume that the reader knows the working of your
> processor. That greatly limits the help you can get.
>
> Dead band is caused by backlash and hysteresis. What can't you find?

In this case I think the OP means the dead _time_ that you can program
into the 2812's nifty PWM generators to make sure that your H-bridge
does not suffer from shoot-through.

These are very complicated chips with lots of nifty features, and TI has
a way with documentation that makes their operation very obscure.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
From: Tim Wescott on
tasar sun wrote:
> Hello Forum,
>
> I have to do is use the 2812

I assume you mean the Texas Instruments TMS320F2812 digital signal
controller?

You must realize that any time a question starts getting to a specific
processor -- particularly if the question is about how to twiddle
peripherals, rather than whether the core is good at some task or
another -- you're starting to veer well away from comp.dsp territory and
into comp.arch.embedded.

"DSP" as a discipline is pretty agnostic to the computer that it's run
on -- twiddling bits is a ubiquitous problem in embedded programming,
whether your core is a fancy-schmancy DSP or a bog-common 8051.

> to the direct torque control to control the
> motor,CONTROL 6 IGBTS

You use of capitalization is making an already confusing post worse.
>
> Now I had a test, according to the requirements of force output on UP
> BRIDGE SWITCH SETS followed by 011, then output 001, then 101, then 111,
> then 110, then 010 and finally 110
> Corresponding under bridge SWITCH is SETING 100 110,010,000,001,101 001

This section appears to refer to information that is specific not even
to the 2812, but to the

> THE SET AS FOLLOWS,
> BUT THE QUESTION IS WHY I CAN'T FIND DEAD-BAND
> EV SET:
> void InitEv(void)
> {
(code snipped)
> }

What are you trying to _do_? Set the dead time registers? They're in
there -- read the _entire_ section on PWM generation in the Event
Manager document. Then re-read it, as necessary, until you find what
you're looking for. It's in there -- really.

> Why can we do that? Does it matter if the signal x[n] is real or complex?

http://www.merriam-webster.com/dictionary/non%20sequitur

Huh? What do questions about real or complex signals have to do with
controlling PWM generators? No signal that exists in the real world has
a nonzero imaginary component*, ergo nothing that you do to control a
PWM generator has anything to do with complex numbers in any but the
most indirect way.

* We may _choose_ to _represent_ a signal with numbers that we call
complex, but all the numbers that our processor can touch are real.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
From: Vladimir Vassilevsky on


tasar sun wrote:

> Hello Forum,
>
> I have to do is use the 2812 to the direct torque control to control the
> motor,CONTROL 6 IGBTS

RTFM