Summary of the invention
Weak points such as the performance history to 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 satisfy functional module test, the test of entire system control function, 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 scheme that the present invention adopts is:
Hardware may further comprise the steps in the method for designing of number of rings control system control structure:
According to the functional characteristic and the demand for control of digital control system, build the simulation running environment of CNC in the digital control system;
Connect CNC and simulation running environment through fieldbus, carry out two-way, real-time, reliable data communication;
Carry out the processing test procedure by CNC, integral control function in the 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 the CNC in the simulation digital control system in simulation running environment, the process of demonstration workpiece;
According to the form and the detecting information of workpiece processing, whether function, the performance of checking CNC meet the demands.
Building the CNC simulation running environment may further comprise the steps:
The real time operating system environment of CNC real-time testing requirement is satisfied in foundation;
According to the requirement of CNC machining control, set up the mathematical model of the equipment beyond the CNC in the digital control system;
According to mathematical model, utilize the machining control operation of the equipment beyond the CNC in the simulation software simulation digital control system;
Show the essential information of the equipment beyond the CNC in the digital control system and the process of workpiece;
Set up the communication functions interface, realize the transmission/reception of control information.
CNC entire system control function is carried out the machining simulation test may further comprise the steps:
At first, CNC sends the control command of current period to simulation running environment;
Simulation running environment is carried out the system operation of appointment according to the control command of mathematical model of being set up and reception, adopts graphics mode simulation workpiece process, and returns the response message of control command;
CNC calculates the control command of next communication cycle according to response message of being obtained and current system state, repeats above-mentioned cycle communication process, interrupts until the end of emulation testing process or by the user.
System function module test in the CNC may further comprise the steps:
According to the test request of system function module, functional module to be tested is written among the CNC;
Carry out processing test procedure, the control command of sending current period to simulation running environment by CNC;
Simulation running environment is carried out the system operation of appointment according to the control command of mathematical model of being set up and reception, adopts graphics mode simulation workpiece process, and returns the response message of control command;
CNC calculates the control command of next communication cycle according to response message of being obtained and current system state;
Repeat above-mentioned cycle communication process, interrupt until the end of emulation testing process or by the user;
Regulate configuration parameter and the machining control instruction of CNC, verify the critical condition of functional module to be tested;
Show current system state and machining simulation result.
Said simulation running environment can also be simulated CNC, tests the functional characteristic of its external unit, and test may further comprise the 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 the external unit transmitting control commands;
External unit is carried out the system operation of appointment according to the control command that is obtained, and response message is returned simulation running environment;
Simulation running environment calculates the control command of next communication cycle according to mathematical model and the device responds information set up, repeats above-mentioned cycle communication process, interrupts until the simulation process end or by the user.
Simulation running environment also is used for the test site bus, and step is:
Articulate bus diagnostic equipment through fieldbus, the communications status of collection site bus and the communication data of equipment to be determined;
Show the communication data of gathering, 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.Through 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 in design initial, effectively reduce the mistake and the defective that exist in the CNC performance history.In addition, the system architecture that is designed can also detect the outside drive unit of CNC, makes things convenient for the development and Design and the checking of hardware driving device.
2. reduce the test risk.In the system verification process, some functional test exists the test risk of height, like collision detection, High-speed machining test, multi-channel synchronous control, power down protection etc.Through adopting the digital control system control structure of hardware at ring, in the analogue system environment, realize the test and validation of high-risk systemic-function, not only guarantee the accuracy of test process, and avoided mishaies such as device damage, personnel's injury to take place.
3. reduction testing cost.Building of hardware environment requires a great deal of time and fund in the existing measuring technology, as buying opertaing device, builds numerically controlled machining platform, basic operations such as the line of completion hardware device, configuration.Simultaneously, also can spend a large amount of test durations in the processing test process owing to the extraneous factor influence causes the repeatability checking.The present invention adopts the digital control system control structure of hardware at ring, can effectively satisfy the test request of digital control system, avoids the steps such as buying, configuration of hardware device in the early stage test process, reduces the processing test of repeatability, reduces testing cost.
Embodiment
Below in conjunction with accompanying drawing and embodiment 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; Satisfy application demands such as functional module test, the test of entire system control function in the system development design process; Improve the quality level and the reliability of system development, reduce test risk and cost, reduce the test duration of system.
This inventive method hardware may further comprise the steps in the method for designing of number of rings control system control structure:
According to the functional characteristic and the demand for control of digital control system, build the simulation running environment of CNC in the digital control system;
Connect CNC and simulation running environment through fieldbus, carry out two-way, real-time, reliable data communication;
Carry out the processing test procedure by CNC, integral control function in the 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 the CNC in the simulation digital control system in simulation running environment, the process of demonstration workpiece;
According to the form and the detecting information of workpiece processing, whether function, the performance of checking CNC meet the demands.
Building the CNC simulation running environment may further comprise the steps:
The real time operating system environment of CNC real-time testing requirement is satisfied in foundation;
According to the requirement of CNC machining control, set up the mathematical model of the equipment beyond the CNC in the digital control system;
According to mathematical model, utilize the machining control process of the equipment beyond the CNC in the simulation software simulation digital control system;
Show the essential information of the equipment beyond the CNC in the digital control system and the process of workpiece;
Set up the communication functions interface, realize the transmission/reception of control information.
System function module test in the CNC may further comprise the steps:
According to the test request of system function module, functional module to be tested is written among the CNC;
Carry out processing test procedure, the control command of sending current period to simulation running environment by CNC;
Simulation running environment is carried out the system operation of appointment according to the control command of mathematical model of being set up and reception, adopts graphics mode simulation workpiece process, and returns the response message of control command;
CNC calculates the control command of next communication cycle according to response message of being obtained and current system state;
Repeat above-mentioned cycle communication process, interrupt until the end of emulation testing process or by the user;
Regulate configuration parameter and the machining control instruction of CNC, verify the critical condition of functional module to be tested;
Show current system state and machining simulation result.
Shown in Fig. 4, Fig. 4 A, Fig. 4 B; For system function module at the test structure figure of hardware in loop systems, among the embodiment 1, according to the requirement of CNC machining control; Set up the mathematical model of the equipment beyond the CNC in the digital control system, this model can be bought to the appointed equipment manufacturer; Functional requirement according to foundation mathematical model and digital control system; Confirm the basic function module of simulation running environment; Functional module like 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 CNC inner control structure:, functional module to be tested is written into CNC according to the test request of system function module; By CNC operation processing test procedure, carry out the 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 is transmitted to emulation controller according to the control command that receives with it, is converted into analog current signal by emulation controller, 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 calculates the control command of next communication cycle according to response message of being obtained and current system state, repeats above-mentioned cycle communication process, interrupts until the end of emulation testing process or by the user.
Regulate configuration parameter and the machining control instruction of CNC, verify the critical condition of functional module to be tested; In simulation running environment, show current system state and machining simulation result, be used to analyze the functional characteristic and execution efficient of functional module to be tested.
Above-mentioned control command comprises: connect, communication instructions such as equipment is opened, parameter setting, synchronous/asynchronous motion control; Response message comprises: whether accomplish 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 specifies: the functional block model of setting up CNC earlier; The basic interface information of statement functional module comprises: functional module information such as data input/output interface, incident input/output interface, initiation parameter interface, state of a control, control algolithm, built-in variable; Control algolithm according to functional block model and appointed function module is described, and realizes required functional module; Functional module is loaded in the control structure of CNC, said 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 through methods such as nc machining simulation two dimension or three-dimensional solid modelings; According to the form and the departure of workpiece processing, whether the control function of checking CNC satisfies application demand.As not satisfying test request, the operational staff searches mistake and the problem that control function possibly exist in the digital control system, revises relevant functional module, reaches required control requirement.
CNC entire system control function is carried out the machining simulation test may further comprise the steps:
At first, CNC sends the control command of current period to simulation running environment;
Simulation running environment is carried out the system operation of appointment according to the control command of mathematical model of being set up and reception, adopts graphics mode simulation workpiece process, and returns the response message of control command;
CNC calculates the control command of next communication cycle according to response message of being obtained and current system state, repeats above-mentioned cycle communication process, interrupts until the end of emulation testing process or by the user.
Embodiment 2
As shown in Figure 5; For the entire system control function is tested at the test structure figure of hardware 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.
The machining simulation test process of entire system control function: according to the processing test request of digital control system; Confirm 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; In CNC, carry out the processing test procedure of appointment, the machining control process of checking CNC; In simulation running environment, according to the steering order of being obtained, the actual process of simulation numerically-controlled machine:
Obtain the control information that CNC sends through fieldbus; In emulation controller, control information is handled, converted into the corresponding simulating current information; Send to the emulation motor behind the analog current information via simulated current amplifier, the turned position/speed of control emulation motor; Be transformed to the rectilinear motion of the relative machining spindle of worktable after the rotation process process transmission of leading screw of emulation motor, thereby realize the machining simulation motion control of workpiece; In the motion control process, can pass through the positional information of sensor workpiece motion s, and this information is returned CNC, realize the closed-loop control function, to improve machining accuracy of NC machine tool; The machine-shaping process that in simulation running environment, shows basic structure, kinematic relation, lathe coordinate system, cutter, anchor clamps and the workpiece of lathe;
In the middle of test process; Information such as the configuration parameter of adjusting CNC, operator scheme, processing instruction; Trigger the inner critical condition of functional module and judge, realize the processing test of 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 the test structure figure of hardware in loop systems, said simulation running environment can also be simulated CNC, tests the functional characteristic of its external unit, test may further comprise the 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 the external unit transmitting control commands;
External unit is carried out the system operation of appointment according to the control command that is obtained, and response message is returned simulation running environment;
Simulation running environment calculates the control command of next communication cycle according to mathematical model and the device responds information set up, repeats above-mentioned cycle communication process, interrupts until the simulation process end or by the user.
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, incident input/output interface, initiation parameter interface, state of a control, control algolithm, built-in variable; According to the major function of functional block model of being set up and CNC, adopt programming software to realize 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; In emulation CNC, carry out the processing test procedure, treat testing apparatus and carry out emulation testing, like motion drive unit and motor; In each communication cycle, emulation CNC sends control commands corresponding to above-mentioned external unit, carries out test and validation.
Embodiment 4
As shown in Figure 7, for fieldbus at the test structure figure of hardware in loop systems, simulation running environment also is used for the test site bus, step is:
Articulate bus diagnostic equipment through fieldbus, the communications status of collection site bus and the communication data of equipment to be determined;
Show the communication data of gathering, be used for the dynamic interaction process of analyzing numerically controlled device and simulation running environment.
In the present embodiment 4, articulate bus diagnostic equipment through fieldbus, the communications status of collection site bus and the communication data of equipment to be determined, as show the communications status of current fieldbus, the transmission of designated equipment/reception information, collection communication data 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, through computer interface connection diagnostic equipment, obtains the communication data of fieldbus;
In simulation running environment, show the communication data of gathering, 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 |