TI中文支持网
TI专业的中文技术问题搜集分享网站

有关TI电机控制DMC库里面的模块的问题!

下面是F2812XOWM.H:

/*—————————————————————————–
Define the structure of the PWM Driver Object—————————————————————————–*/
typedef struct { Uint16 PeriodMax; // Parameter: PWM Half-Period in CPU clock cycles (Q0)
int16 MfuncPeriod; // Input: Period scaler (Q15) int16 MfuncC1; // Input: PWM 1&2 Duty cycle ratio (Q15)
int16 MfuncC2; // Input: PWM 3&4 Duty cycle ratio (Q15) int16 MfuncC3; // Input: PWM 5&6 Duty cycle ratio (Q15)
void (*init)(); // Pointer to the init function void (*update)(); // Pointer to the update function } PWMGEN ;

我的问题是:

1、为什么PeriodMax的值为什么是“PWM Half-Period in CPU clock cycles (Q0)”?

 PS:在控制交流电机的例程ACI3_1.C中,对PeriodMax赋值是采用下面的方式:         

                 / / Initialize PWM module
                 pwm1.PeriodMax = SYSTEM_FREQUENCY*1000000*T/2; // Perscaler X1 (T1), ISR period = T x 1
                 pwm1.init(&pwm1);

     为什么是系统频率参与定时器T1的周期寄存器值得计算?不应该是系统时钟经过高速时钟预定标和EV的时钟预定标进行分频后的时钟,参与计算吗?

2、MfuncPeriod这个变量的具体作用是什么呢?

Hank Zhao:

1,PWM是采用的UP-DOWN模式,所以PeriodMax的值是“PWM Half-Period in CPU clock cycles (Q0)”,直接采样系统时钟应该是程序中系统时钟没有分频,直接作为EV的计数时钟,是否分频,用户可以自行设定。

下面是F2812XOWM.H:

/*—————————————————————————–
Define the structure of the PWM Driver Object—————————————————————————–*/
typedef struct { Uint16 PeriodMax; // Parameter: PWM Half-Period in CPU clock cycles (Q0)
int16 MfuncPeriod; // Input: Period scaler (Q15) int16 MfuncC1; // Input: PWM 1&2 Duty cycle ratio (Q15)
int16 MfuncC2; // Input: PWM 3&4 Duty cycle ratio (Q15) int16 MfuncC3; // Input: PWM 5&6 Duty cycle ratio (Q15)
void (*init)(); // Pointer to the init function void (*update)(); // Pointer to the update function } PWMGEN ;

我的问题是:

1、为什么PeriodMax的值为什么是“PWM Half-Period in CPU clock cycles (Q0)”?

 PS:在控制交流电机的例程ACI3_1.C中,对PeriodMax赋值是采用下面的方式:         

                 / / Initialize PWM module
                 pwm1.PeriodMax = SYSTEM_FREQUENCY*1000000*T/2; // Perscaler X1 (T1), ISR period = T x 1
                 pwm1.init(&pwm1);

     为什么是系统频率参与定时器T1的周期寄存器值得计算?不应该是系统时钟经过高速时钟预定标和EV的时钟预定标进行分频后的时钟,参与计算吗?

2、MfuncPeriod这个变量的具体作用是什么呢?

Hank Zhao:

2,MfuncPeriod我觉得没什么作用,它的初值是Q15格式的0x7FFF也就是1。这样写可能是为了与之后计算占空比的写法一致。

下面是F2812XOWM.H:

/*—————————————————————————–
Define the structure of the PWM Driver Object—————————————————————————–*/
typedef struct { Uint16 PeriodMax; // Parameter: PWM Half-Period in CPU clock cycles (Q0)
int16 MfuncPeriod; // Input: Period scaler (Q15) int16 MfuncC1; // Input: PWM 1&2 Duty cycle ratio (Q15)
int16 MfuncC2; // Input: PWM 3&4 Duty cycle ratio (Q15) int16 MfuncC3; // Input: PWM 5&6 Duty cycle ratio (Q15)
void (*init)(); // Pointer to the init function void (*update)(); // Pointer to the update function } PWMGEN ;

我的问题是:

1、为什么PeriodMax的值为什么是“PWM Half-Period in CPU clock cycles (Q0)”?

 PS:在控制交流电机的例程ACI3_1.C中,对PeriodMax赋值是采用下面的方式:         

                 / / Initialize PWM module
                 pwm1.PeriodMax = SYSTEM_FREQUENCY*1000000*T/2; // Perscaler X1 (T1), ISR period = T x 1
                 pwm1.init(&pwm1);

     为什么是系统频率参与定时器T1的周期寄存器值得计算?不应该是系统时钟经过高速时钟预定标和EV的时钟预定标进行分频后的时钟,参与计算吗?

2、MfuncPeriod这个变量的具体作用是什么呢?

Changqing Feng:

回复 Hank Zhao:

1、这里的PeriodMax就是EV定时器周期寄存器的值吧。?

2、“PWM Half-Period in CPU clock cycles (Q0)”这句话还是令我有些困惑。就是PWM波的周期跟CPU的时钟周期有什么关系呢??要说有关系也应该是跟系统时钟经过一些列的分频得到的EV的工作时钟有关吧?你说呢?实在无法理解TI为什么会这么写??还是我有些问题没有理解透彻!!

期待你的指正!!谢谢你了 !!

下面是F2812XOWM.H:

/*—————————————————————————–
Define the structure of the PWM Driver Object—————————————————————————–*/
typedef struct { Uint16 PeriodMax; // Parameter: PWM Half-Period in CPU clock cycles (Q0)
int16 MfuncPeriod; // Input: Period scaler (Q15) int16 MfuncC1; // Input: PWM 1&2 Duty cycle ratio (Q15)
int16 MfuncC2; // Input: PWM 3&4 Duty cycle ratio (Q15) int16 MfuncC3; // Input: PWM 5&6 Duty cycle ratio (Q15)
void (*init)(); // Pointer to the init function void (*update)(); // Pointer to the update function } PWMGEN ;

我的问题是:

1、为什么PeriodMax的值为什么是“PWM Half-Period in CPU clock cycles (Q0)”?

 PS:在控制交流电机的例程ACI3_1.C中,对PeriodMax赋值是采用下面的方式:         

                 / / Initialize PWM module
                 pwm1.PeriodMax = SYSTEM_FREQUENCY*1000000*T/2; // Perscaler X1 (T1), ISR period = T x 1
                 pwm1.init(&pwm1);

     为什么是系统频率参与定时器T1的周期寄存器值得计算?不应该是系统时钟经过高速时钟预定标和EV的时钟预定标进行分频后的时钟,参与计算吗?

2、MfuncPeriod这个变量的具体作用是什么呢?

Changqing Feng:

回复 Hank Zhao:

我也有同感!!是不是为了提高精度?? 网上有一篇帖子是这么说的,我也没看太懂。

谢谢你了!!

下面是F2812XOWM.H:

/*—————————————————————————–
Define the structure of the PWM Driver Object—————————————————————————–*/
typedef struct { Uint16 PeriodMax; // Parameter: PWM Half-Period in CPU clock cycles (Q0)
int16 MfuncPeriod; // Input: Period scaler (Q15) int16 MfuncC1; // Input: PWM 1&2 Duty cycle ratio (Q15)
int16 MfuncC2; // Input: PWM 3&4 Duty cycle ratio (Q15) int16 MfuncC3; // Input: PWM 5&6 Duty cycle ratio (Q15)
void (*init)(); // Pointer to the init function void (*update)(); // Pointer to the update function } PWMGEN ;

我的问题是:

1、为什么PeriodMax的值为什么是“PWM Half-Period in CPU clock cycles (Q0)”?

 PS:在控制交流电机的例程ACI3_1.C中,对PeriodMax赋值是采用下面的方式:         

                 / / Initialize PWM module
                 pwm1.PeriodMax = SYSTEM_FREQUENCY*1000000*T/2; // Perscaler X1 (T1), ISR period = T x 1
                 pwm1.init(&pwm1);

     为什么是系统频率参与定时器T1的周期寄存器值得计算?不应该是系统时钟经过高速时钟预定标和EV的时钟预定标进行分频后的时钟,参与计算吗?

2、MfuncPeriod这个变量的具体作用是什么呢?

Changqing Feng:

回复 Hank Zhao:

谢谢你!

还有我又发了另一个帖子,希望你能给与解答

赞(0)
未经允许不得转载:TI中文支持网 » 有关TI电机控制DMC库里面的模块的问题!
分享到: 更多 (0)