新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 三相步進(jìn)電機(jī)控制

三相步進(jìn)電機(jī)控制

作者: 時(shí)間:2011-11-28 來源:網(wǎng)絡(luò) 收藏

六拍工作方式,正轉(zhuǎn)的繞組通電順序:A、AB、B、BC、C、CA、A,反轉(zhuǎn)的通電順序:A、AC、C、CB、B、BA、B、A。

本文引用地址:http://butianyuan.cn/article/172401.htm

由于轉(zhuǎn)子有一定的慣性以及所帶負(fù)載的慣性,故的工作過程中不能及時(shí)的啟動(dòng)和停止,在啟動(dòng)時(shí)應(yīng)慢慢的加速到預(yù)定速度,在停止前應(yīng)逐漸減速到停止,否則,將產(chǎn)生失步現(xiàn)象。

步進(jìn)電機(jī)的問題可總結(jié)為兩點(diǎn):

1、產(chǎn)生工作方式需要的時(shí)序脈沖;

2、步進(jìn)電機(jī)的速度,使它始終遵循加速、勻速、減速的規(guī)律工作。

C程序

#includeio8515v.h>

#includemacros.h>

const char zhzhuan[7]={0x06,0x04,0x05,0x01,0x03,0x02,0x00};

const char fanzhuan[7]={0x06,0x02,0x03,0x01,0x05,0x004,0x00};

const int time[5]={4000,3200,2400,1600,800}; /*脈沖寬度:0.05m,0.04ms,0.03ms,0.02ms,0.01ms*/

char num; /*將要轉(zhuǎn)動(dòng)的步數(shù)*/

char direct; /*轉(zhuǎn)動(dòng)方向,0為反轉(zhuǎn),1為正轉(zhuǎn)*/

char num_run; /*已經(jīng)轉(zhuǎn)動(dòng)的步數(shù)*/

void main(void)

{

DDRA=0x07;

TCCR1A=0x00;

TCCR1B=0x09;

TIMSK=0x10;

SREG|=0x80;

while(1)

{

;

}

}

#pragma interrupt_handler time1coma:5

void time1coma(void)

{

char i,j;

if(num>9)

{

if(num_run5) OCR1A=time[num_run]; /*增速*/

else if(num_run>(num-5)) OCR1A=time[num-num_run]; /*減速*/

}

else

{

i=(num+1)/2;

if(num_run(i)) OCR1A=time[num_run]; /*增速*/

else OCR1A=time[num-num_run]; /*減速*/

}

if(num_runnum)

{

j=num_run%6;

if(direct==1) PORTA=zhzhuan[j];

else PORTA=fanzhuan[j];

num_run+=1;

}

else

{

OCR1A=0x0fa0;

}

}



關(guān)鍵詞: 控制 電機(jī) 步進(jìn) 三相

評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉