您的位置:首页 > 其它

工业交流点焊机的缓升电流控制

2014-11-19 16:01 399 查看
/**************************************************

/*

功能: 工业交流点焊机的缓升电流控制-程序实现(C51)

注意:此函数要根据你的应用做少量改动

定义:
bSynClock 同步触发信号由中断提供

*/

BCD_Buf[1]:缓升设置,0-99

BCD_Buf[6]: 焊接1电流值,0-99

sbit WORK_LED  = P1^3;

sbit W1_LED    = P1^4;

sbit ALARM_LED
= P1^5;

sbit W2_LED    = P1^6;

sbit RUN_LED  
= P1^7;

sbit TR_INT0   = P3^2;         

sbit T_SW      = P3^3;            

sbit Weld_Out  = P3^5;           

sbit Gas_Out   = P3^6;            

*/

void SlowRise(void)

{
BCD_Buf[1] = BCD_Buf[1]*2;// 缓升
StepRise = BCD_Buf[6]/BCD_Buf[1];// current divide SlowRise
StepRise++;
WeldPoint = 0;
while(1)
{

if(BCD_Buf[1] == 0 || BCD_Buf[6] == 0)
break;

if(Start_SW)// if FootSW OFF,then Exit
{
TR0 = 0;
Weld_Out = 1;
W1_LED = 1;
RUN_LED = 1;
break;
}

RUN_LED = 0;
W1_LED = 0;

WeldPoint += StepRise;
Result = WeldData[WeldPoint];// get weld_data from table
do{

 }while(!bSynClock);// wait synchronization signal
bSynClock = 0;// reset
if(WeldPoint < BCD_Buf[6])// if less-than current,then continue run "SlowRise" 
{
TH0 = (uchar)(Result>>8);
TL0 = (uchar)Result;
TR0 = 1;

            ET0 = 1;
}
else
{
TR0 = 0;

            ET0 = 0;
Weld_Out = 1;
break;
}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息