欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
DSP2833電機(jī)控制PWM程序
[打印本頁]
作者:
zhang0925
時(shí)間:
2018-9-27 23:29
標(biāo)題:
DSP2833電機(jī)控制PWM程序
電機(jī)控制
DSP2833源程序如下:
#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
#include "clarke.h"
#include"park.h"
#include"ipark.h"
#include"svgen_dq.h"
#include"DSP2833x_EPwm.h"
#include"IQmathLib.h"
#include"F28335_epwm.h"
Uint16 *ExRamStart = (Uint16 *)0x100000;
//void EPwmSetup();
#define SYSTEM_FREQUENCY 150
#define ISR_FREQUENCY 10
Uint16 i;
float Vd_testing = 0; //直軸電壓標(biāo)幺值
float Vq_testing = 0.25; //交軸電壓標(biāo)幺值
float Id_ref = 0; //直軸電流給定,標(biāo)幺值
float Iq_ref = 0.025; //交軸電流給定,標(biāo)幺值
//volatile _iq speed_ref =_IQ(0.01); //速度給定,標(biāo)幺值 電機(jī)速度=12000*speed_ref
//volatile _iq position_ref =_IQ(0.0); //位置給定,標(biāo)幺值 位置給定=50*position_ref
extern PWMGEN pwm1;
void main(void)
{
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2833x_SysCtrl.c file.
InitSysCtrl();
// Step 2. Initalize GPIO:
// This example function is found in the DSP2833x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio(); // Skipped for this example
InitXintf16Gpio(); //zq
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the DSP2833x_PieCtrl.c file.
InitPieCtrl();
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000;
IFR = 0x0000;
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table, even if the interrupt
// is not used in this example. This is useful for debug purposes.
// The shell ISR routines are found in DSP2833x_DefaultIsr.c.
// This function is found in DSP2833x_PieVect.c.
InitPieVectTable();
IER |= M_INT3;
// Enable EPWM INTn in the PIE: Group 3 interrupt 1-6
PieCtrlRegs.PIEIER3.bit.INTx1 = 1;
// Enable global Interrupts and higher priority real-time debug events:
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
// Step 4. Initialize the Device Peripheral. This function can be
// found in DSP2833x_CpuTimers.c
// InitCpuTimers(); // For this example, only initialize the Cpu Timers
// Configure CPU-Timer 0, 1, and 2 to interrupt every second:
// 150MHz CPU Freq, 1 second Period (in uSeconds)
//ConfigCpuTimer(&CpuTimer0, 150, 1000000);
//ConfigCpuTimer(&CpuTimer1, 150, 1000000);
//ConfigCpuTimer(&CpuTimer2, 150, 1000000);
// StartCpuTimer0();
// EPwmSetup();
pwm1.init(&pwm1);
……………………
…………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼
所有資料51hei提供下載:
5956444spwm20170327.zip
(914.41 KB, 下載次數(shù): 27)
2018-9-27 23:27 上傳
點(diǎn)擊文件名下載附件
電機(jī)控制
下載積分: 黑幣 -5
作者:
18811349416
時(shí)間:
2019-10-28 16:01
好東西
作者:
abcabcxyz
時(shí)間:
2020-4-13 20:25
是不是得用這種硬件來做啊
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1