Summary of the invention
The object of the invention is the automatic control system of open metal impact specimen automatic processing device, and control system comprises that by kinetic control system PLC subsystem and servo-drive subsystem and vision detection system constitute.Utilize virtual instrument software development platform LabVIEW and RTSI technology to come integrated system seamlessly, can real-time communication between the each several part, the synchronous coordination operation.
In work flow, the PLC subsystem controls most of sequentially-operating of machining center.FPO series C32T Programmable Logic Controller of the present invention carries out I/O and distributes, and builds signal input circuit, output load circuit; Design PLC system control flow chart, and then on FPWIN GR programmed environment, work out ladder diagram, debugging; Program based on LabVIEW software design PLC and PERCOM peripheral communication.
The feeding control of servocontrol subsystem responsible machining center each several part, hardware PCI-7358 8 axis motion control cards and the AC servo of virtual instrument technique built hardware platform in the system, control Tool in Cutting feeding and the setting movement of worktable speed change; With the LabVIEW software programming control program of servo-drive system, make controlling object according to the operation of desired parameter.According to different control requirements, under speed control mode and position control mode, control servomotor respectively, by the pid parameter of adjusting, make system reach exercise performance preferably.
Software development environment LabVIEW, the VISA of virtual instrument (Virtual Instrument SoftwareArchitecture) function library and RTSI technology organically become one PLC control subsystem, servocontrol subsystem, vision detection system, have formed a cover multi-task scheduling tactical software.System is furnished with conveniently, the human-computer interaction interface of practicality, and operative technique personnel can realize the full-automatic processing of impact specimen by microcomputer to the shirtsleeve operation of observing and controlling function.
Described vision detection system is finished the online detection of the size and dimension of workpiece, and the testing result of different links is as machined parameters and quality control important information.
System of the present invention integrated with communicate by letter;
The present invention has served as connected bridge organic integration PLC technology, fortune control techniques and a vision technique with LabVIEW software.Utilize LabVIEW to be aided with the design of Motion motion-control module and write servo-drive system software, and realize the data transmission between the different hardware; The auxiliary mutual triggering that realizes between controller and image pick-up card; Design integrated control system interactive software operation interface, information management with control system simplifies the operation.
The present invention gathers between the state value of each port of PLC and PLC and the servo controller some steering orders of transmission mutually, adopts data command transmission mode end to end.Selected the passage of the RS-232 serial ports of PC as PLC and motion controller exchanges data.
VISA storehouse in the LabVIEW software, assembly at the serial communication complete function is provided, 5 serial communication nodes are arranged, realize respectively that serial port setting, serial ports are read, serial ports is write, the serial ports buffer memory detects and function such as serial ports time-out, can stipulate the data volume of serial port of host computer address, slave addresses, transmission and the form of a frame serial data etc. easily.PLC is transmitted the order of returning convert Boolean driving governor control servo feed by serial ports to by dedicated algorithms; Also be to give the PLC steering order after servo feed puts in place by serial ports.Communicating by letter between PLC system and servo-drive system realizes by the VISA storehouse substantially.
RTSI (Real-Time System Integration) bus provides the high-speed link between the NI hardware product, realize the real-time triggering between the hardware, can be easily a plurality of functions of motion control, data acquisition, image collecting device be synchronized on a trigger or the time-event by the RTSI bus.
The PCI-7358 motion controller and the PCI-1409 image pick-up card that adopt in the system all are furnished with the RTSI bus interface, realize that by the RTSI bus trigger pip between motion control and vision detection system is shared, realize the synchronous of motion control and image acquisition, thereby effectively they are integrated into a multi-functional integrated system.
System software structure of the present invention is:
The present invention sets up the multithreading model of impact specimen machining center integrated system Control Software according to the multi-thread mechanism of Windows system and LabVIEW software, management in the system, control function is realized dividing make several modules, places independently thread respectively.According to requirements of actual production, system controlling software is divided into hardware initialization module, parameter module, external signal acquisition module, system control module, fault diagnosis module, data are set preserve module, system dynamics display module.The software configuration of integrated control system is shown in figure .3.
System control module is the scheduling core of software systems, and the every circulation primary of this module is just handled outer input data, calls corresponding subtask according to result; Not then moved by the task of its control as parallel subtask.Many subtasks in the system work process are not simple sequential controls, but the control procedure of multi-task parallel, so must in software systems, carry out multi-task scheduling research, multi-task scheduling strategy reasonable in design, guarantee real-time, the reliability of system.
LabVIEW RT provides an approach of developing real-time TT﹠C system very easily by the ingenious combination with LabVIEW graphic programming environment and real time operating system.The present invention utilizes the scheduling feature of the preemptive type multitask of Windows XP system, cooperates the multitasking programming technology of LabVIEW software, adopts rational scheduling strategy, has guaranteed the real-time of system.In this integrated control system, Control Software mainly realizes following several real-time tasks:
(1) external data acquisition tasks external data acquisition tasks need capture the variation of each port status of PLC in real time, and in time data transmission is handled to system control module, so its priority is the highest.
(2) system's control task is handled in real time to outer input data, and exports control signal according to data processed result at once, the subtask that control is corresponding.To the control of hot job, priority is identical with the priority of external data acquisition tasks.Non-emergent control task priority is taken second place.
(3) warning task warning task does not often take place, and when producing fault-signal, must handle in real time, so that its priority must be made as is the highest.
(4) system dynamics shows that dynamic demonstration task comprises in task and the data preservation task integrated system: PLC, running status servo and vision detection system show specimen size and image demonstration etc.This task right and wrong time is critical, so its priority is lower than the priority of tasks such as external data collection.The data task of preserving only is to preserve some process datas, and its priority is made as minimum.
Multitask under the LabVIEW environment: the LabVIEW as the data stream programming language can support multitasking programming well.The most typical example of multitask is exactly independently While circulation among the LabVIEW.
" in the multitask application program process on exploitation LabVIEW platform, the present invention drives in conjunction with Fixed Time Interval scheduling, real-time event according to the setting of priority and the selection of executive system the multi-task scheduling strategy, has formulated a cover multi-task scheduling strategy.
Based on the feasibility and the ease for operation of LabVIEW multi-task scheduling strategy, above-mentioned multi-task scheduling strategy successful Application has been arrived control system on the LabVIEW platform.Select 4 executive subsystems in the present invention, used 3 priority.
Consider the real-time requirement of system, the priority of external data collection, system alarm task and system's control task all is set to High Priority; Dynamically the priority of demonstration task is made as Above NormalPriority; The priority that data are preserved task is Normal Priority.In operational process, selected the task of High Priority priority that order is carried out, first task is carried out certain hour, will be placed to rear of queue, and second task will continue to carry out, and the like.Though external data acquisition tasks, warning task and system's control task all are in same priority, executive subsystem is different, can guarantee three task real time executions fully.
The external data acquisition tasks that priority is the highest adopts the Fixed Time Interval strategy to dispatch, it has set up Wait to wait for function, and therefore its actual execution time can be left the remaining time in each cycle for low priority task and use much smaller than its stand-by period (250ms).Equally, tasks such as dynamically demonstration, data preservation have also constituted the priority query of oneself, and task also is that order is carried out.If run into high-priority task, will be suspended, finish up to the high-priority task operation.
Warning task in the system adopts the event-driven scheduling strategy.In system's operational process, the warning task is in waiting status always, is responsible for judging whether to satisfy alert if by system's control task module, if satisfy alert if, alert event just is set; The warning task will be activated after receiving alert event, carries out warning function.
The present invention realizes that the impact specimen machining center is the plant integral system of link, multistation conversion operations of multiplex (MUX), in the system integrated use mechanical, electrical, light, hydraulic pressure and computer hardware technique, realize the full-automation of measurement and technological process, can finish the disposable automatic process of expecting qualified impact specimen output from blank.
The full-automatic processing of impact specimen of the present invention, blank milling sub-material → test specimen surface working → test specimen v-notch milling.3 feature machining parts: four metal saw sub-material millings, high-speed plane milling, v-notch moulding, sub-material milling partly are responsible for blank sub-material link, a big blank are milled into single test specimen blank of three identical sizes; High-speed milling partly is responsible for the surface working on four planes of impact specimen, 6 workpiece of time processing; The v-notch milling partly utilizes profile milling cutter to process v-notch on sample.
Embodiment
The impact specimen automatic processing system is the plant integral system of link, multistation conversion operations of multiplex (MUX), in the system integrated use mechanical, electrical, light, hydraulic pressure and computer hardware technique, realize the full-automation of measurement and technological process, can finish the disposable automatic process of expecting qualified impact specimen output from blank.
The process of impact specimen is divided into 3 road process procedures: blank milling sub-material → test specimen surface working → test specimen v-notch milling.Therefore, correspondingly impact specimen machining center general structure is divided into 3 feature machining parts, shown in figure .1: four metal saw sub-material millings, high-speed plane milling, v-notch moulding, each part are responsible for a class processing technology link of sample.Blank sub-material link partly is responsible in the sub-material milling, a big blank is milled into single test specimen blank of three identical sizes; High-speed milling partly is responsible for the surface working on four planes of impact specimen, 6 workpiece of time processing; The v-notch milling partly utilizes profile milling cutter to process v-notch on sample.
As shown in Figure 1, total system comprises that by comprising kinetic control system the integrated control system of PLC control subsystem and servocontrol subsystem and vision detection system is carried out control.Software development environment LabVIEW, the VISA of virtual instrument (Virtual Instrument Software Architecture) function library and RTSI technology organically become one PLC control subsystem, servocontrol subsystem, vision detection system, have formed a cover multi-task scheduling tactical software.
In the work flow of impact specimen, the PLC subsystem controls most of sequentially-operating of machining center.The feeding control of servocontrol subsystem responsible machining center each several part.Selected for use America NI company to build hardware platform in the system, controlled Tool in Cutting feeding and the setting movement of worktable speed change based on hardware PCI-7358 8 axis motion control cards and Panasonic's AC servo of virtual instrument technique; With the LabVIEW software programming control program of servo-drive system, make controlling object according to the operation of desired parameter.The communication relation of the technological process that the impact specimen machining center is detailed and each link and mechanical arm as shown in Figure 3.
Integrated control system is the brain of impact specimen machining center, is the basis of realizing the integrated automatic processing of impact specimen.
The hardware of system mainly is made up of computer hardware platforms and hardware interface module.Computer hardware platforms can be various types of computing machines, is the main body of this hardware system, is managing the hardware and software resource of system, is mainly used to provide the data processing performance of real-time high-efficiency.Hardware interface module comprises instrument hardware and various general purpose interface bus, is mainly used to collection, transmission signals.Interface hardware inputs or outputs signal according to different standard interface bus conversions, uses for other system, and forming on this basis with the virtual instrument is the virtual instrument system of core.
Application software is the key of system's operation.Application software of the present invention mainly comprises: integrated development environment, with advanced interface (I/O interface), the instrument drivers of instrument hardware.The present invention adopts the graphical programming language of virtual instrument technique, and programming is simple, directly perceived, development efficiency is high.
Instrument drivers is one of ingredient important in the whole test system, is used for realizing the communication and the control function of instrument hardware.That the present invention adopts is the The interchangeable virtual instruments standard I VI of America NI company, and energy freely exchange instrument hardware and need not to revise test procedure, makes procedure development be totally independent of hardware.
The I/O interface software is the basis of system software, is used for the basic communication protocol that is connected between process computer and instrument hardware.Current virtual instrument testing software all is based upon on the generic core of a standardization I/O interface software assembly, for the user provides an application programming interface unanimity, that stride computer platform (API), make user's test macro can select different computer platforms and instrument hardware.
Integrated control system is being monitored each step action of system, through the whole process of sample processing.Integrated control system comprises kinetic control system and vision detection system: kinetic control system need be controlled each action in the process, vision detection system then is responsible for specimen size and shape are detected, and needs synchronous coordination work between them.
Kinetic control system is divided into two parts: a part is the PLC control system, realizes the sequential control of work flows such as workpiece conveying, clamping location; Another part is a servo-control system, is responsible for control of tool feeding precision and table feed control.In the sample process, kinetic control system gets when certain release and triggers vision detection system in real time; Vision detection system is also wanted real-time test samples size and shape, and in time gives kinetic control system information feedback, the real-time communication of necessary energy, co-ordination between them.Therefore, adopt the NI virtual instrument technique to come seamlessly integrated kinetic control system and vision detection system.
Sample expects that from blank finished product need pass through sub-material, plane processing, mill 3 main process of v-notch in the present invention, and the PLC control system is divided into sub-material milling link, plane processing link and v-notch milling link.
In the sub-material controlling unit, the milling sub-material of blank is realized that by servo-drive system what PLC mainly was responsible for is the control that the process control of blank material loading, sub-material finish back feeding process.Its course of work is as follows: after the PLC system start-up, mechanical arm is delivered to blank on the worktable; After blank is expected the position, the clamp blank; Start servo-drive system and begin the milling sub-material, a blank material is divided into three blocks of blanks that wait size; The sub-material milling is got the material signal to mechanical arm after finishing, and the small powder of branch is sent into next procedure.
In v-notch milling controlling unit: finger feed then positions arrangement to sample to worktable; The v-notch fraise jig clamps sample, starts the milling machine spindle motor simultaneously; Give trigger pip of motion control card, motion control card drives milling cutter and worktable action, under the Machine Vision Detection system coordination, V-shaped groove is carried out milling, up to satisfying the processing sample accuracy requirement.
Three controlling units of PLC system are separate but also mutual restriction not only.For example, when the first storing district was full, system must allow mechanical arm get to expect the milling district, otherwise the sample of blank sub-material link following process is just laid nowhere; But the district of milling at this moment may also carry out milling to preceding batch to be tested, does not allow finger feed.This just requires must have the design of a coordination between sub-material milling and two controlling units of slabbing, such as when above-mentioned situation occurring, should allow milling sub-material link stop action, after the sample in the first storing district is taken away by mechanical arm, start working again.Realize three co-ordinations between the controlling unit, will adopt some conditioned signals logical relation to handle, make the action " interlocking " that some can not carry out simultaneously between each controlling unit, thereby avoid three phase mutual interference between controlling unit.
The communication of PLC comprises between the PLC, communicating by letter between PLC and the host computer and between PLC and other smart machines.PLC and computing machine can be directly or are linked to each other by communications processor element, communication adapter and to constitute network, to realize the exchange of information.In the present invention, the FPO PLC of Panasonic utilizes private cable to pass through RS-232 serial ports connection computing machine, communication protocol (MEWTOCOL) according to SUNX disposes the serial communication parameter on the communication template of FPWINGR, based on the signal procedure of LabVIEW software and VISA function library exploitation PLC.
VISA (Virtual Instrument Software Architecture) is the abbreviation of virtual instrument software structural system, being the socket library of controlling VXI, GPIB, RS232 and other kind quasi-instrument on all LabVIEW platforms, is a kind of standard I/O application programming interfaces that are used for the instrument programming.More than 90 I/O handling function that has nothing to do with the Instrumental Physics interface type arranged in the VISA java standard library, can control multiple instrument and equipment.It not only provides the control function that is simple and easy to usefulness collection, and powerful instrument control function and resource management is provided, and interoperability and compatibility between instrument can be provided.
Compare with the serial communication program of language developments such as C, VC, VB, LabVIEW is realizing that serial communication and follow-up analysis, storage and demonstration etc. are more directly perceived, fast, and has the style of virtual instrument.LabVIEW has 5 serial communication nodes, comprises that initialization port, serial ports are write, serial ports is read, detects byte number in the serial ports input-buffer, function such as serial ports interruption.Realize that with LabVIEW and VISA storehouse the step of PLC serial communication is as follows:
(1) initialization serial ports and set desired each parameter of PLC serial port communicating protocol;
(2) the plc data frame is carried out XOR and calculate, draw the BCC check code, and the whole Frame packing that comprises the BCC check code;
(3) whole command frame is sent to serial ports, the acknowledgement frame of PLC is waited in time-delay;
(4) read the acknowledgement frame that the PLC serial ports returns;
(5) acknowledgement frame of PLC is unpacked, and reading corresponding data.
AC servo driver element of the present invention has three kinds of control models, i.e. speed control mode, position control mode and torque control model.The main difference point of these three kinds of control models is that the reference value difference imported, the amount that they are imported are respectively that speed reference (aanalogvoltage), reference by location (digit pulse), moment of torsion are with reference to (analog current)
[36]In Panasonic's AC servo that this machining center adopts,, just can realize the switching of position, speed and three kinds of control models of torque by in servo-driver, carrying out the parameter setting.
Adopt trapezoidal acceleration and deceleration control mode in the system, moving component can reach given speed in the extremely short time, and can accurately locate in high-speed cruising, and the process motion is steadily impacted little.
In this servo-drive system, last level controller adopts the NI PCI-7358 of company 8 axis motion control cards, and servo drive unit is selected the Minas A4 of Panasonic series MBDDT2210 AC servo driver for use.Because hardware compatibility issue, the PCI-7358 motion control card can't directly be connected with the Panasonic servo-driver, selects third party's motor-driven general-purpose interface UMI-7764 for use, as the connection bridge between the two.68 needle movement I/O signals of motion control card are received on the UMI-7764, and then the output end signal of UMI-7764 is connected with the Panasonic motor servo driver, thereby realize going up the control of level controller servomotor.
Software of the present invention as shown in Figure 3.
Under graphical programming language LabVIEW environment, utilize the intuitive of test control efficiently graphical development function to be aided with NI-Motion movement function storehouse and Motion Assistant, simplified writing of servo-drive system software greatly, shortened system development cycle.
Servo-drive system software: this servo-drive system mainly is responsible for the speed Control of worktable and the control of cutter straight-line feed positional precision, and servo programe just exists as the subroutine of controlling integrated system.So servo programe can be divided into following main submodule: the control card initialize routine, sub-material milling control program (comprises sub-material worktable variable motion subroutine, sub-material milling cutter movement locus control subprogram), the slabbing program (comprises emery wheel tool setting subroutine, emery wheel Z to Y to the feeding subroutine), v-notch milling program (comprises v-notch milling cutter feeding subroutine, worktable variable motion subroutine), servo-drive system kinematic parameter setting program, emery wheel reconditioning program, the state of a control display routine, servo-drive system alert program etc.The software configuration of system is shown in figure .12.
In servo software systems, initialize routine, state of a control display routine and servo alert program just exist as auxiliary routine; Of paramount importance is motion-control module, and it has comprised sample and has processed needed whole servo feed program, is directly determining the success or failure of sample processing.At this, briefly introduce the several steps that utilizes LabVIEW and NI-Motion function library to design the servo feed program:
(1) initialization motion controller, be provided with channel number and the axle number;
(2) be written into various kinematic constraints such as speed, acceleration, retarded velocity and acceleration and deceleration pattern;
(3) displacement model of controlling object is set, is written into displacement (unit is pulse);
(4) be written into " motion beginning " program module, servo-drive system begins action;
(5) load While loop circulation, and, judge by the latter whether system runs to designated displacement in inner " displacement demonstrations " module and " whether judging the moves finishes " module of importing of circulation, thus whether stop motion of decision systems;
(6) be written into " motion stopping modular " and reach " system mistake processing " module.
Integrated control system of the present invention is made of kinetic control system (comprising PLC subsystem and servo-drive subsystem) and vision detection system.Realize high-level efficiency, high-precision real-time control, just must be kinetic control system and vision detection system organic integration, must can real-time communication between them, the synchronous coordination operation, so utilize virtual instrument software development platform LabVIEW and RTSI technology to come integrated system seamlessly.
Software of the present invention must be able to satisfy requirements such as real-time collection external signal, steering order output in real time, system alarm, process supervision.The present invention sets up the multithreading model of impact specimen machining center integrated system Control Software according to the multi-thread mechanism of Windows system and LabVIEW software, management in the system, control function is realized dividing make several modules, places independently thread respectively.According to requirements of actual production, system controlling software is divided into lower module: hardware initialization module, parameter are provided with module, external signal acquisition module, system control module, fault diagnosis module, data preservation module, system dynamics display module.
In fact, system control module is the scheduling core of software systems, and the every circulation primary of this module is just handled outer input data, calls corresponding subtask according to result; Not then moved by the task of its control as parallel subtask.Many subtasks in the system work process are not simple sequential controls, but the control procedure of multi-task parallel, so must in software systems, carry out multi-task scheduling research, multi-task scheduling strategy reasonable in design, guarantee real-time, the reliability of system.
LabVIEW RT provides an approach of developing real-time TT﹠C system very easily by the ingenious combination with LabVIEW graphic programming environment and real time operating system.
For the scheduling feature of the preemptive type multitask of the present invention by rationally utilizing Windows XP system, cooperate the multitasking programming technology of LabVIEW software, adopt rational scheduling strategy, guarantee the real-time of system.In this integrated control system, Control Software mainly realizes following several real-time tasks:
(1) external data acquisition tasks external data acquisition tasks need capture the variation of each port status of PLC in real time, and in time data transmission is handled to system control module, so its priority is the highest.
(2) system's control task is handled in real time to outer input data, and exports control signal according to data processed result at once, the subtask that control is corresponding.To the control of hot job, priority is identical with the priority of external data acquisition tasks.Non-emergent control task priority is taken second place.
(3) warning task warning task does not often take place, and when producing fault-signal, must handle in real time, so that its priority must be made as is the highest.
(4) system dynamics shows that dynamic demonstration task comprises in task and the data preservation task integrated system: PLC, running status servo and vision detection system show specimen size and image demonstration etc.This task right and wrong time is critical, so its priority is lower than the priority of tasks such as external data collection.The data task of preserving only is to preserve some process datas, and its priority is made as minimum.
Warning task in the system adopts the event-driven scheduling strategy.In system's operational process, the warning task is in waiting status always, is responsible for judging whether to satisfy alert if by system's control task module, if satisfy alert if, alert event just is set; The warning task will be activated after receiving alert event, carries out warning function.
In order to make whole integrated system possess appropriate functional, information change in a plurality of tasks, transmission must be orderly, and the data transmission between them can be used local variable and global variable, but that it accounts for system resource is bigger, to use cautiously, otherwise will influence the real-time of system.
Technical requirement to vision-based detection
The size of the sample that Charpy-type test is required, shape, surface quality and form and position tolerance are guaranteed by servocontrol, anchor clamps and locating device, vision system mainly carries out size and dimension to the impact specimen behind the milling v-notch and detects, and the monitor message of motion control and machining state and quality is provided for control system.The measurement parameter of v-notch is:
(1) measurement of angle, the both sides of at first adopting rake shape range searching match V-arrangement angle mouth adopt 4 angle measurement degree to obtain the angle value that will survey.
(2) measurement of bottom arc radius comes match and obtains the coordinate in the center of circle and the radius image distance of circular arc by radiation search.
(3) minimum point of bottom circular arc and the distance between the part edge are measured in the measurement of the degree of depth.
Carry out measuring for 3 times averaged as measurement result in carrying out the process of measuring, flow chart is seen appendix.In actual mechanical process, if desired parameter is provided with or shows that specimen size and real image, user only need to click corresponding button, operate very easy, directly perceived.Be set to example with sub-material milling parameter, when system controlling software is in running status, click " setting of sub-material milling parameter " button, the parameter that just can jump out shown in figure .19 is provided with the interface, the user can change the parameter on the panel according to actual needs arbitrarily, preserve, withdraw from panel is set after, integrated control system will be according to set parameter operation.