• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: 關於課程302 MCW的Lab5程式問題請教!
#6
版主
版主


查看用戶資訊
問題1
void __attribute__((__interrupt__)) _ADCInterrupt (void)
{
IFS0bits.ADIF = 0;
RefSpeed = (int)(((unsigned int)ADCBUF0) / 2);
if (RefSpeed < 2000)
RefSpeed = 2000;
return;
}
為何ADCBUF0要/2
RefSpeed 要給他限定 2000呢?
不太懂這樣設定影響為何?
All the calculation in the Lab5~Lab8 is using Q15 format. You need to understand it first.

The A/D is using unsigned fraction format. Please refer to the user manual too see the detail. In this mode, the max A/D is around 65535 which is almost “2” for Q15 format. The PID loop is using Q15 format so the A/D need to be divided by 2 to fit the max limit which is 32767.



Q15(2000) = 2000/32768 = 0.061

6000 RPM à 1

0.061*6000RPM = 366 RPM


RefSpeed = ADCBUF0; 這樣不就可以了

問題2
void SixStepComm (int _Sector, int _Voltage)
{

if (_Voltage >= 0)
{

PDC1 = PDC2 = PDC3 = (unsigned int)_Voltage / 16;
if (_Sector == -1)
OVDCON = 0x0000; else
OVDCON = StateLoTable[_Sector];
}
else
{
PDC1 = PDC2 = PDC3 = (unsigned int)(-(_Voltage+1)) / 16;
if (_Sector == -1)
OVDCON = 0x0000;
else
OVDCON = StateLoTable[(_Sector + 3) % 6];
}
return;

這裡的PDC1 = PDC2 = PDC3 = (unsigned int)(-(_Voltage+1)) / 16; 為什麼要/16這個值呢?



The Voltage is also Q15 format in which the maximum is 32767. So divided by 16 is to fit the PDC max value.






問題3
void InitUserInt(void)
{
TRISE |= 0x0100; // S8/RE8當輸入
// Analog pin for POT already initialized in ADC init subroutine
PORTF = 0x0008; // RS232 Initial values
TRISF = 0xFFF7; // TX as output
return;
}
TX as output的功用為何?



The UART Tx is shared with port F. Tx is output type pin for transmitting the data out. You need to set the direction to “OUTPUT” to make it work.




問題4
pid控制硬體連結除了一個AN用於調控轉速,與6個PWM輸出,3個霍爾信號輸入,我目前DRIVER使用IPM-IGBT模組驅動bldc,DRIVER是否需要作回授給控制器部份呢?

If you are doing the speed-closed control, the Hall signals are the speed feedback.

If you are doing the torque control, you need the DC bus current feedback. You can check our MCLV board to know the detail.


發表於: 2008/5/2 13:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於課程302 MCW的Lab5程式問題請教!
#5
中級會員
中級會員


查看用戶資訊
MCLV 各LAB中是沒有啟動Fault的功能需自行修改
另外LAB6程式是在描述如何用旋波輸出控制PMSM
其SineGen.c中SineTable的建立似乎有問題,而且依照程式的邏輯並搭配原廠馬達PHASE_ZERO 初始設定不應該在54613
不知是否有人知道相關正確答案

發表於: 2008/4/29 8:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於課程302 MCW的Lab5程式問題請教!
#4
資深會員
資深會員


查看用戶資訊
沒有錢上課, 單純猜測:
Q1~Q3同感, 應該是沒錯, 但感覺不一定是Q15!
Q4: 還可以回授驅動電壓是否足夠, 以及回授BUS, 做除法運算, 降低漣波影響.

懂馬達跟懂控制器是兩大課題, 之間不是直接關係, 能整合者, 肯定下了很多功夫, 又何嘗願意完全分享??
等你學會就會了解.

說個有趣現象, 以前還不會進階控制時, 也只是使用PID控制, 也是胡亂調, 也是想說, 怎麼都不願意教一下? 後來觀察結果, 既然是直接上機調的, 說穿就不值錢, 也顯露技窮之處. 然而調的好還是經驗, 但是你問他, 系統頻寬是多少? 我想講不出來的, 就是這類的.

看丟PWM的方式, 只是一般控制器方式, 尚未用到SVPWM, 不難理解才是, 控制可以很複雜, 可以很簡單, 這樣的拋磚引玉, 應該是起不了多大的漣漪!!

我想你還是單問題討論, 可能比較好一些.
例如你認為DC Motor控制簡單, 表示你已經懂線性自動控制, 但AC之類的控制是屬於非線性控制, 怎麼辦呢? 這樣範圍會小很多.

發表於: 2008/4/24 13:38
Thanks,
Edward Lee
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於課程302 MCW的Lab5程式問題請教!
#3
中級會員
中級會員


查看用戶資訊
Q1 是因為硬體電路的問題
Q2 由於程式是利用Q15格式運算,需作調整匹配,解釋起來需重A/D進來作說明
Q3 TRISF = 0xFFF7; //設定是用到RS232時規劃 TX as output
Q4 DRIVER是否需要作回授給控制器部份呢, IPM需迴授過載命令或電流大小

MCLV課程上了好幾次,沒有解說程式的部分,希望可以開LAB5與LAB6的程式說明課程.
心聲告白
由於馬達控制內部用了很多數學,BLDC,PMSM,SR,ACIM不像DC MOTOR那麼簡單,
若馬達數學模型不懂很難把控制器做好,所以建議先唸一唸教課書中的電機機械.
目前業界會此方面的人都不太喜歡教人家,不知示對還是錯?連我自己也搞不太清楚WHY
但我願意分享我所了解的部分,也建議學控制器的朋友若作馬達控制需對馬達有所認識


發表於: 2008/4/24 13:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於課程302 MCW的Lab5程式問題請教!
#2
版主
版主


查看用戶資訊
在問馬達專家中,請等待!

發表於: 2008/4/23 16:13
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於課程302 MCW的Lab5程式問題請教!
#1
新會員
新會員


查看用戶資訊
小弟上過302 MCW的課程,想請教~24V bldcm PID控制
問題1
void __attribute__((__interrupt__)) _ADCInterrupt (void)
{
IFS0bits.ADIF = 0;
RefSpeed = (int)(((unsigned int)ADCBUF0) / 2);
if (RefSpeed < 2000)
RefSpeed = 2000;
return;
}
為何ADCBUF0要/2
RefSpeed 要給他限定 2000呢?
不太懂這樣設定影響為何?

RefSpeed = ADCBUF0; 這樣不就可以了

問題2
void SixStepComm (int _Sector, int _Voltage)
{

if (_Voltage >= 0)
{

PDC1 = PDC2 = PDC3 = (unsigned int)_Voltage / 16;
if (_Sector == -1)
OVDCON = 0x0000; else
OVDCON = StateLoTable[_Sector];
}
else
{
PDC1 = PDC2 = PDC3 = (unsigned int)(-(_Voltage+1)) / 16;
if (_Sector == -1)
OVDCON = 0x0000;
else
OVDCON = StateLoTable[(_Sector + 3) % 6];
}
return;

這裡的PDC1 = PDC2 = PDC3 = (unsigned int)(-(_Voltage+1)) / 16; 為什麼要/16這個值呢?

問題3
void InitUserInt(void)
{
TRISE |= 0x0100; // S8/RE8當輸入
// Analog pin for POT already initialized in ADC init subroutine
PORTF = 0x0008; // RS232 Initial values
TRISF = 0xFFF7; // TX as output
return;
}
TX as output的功用為何?

問題4
pid控制硬體連結除了一個AN用於調控轉速,與6個PWM輸出,3個霍爾信號輸入,我目前DRIVER使用IPM-IGBT模組驅動bldc,DRIVER是否需要作回授給控制器部份呢?

發表於: 2008/4/23 15:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------