Summary of the invention
The weak points such as the performance history for existing CNC is complicated, systemic-function is difficult to checking, test process is loaded down with trivial details and the hardware environment dependence is strong, the present invention proposes a kind of meet functional module test, entire system control functional test, reduces the method for designing of the hardware of system testing risk and cost in number of rings control system control structure.
For solving the problems of the technologies described above, the technical solution used in the present invention is:
Hardware, in the method for designing of number of rings control system control structure, comprises the following steps:
, according to functional characteristic and the demand for control of digital control system, build the simulation running environment of CNC in digital control system;
Connect CNC and simulation running environment by fieldbus, carry out two-way, real-time, reliable data communication;
Carry out the processing test procedure by CNC, integral control function in CNC or certain functional modules are carried out the machining simulation test;
According to the machining control information of test process, the control operation of the device beyond CNC in the simulation digital control system in simulation running environment, the process of demonstration workpiece;
According to form and the detecting information of workpiece processing, whether function, the performance of checking CNC meet the demands.
Building the CNC simulation running environment comprises the following steps:
Foundation meets the real time operating system environment of CNC real-time testing requirement;
, according to the requirement of CNC machining control, set up the mathematical model of the equipment beyond CNC in digital control system;
, according to mathematical model, utilize the machining control operation of the equipment beyond CNC in simulation software simulation digital control system;
Show the essential information of the equipment beyond CNC in digital control system and the process of workpiece;
Set up the communication functions interface, realize the sending/receiving of control information.
CNC entire system control function is carried out the machining simulation test to be comprised the following steps:
At first, CNC sends the control command of current period to simulation running environment;
Simulation running environment, according to the control command of the mathematical model of setting up and reception, is carried out the system operation of appointment, adopts graphics mode simulation workpiece process, and returns to the response message of control command;
CNC, according to the response message of obtaining and current system state, calculates the control command of next communication cycle, repeats above-mentioned periodic communication process, until the emulation testing process finishes or by the user, interrupted.
System function module test in CNC is comprised the following steps:
According to the test request of system function module, functional module to be tested is written in CNC;
Carry out the processing test procedure by CNC, send the control command of current period to simulation running environment;
Simulation running environment, according to the control command of the mathematical model of setting up and reception, is carried out the system operation of appointment, adopts graphics mode simulation workpiece process, and returns to the response message of control command;
CNC, according to the response message of obtaining and current system state, calculates the control command of next communication cycle;
Repeat above-mentioned periodic communication process, until the emulation testing process finishes or by the user, interrupted;
Regulate configuration parameter and the machining control instruction of CNC, the critical condition of checking functional module to be tested;
Show current system state and machining simulation result.
Described simulation running environment can also be simulated CNC, tests the functional characteristic of its external unit, and test comprises the following steps:
Set up the mathematical model of CNC, adopt the CNC of simulation running environment simulation appointment;
In each communication cycle, by simulation running environment, to external unit, send control command;
External unit, according to the control command that obtains, is carried out the system operation of appointment, and response message is returned to simulation running environment;
Simulation running environment, according to mathematical model and the device responds information set up, calculates the control command of next communication cycle, repeats above-mentioned periodic communication process, until simulation process finishes or by the user, interrupted.
Simulation running environment also is used for the test site bus, and step is:
Articulate bus diagnostic equipment by fieldbus, the communications status of collection site bus and the communication data of equipment to be determined;
Show the communication data that gathers, be used for the dynamic interaction process of analyzing numerically controlled device and simulation running environment.
The present invention is beneficial effect and advantage compared with prior art:
1. improve the quality level of system development design.By adopting digital control system control structure and the simulation running environment of hardware at ring, the functional module test of CNC can be carried out at the design initial stage, effectively reduce the mistake and the defect that exist in the CNC performance history.In addition, designed system architecture can also detect the drive unit of CNC outside, facilitates development and Design and the checking of hardware driving device.
2. reduce the test risk.In the Verify in System process, some functional test exists the test risk of height, as collision detection, High-speed machining test, multi-channel synchronous control, power down protection etc.By adopting the digital control system control structure of hardware at ring, realize the test and validation of high-risk systemic-function in the analogue system environment, not only guarantee the accuracy of test process, and avoided the mishaies such as device damage, personnel's injury to occur.
3. reduction testing cost.In existing measuring technology, building of hardware environment requires a great deal of time and fund,, as buying opertaing device, builds numerically controlled machining platform, completes the basic operations such as line, configuration of hardware device.Simultaneously, also can, because the extraneous factor impact causes the repeatability checking, spend a large amount of test durations in the processing test process.The present invention adopts the digital control system control structure of hardware at ring, can effectively meet the test request of digital control system, avoids the steps such as buying, configuration of hardware device in early stage test process, reduces the processing test of repeatability, reduces testing cost.
Embodiment
Below in conjunction with drawings and Examples, the present invention program is described in further detail:
Embodiment 1
As shown in Figure 3, be the method for designing process flow diagram of hardware in number of rings control system control structure.The design philosophy that the present invention adopts field bus technique and hardware encircling, the method for designing of a kind of hardware in number of rings control system control structure proposed, meet functional module test, entire system in the system development design process and control the application demands such as functional test, improve quality level and the reliability of system development, reduce test risk and cost, reduce the test duration of system.
This inventive method hardware, in the method for designing of number of rings control system control structure, comprises the following steps:
, according to functional characteristic and the demand for control of digital control system, build the simulation running environment of CNC in digital control system;
Connect CNC and simulation running environment by fieldbus, carry out two-way, real-time, reliable data communication;
Carry out the processing test procedure by CNC, integral control function in CNC or certain functional modules are carried out the machining simulation test;
According to the machining control information of test process, the control operation of the device beyond CNC in the simulation digital control system in simulation running environment, the process of demonstration workpiece;
According to form and the detecting information of workpiece processing, whether function, the performance of checking CNC meet the demands.
Building the CNC simulation running environment comprises the following steps:
Foundation meets the real time operating system environment of CNC real-time testing requirement;
, according to the requirement of CNC machining control, set up the mathematical model of the equipment beyond CNC in digital control system;
, according to mathematical model, utilize the machining control process of the equipment beyond CNC in simulation software simulation digital control system;
Show the essential information of the equipment beyond CNC in digital control system and the process of workpiece;
Set up the communication functions interface, realize the sending/receiving of control information.
System function module test in CNC is comprised the following steps:
According to the test request of system function module, functional module to be tested is written in CNC;
Carry out the processing test procedure by CNC, send the control command of current period to simulation running environment;
Simulation running environment, according to the control command of the mathematical model of setting up and reception, is carried out the system operation of appointment, adopts graphics mode simulation workpiece process, and returns to the response message of control command;
CNC, according to the response message of obtaining and current system state, calculates the control command of next communication cycle;
Repeat above-mentioned periodic communication process, until the emulation testing process finishes or by the user, interrupted;
Regulate configuration parameter and the machining control instruction of CNC, the critical condition of checking functional module to be tested;
Show current system state and machining simulation result.
As shown in Fig. 4, Fig. 4 A, Fig. 4 B, for system function module at hardware the test structure figure in loop systems, in embodiment 1, according to the requirement of CNC machining control, set up the mathematical model of the equipment beyond CNC in digital control system, this model can be purchased and buy to the device fabrication of appointment; Functional requirement according to foundation mathematical model and digital control system, determine the basic function module of simulation running environment, functional module as external units such as emulation servo drive, main shaft driving device, nc machining simulation display module, IO devices, generate the control structure relation of each copying module according to the hardware configuration of numerically-controlled machine, build the simulation running environment of CNC, its emulation servo drive comprises emulation controller, simulated current amplifier, and the hardware configuration of numerically-controlled machine comprises leading screw, worktable, workholder etc.
Emulation testing process to certain certain functional modules of control structure in CNC: according to the test request of system function module, functional module to be tested is written into CNC; , by CNC operation processing test procedure, carry out control function and the algorithm of functional module to be tested; CNC sends the control command of current period to simulation running environment; Simulation running environment, according to the control command that receives, is transmitted to emulation controller with it, by emulation controller, is converted into analog current signal, sends to the simulated current amplifier, carries out the control operation of appointment, and operating result is returned to CNC; In simulation running environment, adopt graphics mode simulation workpiece process; CNC, according to the response message of obtaining and current system state, calculates the control command of next communication cycle, repeats above-mentioned periodic communication process, until the emulation testing process finishes or by the user, interrupted.
Regulate configuration parameter and the machining control instruction of CNC, the critical condition of checking functional module to be tested; Show current system state and machining simulation result in simulation running environment, be used for analyzing the functional characteristic and execution efficiency of functional module to be tested.
Above-mentioned control command comprises: connect, the communication instructions such as equipment is opened, setting parameter, synchronous/asynchronous motion control; Response message comprises: whether complete etc. communications status, instruction executing state, location/velocity information, location; System state and machining simulation information comprise: the state of drive unit, parameter, Machine-Tool Control information etc.
Test to the functional module of CNC further illustrates: the functional block model of first setting up CNC, the basic interface information of statement functional module, comprising: the functional module information such as data input/output interface, event input/output interface, initiation parameter interface, state of a control, control algolithm, built-in variable; Describe according to the control algolithm of functional block model and appointed function module, realize required functional module; Functional module is loaded in the control structure of CNC, described functional module comprises human-computer interface module, interpreter module, trajectory planning module, interpolation algorithm module; Adopt fieldbus to connect CNC and simulation running environment; Carry out the processing test procedure of appointment, and regulate the configuration parameter of CNC, comprise range, maximal rate/acceleration limit, the departure parameter of each driving shaft; The machine-shaping process that shows workpiece by methods such as nc machining simulation two dimension or three-dimensional solid modelings; According to form and the departure of workpiece processing, whether the control function of checking CNC meets application demand.If not meeting test request, the operational staff searches in digital control system and controls the errors and problems that function may exist, and revises relevant functional module, reaches required control requirement.
CNC entire system control function is carried out the machining simulation test to be comprised the following steps:
At first, CNC sends the control command of current period to simulation running environment;
Simulation running environment, according to the control command of the mathematical model of setting up and reception, is carried out the system operation of appointment, adopts graphics mode simulation workpiece process, and returns to the response message of control command;
CNC, according to the response message of obtaining and current system state, calculates the control command of next communication cycle, repeats above-mentioned periodic communication process, until the emulation testing process finishes or by the user, interrupted.
Embodiment 2
As shown in Figure 5, for entire system control functional test at hardware the test structure figure in loop systems, in the present embodiment 2, on the basis of simulation running environment in embodiment 1, also needing increases corresponding copying module according to the testing requirement of CNC integral control function.
Entire system is controlled the machining simulation test process of function: according to the processing test request of digital control system, determine the basic function module of digital control system, comprise human-computer interface module, interpreter module, trajectory planning module, interpolation algorithm module, cutter compensation module, spatial kinetics conversion; Carry out the processing test procedure of appointment in CNC, the machining control process of checking CNC; In simulation running environment, according to the steering order of obtaining, the actual process of simulation numerically-controlled machine:
Obtain by fieldbus the control information that CNC sends; In emulation controller, control information is processed, be converted to corresponding analog current information; Analog current information sends to the emulation motor after the simulated current amplifier, control the turned position/speed of emulation motor; The rotation process of emulation motor is transformed to the rectilinear motion of the relative machining spindle of worktable after the transmission of leading screw, thereby realizes the machining simulation motion control of workpiece; In the motion control process, can detect by sensor the positional information of workpiece motion s, and this information is returned to CNC, realize closed loop control function, to improve the machining precision of numerically-controlled machine; Show the machine-shaping process of basic structure, kinematic relation, lathe coordinate system, cutter, fixture and the workpiece of lathe in simulation running environment;
In the middle of test process, the information such as the configuration parameter of adjusting CNC, operator scheme, processing instruction, the critical condition judgement of Trigger Function inside modules, realize the processing test of the high-risk systemic-functions such as collision detection, security control action, alarm processing, the integral control function of checking numerical control device.
Embodiment 3
As shown in Figure 6, for the motion drive unit at hardware the test structure figure in loop systems, described simulation running environment can also be simulated CNC, tests the functional characteristic of its external unit, test comprises the following steps:
Set up the mathematical model of CNC, adopt the CNC of simulation running environment simulation appointment;
In each communication cycle, by simulation running environment, to external unit, send control command;
External unit, according to the control command that obtains, is carried out the system operation of appointment, and response message is returned to simulation running environment;
Simulation running environment, according to mathematical model and the device responds information set up, calculates the control command of next communication cycle, repeats above-mentioned periodic communication process, until simulation process finishes or by the user, interrupted.
In the present embodiment 3, set up the mathematical model of emulation CNC, this mathematical model is the functional block model of CNC, comprises data input/output interface, event input/output interface, initiation parameter interface, state of a control, control algolithm, built-in variable; , according to the major function of the functional block model of setting up and CNC, adopt programming software to realize the copying modules such as man machine operation interface, task controller, motion controller, soft PLC; Generate the steering logic relation of each copying module according to the control structure of CNC, build the formation simulation running environment; Carry out the processing test procedure in emulation CNC, treat testing apparatus and carry out emulation testing, as motion drive unit and motor; In each communication cycle, emulation CNC sends corresponding control command to above-mentioned external unit, carries out test and validation.
Embodiment 4
As shown in Figure 7, for fieldbus at hardware the test structure figure in loop systems, simulation running environment also is used for the test site bus, step is:
Articulate bus diagnostic equipment by fieldbus, the communications status of collection site bus and the communication data of equipment to be determined;
Show the communication data that gathers, be used for the dynamic interaction process of analyzing numerically controlled device and simulation running environment.
In the present embodiment 4, by fieldbus, articulate bus diagnostic equipment, the communications status of collection site bus and the communication data of equipment to be determined, as show sending/receiving information, collection communication data of communications status, the designated equipment of current fieldbus etc.Image data information comprises: call duration time, address, control bit mark, size, communications status, control command, command execution state etc.
Simulation running environment is the extensive diagnostic functional module on the basis of the embodiment of above-mentioned functional module test or allomeric function test,, by computer interface connection diagnostic equipment, obtains the communication data of fieldbus;
Show the communication data that gathers in simulation running environment, analyze the dynamic interaction process of CNC and simulation running environment, judge whether its control operation, state variation satisfy specified requirement.
Image data is as shown in the table:
Date |
Adrr |
CTRL |
Size |
Err |
Da |
ta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
5 |
31 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
7 |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
EA |
FE |
FF |
FF |
49 |
32 |
0 |
0 |
32 |
8 |
0 |
25 |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
F0 |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
18 |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
ED |
FE |
FF |
FF |
32 |
32 |
0 |
0 |
32 |
0 |
0 |
36 |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
DB |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
29 |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
EE |
FE |
FF |
FF |
1C |
32 |
0 |
0 |
32 |
18 |
0 |
47 |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
C6 |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
3A |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
EF |
FE |
FF |
FF |
6 |
32 |
0 |
0 |
32 |
0 |
0 |
58 |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
B1 |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
4B |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
F1 |
FE |
FF |
FF |
EF |
31 |
0 |
0 |
32 |
10 |
0 |
69 |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
9C |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
5C |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
F0 |
FE |
FF |
FF |
DB |
31 |
0 |
0 |
32 |
10 |
0 |
7A |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
88 |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
6D |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
F2 |
FE |
FF |
FF |
C4 |
31 |
0 |
0 |
32 |
18 |
0 |
8B |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
73 |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
7E |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
F4 |
FE |
FF |
FF |
AD |
31 |
0 |
0 |
32 |
8 |
0 |
9C |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
5E |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
8F |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
F5 |
FE |
FF |
FF |
98 |
31 |
0 |
0 |
32 |
18 |
0 |
AD |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
49 |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
90 |
2010.03.27 |
41 |
1 |
16 |
OK |
34 |
99 |
1C |
C0 |
F5 |
FE |
FF |
FF |
83 |
31 |
0 |
0 |
32 |
10 |
0 |
BE |
2010.03.27 |
41 |
3 |
16 |
OK |
34 |
0 |
0 |
0 |
49 |
30 |
0 |
0 |
0 |
0 |
0 |
0 |
32 |
0 |
0 |
90 |