A method for modifying the control system of CM402 chip mounter

Publisher:巳午未Latest update time:2020-02-22 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction: The PVS control system is based on the PIC16F628 microcontroller, and has the advantages of high integration, stable performance, strong anti-interference ability, and high cost performance. The PVS control system has been manufactured and sold as a finished product. After 6 months of online production verification by Suzhou Xiangqing Precision Machinery Co., Ltd. and other units, it has been proved that the design is reliable and feasible. Using the PVS control system to transform the CM402 type placement machine is expected to increase productivity by about 4%, which has good practical value.


1. Analysis


Current status of CM402 chip mounter:


The CM402 high-speed placement machine is developed and produced by Panasonic Corporation of Japan. It is a special equipment for batch processing of certain specific workpieces according to specific procedures. In the production process of splicing materials, if the splicing material detection stops during the traditional CM402 high-speed placement machine, the time of stopping to scan the material will affect the production efficiency.


ways to improve:


Through on-site investigation and demonstration, careful analysis of the equipment's process flow and reading its user manual, the splicing material detection and shutdown material sweeping procedures can be technically transformed, and the PVS control system can be used to replace the Timer on the original electronic control system to achieve the control function of material connection without stopping the machine, thereby improving its production efficiency. This paper uses the PIC16F628 single-chip microcomputer to form a PVS control system to improve the CM402 type placement machine control system.


2. Hardware System Design


The PVS control system is based on the PIC16F628 single-chip microcomputer and consists of the PIC16F628 single-chip microcomputer and its peripheral components, power supply module, and relay module. The printed circuit board and circuit schematic are shown in Figures 1 and 2.


Figure 1 Printed Circuit Board


Figure 2 Schematic diagram


PIC16F628 microcontroller and its peripheral components


PIC16F628 microcontroller is one of the PIC series 8-bit CMOS flash microcontrollers produced by Microchip. This series of microcontrollers adopts RISC (Reduced Instruction Set Computer) embedded structure, with high execution speed, low power consumption, compact size, low operating voltage, strong driving ability, rich variety and other superior performance. Its bus structure adopts the Harvord structure with separate data bus and instruction line, and has a very high pipeline processing speed. Compared with similar 8-bit microcontrollers, the program memory can be saved by half, and the instruction running speed can be increased by about 4 times. The PIC16F628 microcontroller is packaged in DIP-18. With the corresponding program, the chip can realize the intelligent control function of the relay, that is, with other supporting circuits, it can form a PVS control system to realize the control function of the CM402 type placement machine without stopping the material receiving. JP2 is the alarm signal input terminal, JP5 is the PC parallel port unlock signal input terminal, SB1 and SB2 are timing time adjustment buttons, and LED1 to LED6 constitute the timing time display circuit. A single LED lights up for 10 seconds, and all lights up for 60 seconds.


Power Module


The quality of the power module design is directly related to the stability of the PVS control system. This control system directly uses the +24V regulated power supply of the CM402 SMT machine, so the three-terminal voltage regulator integrated circuit LM7812 and LM7805 with good voltage regulation performance are used to achieve two-stage voltage regulation, providing +5V DC regulated power supply for components such as single-chip microcomputers and photocouplers. JP1 is the 24V power input terminal, which is directly connected to the corresponding socket of the CM402 SMT machine.


Relay Module


The relay module is composed of a transistor drive circuit and a solid-state relay. VT1 and VT2 use C9014 transistors; Omron TQ2-24V 24V relay. The working state of the module is controlled by the microcontroller RA4 (pin 3) and connected to the corresponding port of the CM402 SMT machine through JP3 and JP4.


3. Software System Design


The software environment is based on MPLAB IDE V8.33, compiler HI-TECH C, and simulator ICD2.0 to burn PIC16F628 chip to realize the control system transformation design function of CM402 type placement machine.


The implementation procedure is as follows:


#include


__CONFIG(0x1F3C);


#define ulong unsigned long


#define uint unsigned int


#define uchar unsigned char


#define RD (1)


#define WR (1<<1)


#define WREN (1<<2)


#define WRERR (1<<3)


#define FREE (1<<4)


#define CFGS (1<<6)


#define EEPGD (1<<7)


#define START_READ_EEPROM() EECON1=EECON1|RD


#define START_WRITE_EEPROM() EECON1=EECON1|WR


#define ENABLE_WRITE_EEPROM() EECON1=EECON1|WREN


#define DISABLE_WRITE_EEPROM() EECON1=EECON1&(~WREN)


#define SELECT_EEPROM() EECON1=EECON1&(~(EEPGD|CFGS))


#define out RA3


uint js=1;


uchar Key_Num = 0x00,Key_Num1 = 0x00; //This key code


uchar Key_Backup = 0x00,Key_Backup1 = 0x00; //Backup key code


uchar key,temp,key1,temp1;


bit Key_Dis_F = 0,Key_Dis_F1 = 0,OFF_ON=0;


uchar ES=1,ES_DATA=1;


bit a;


ulong z=1;


uchar ES_BC_DATA;


void ms(uint b);


void keyscan(void);


char readByte(char addr);


void writeByte(char addr, char data);


void X_Y_IN(void);


void main()


{ TRISB2=0;


TRISB3=0;


TRISB4=0;


TRISB5=0;


TRISA6=0;


TRISA7=0;


RB2=1;


RB3=1;


RB4=1;


RB5=1;


RA6=1;


RA7=1;


TRISB0=1;


TRISB1=1;


RB0=1;


RB1=1;


TRISB6=1;


TRISB7=1;


RB7=1;


RB6=1;


GIE=1;


PEIE=1;


T1CON=0X01;


TMR1IE=1;


TMR1IF=0;


TMR1L=0XEF;


TMR1H=0XD8;


CM0=1;


CM1=0;


CM2=1;


C2OUT=0;


C2INV=1;


TRISA4=0;


RA4=1;


TRISA3=0;


RA3=1;


a=out=1;


ES_BC_DATA=readByte(0x00);


ES_DATA=ES=ES_BC_DATA;


while(1)


{ asm("clrwdt"); // Clear watchdog


keyscan();


X_Y_IN();


if((C2OUT==1)&(OFF_ON==1)&(a==0))


{ ms(4);


if((C2OUT==1)&(OFF_ON==1)&(a==0))


{ C2OUT=0;


ES_DATA=ES_BC_DATA;


OFF_ON=0;


a=out=1;


z=1;


}


}


switch(ES)


{ case 1:


RB2=1;


RB3=1;


RB4=1;


RB5=1;


RA6=1;


RA7=0;


break;


case 2:


RB2=1;


RB3=1;


RB4=1;


RB5=1;


RA6=0;


RA7=0;


break;


case 3:


RB2=1;


RB3=1;


RB4=1;


RB5=0;


RA6=0;


RA7=0;


break;


case 4:


RB2=1;


RB3=1;


RB4=0;


RB5=0;


RA6=0;


RA7=0;


break;


case 5:


RB2=1;


RB3=0;


RB4=0;


RB5=0;


RA6=0;


RA7=0;


break;


case 6:


RB2=0;


RB3=0;


RB4=0;


RB5=0;


RA6=0;


RA7=0;


break;


}


}


}


void ms(uint b)


{ uchar c;


while(b--)


for(c=123;c>0;c--);


}


void interrupt tmr1(void)


{ if(TMR1IF==1)


{TMR1IF=0;


TMR1L=0XEF;


TMR1H=0XD8;


js++;


if(js==1000)


{ js=1;


if(OFF_ON==1)


{ if(ES_DATA!=0);


{ ES_DATA--;


if(ES_DATA==0)


{ a=out=0;


}


}


}


}


}


}


void X_Y_IN(void)


{ if((RB0==0)&(RB1==0))


{ ms(2);


if((RB0==0)&(RB1==0)&((z++)==500))


{ temp1=1;


}


}


else


{ z=1;


temp1=0;


}


Key_Num1=temp1;


if((Key_Num1!=0x00)&&(Key_Num1 == Key_Backup1 ))


{ if(!Key_Dis_F1)


{Key_Dis_F1 = 1;


asm("clrwdt");


if((RB0==0)&(RB1==0))


{ OFF_ON=1;


}


}


}


else


{ Key_Backup1 = Key_Num1;


Key_Dis_F1 = 0;


}


}


void keyscan(void)


{ if((RB7==0)|(RB6==0))


{ ms(10);


if((RB7==0)|(RB6==0))


{ temp=1;


}


}


else


{ temp=0;


}


Key_Num=temp;


if((Key_Num!=0x00)&&(Key_Num == Key_Backup ))


{ if(!Key_Dis_F)


{Key_Dis_F = 1;


asm("clrwdt");


if((RB6==0)&(RB7==1))


{ ES--;


if(ES<=1)


{ ES=1;


}


if(ES!=ES_BC_DATA)


{ ES_DATA=ES_BC_DATA=ES;


writeByte(0x00,ES_BC_DATA);


writeByte(0x01,out);


writeByte(0x02,RA4);


writeByte(0x03,RB1);


writeByte(0x04,RB0);


writeByte(0x05,z);


}


}


if((RB6==1)&(RB7==0))


{ ES++;


if(ES>=6)


{ ES=6;


}


if(ES!=ES_BC_DATA)


{ ES_DATA=ES_BC_DATA=ES;


writeByte(0x00,ES_BC_DATA);


}


}


}


}


else


{ Key_Backup = Key_Num;


Key_Dis_F = 0;


}


}


char readByte(char addr)


{ char tmpEEPROM;


EEADR = addr;


SELECT_EEPROM();


START_READ_EEPROM();


tmpEEPROM = EEDATA;


return tmpEEPROM;


}


void writeByte(char addr, char data)


{ EEADR = addr;


EEDATA = data;


SELECT_EEPROM();


ENABLE_WRITE_EEPROM();


EECON2 = 0X55;


EECON2 = 0Xaa;


START_WRITE_EEPROM();


ENABLE_WRITE_EEPROM();


while(1 != EEIF);


EEIF = 0;


}


IV. Conclusion

The PVS control system is based on the PIC16F628 microcontroller, and has the advantages of high integration, stable performance, strong anti-interference ability, and high cost performance. The PVS control system has been manufactured and sold as a finished product. After 6 months of online production verification by Suzhou Xiangqing Precision Machinery Co., Ltd. and other units, it has been proved that the design is reliable and feasible. Using the PVS control system to transform the CM402 type placement machine is expected to increase productivity by about 4%, which has good practical value.

Reference address:A method for modifying the control system of CM402 chip mounter

Previous article:PlC microcontroller C language programming (10)
Next article:Design of intelligent cleaning and nursing machine using PIC microcontroller

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号