The little line segment of high-speed, high precision digital control processing seamlessly transits interpolating method in real time
Technical field
The present invention relates to the digital control system in CNC processing technology field, the little line segment that relates in particular to a kind of high-speed, high precision digital control processing seamlessly transits interpolating method in real time.
Background technology
During the part of numerically-controlled machine processed complex, nc program is generally generated by automatic programming method, automated programming is by CAM (Computer Aided Manufacturing, computer-aided manufacturing) software completes, conventionally in numerical control program code, comprise a large amount of continuous short line segments, the length of line segment is generally all very short, and some line segment lengths are even grade or submillimeter level, and the interpolator of digital control system carries out interpolation operation to these short line segments and obtains cutting tool path.Traditional digital control system directly be take short line segment and is carried out speed planning as unit in Interpolation Process, this interpolation mode not only causes start-stop time many, speed and acceleration fluctuation are larger, bumpy motion, and fluctuation ratio is more frequent, when serious, even cause the vibration of lathe, thereby affect working (machining) efficiency and piece surface crudy.
The literature search of prior art is found, adopt curve fitting method that continuous small route segment is carried out curve fitting, and then carry out curve interpolation operation, a lot of methods adopt Quintic spline curve (Erkorlmaz K.High speed CNC system design.Part1:Jerk limited traj ectory generation and quintic spline interpolation.International Journal of Machine Tools & Manufacture. (2001) 41:1323-1345), the parametric lines such as NURBS (Junbin Wang.Real-time NURBS interpolator:application to short linear segments.The International Journal of Advanced Manufacturing Technology. (2009) 41:1169-1185) carry out matching to linear path section.Curve fitting method is to adopt curve to carry out the alternative method of matching all short line segments of processing parts.Conventionally CAM and CNC are two separate systems, CNC system loss the original model data of CAM system, therefore, this curve-fitting method can not reduce original skeleton pattern veritably, still there is certain error with original contour model, sometimes may produce larger error, and the method calculated amount of this full curve matching is very large, is difficult to meet the requirement of real-time of digital control system.Therefore, this method is difficult to be applied to High-speed NC Machining occasion.
Summary of the invention
The object of the invention is to the problem existing in the little line segment Interpolation Process for high-speed, high precision digital control processing, provide a kind of little line segment of high-speed, high precision digital control processing to seamlessly transit in real time interpolating method, the method counting yield is high, algorithm is realized simple, can effectively improve robust motion and the working (machining) efficiency of digital control processing, can be applicable to the digital control processing occasion of high-speed, high precision.
The present invention is achieved by the following technical solutions:
The present invention includes: human-computer interface module, interpretation of programs module, cutter compensation module, rough interpolation module, essence interpolation module, wherein: human-computer interface module passes to interpretation of programs module by the nc program of part to be processed, by interpretation of programs module, nc program is carried out to program checkout and interpretation of programs, and extract the machining path information relevant with working process parameter, by cutter compensation module to machining path information, carry out cutter compensation, obtain cutter path information, this routing information is transferred to rough interpolation module, before interpolation operation, will near the transit point of every adjacent segments, adopt control vertex B-spline Curve to carry out curve transition connection, generate the continuous level and smooth cutter path of curvature, the maximum deflection difference value of this level and smooth cutter path and original route is less than or equal to the maximum error value of default, to generating, the continuous level and smooth cutter path of curvature carries out speed planning and interpolation is calculated, obtain interpolation data, finally the interpolation data of generation is transferred to smart interpolation module, essence interpolation module is through digital integration essence interpolation operation, data after processing are transported to the motion of driver drives numerically-controlled machine.
Described human-computer interface module comprises: program machining cell, track emulation unit, real-time monitoring unit, parameter management unit form, and its Program machining cell is sent to the program checkout unit in interpretation of programs module by the nc program of the part to be processed of selecting; The cutting tool path that processing parts is treated in track emulation unit carries out off-line simulation, checking in actual process, whether occurred to cut or cut less, cutting line and advance and retreat cutter mode whether reasonable; Monitoring unit obtains kinematic axis and I/O status information from motion controller in real time, and kinematic axis is carried out to real-time track demonstration and dynamic coordinate demonstration, and the I/O state of system is monitored in real time; Parameter management unit manages tool-information and kinematic parameter.
Described interpretation of programs module comprises: program checkout unit and program translation unit, wherein program checkout unit carries out lexical analysis, grammatical analysis and semantic analysis to nc program, check whether nc program exists mistake, if numerical control machining code is wrong, carry out error handling processing, otherwise, data are transported to program translation unit; Program translation unit extracts location coordinate information and the working process parameter information of kinematic axis from nc program; Interpretation of programs module is carried out real-time interpretation in multi-thread programming mode, explains in advance 5000 program segments, to meet subsequent module prediction, processes needed data message.
Described cutter compensation module comprises cutter benefit path-calculating element and cutter path adapter unit, wherein cutter track track computing unit adopts vector method to calculate cutter and mends path, according to cutter, mend path direction vector and radius vectors definition, analyze and calculate relation between the two, determine center cutter path; Cutter path adapter unit is determined and is adopted shortening type, elongation type or insert type to carry out cutter path switching according to the size at switching angle; Cutter compensation module adopts C tool function cutter compensation mode to carry out cutter compensation, the described machining profile information of nc program is converted to cutter path information, adopt multi-thread programming mode to carry out real time execution, cutter compensation that can 5000 program segments of advanced processing is that needed data message is processed in subsequent module prediction.
Described rough interpolation module comprises: generate transient curve unit, speed planning unit and interpolation operation unit, according to the cutter path information of cutter compensation module transmission, to near the transit point of every adjacent segments, adopt control vertex B-spline Curve to carry out curve transition connection, generated the continuous level and smooth cutter path of curvature; Speed planning unit adopts S shape acceleration and deceleration model to generating the continuous level and smooth cutter path of curvature, calculate the speed of feed of each interpolation cycle, the speed of feed that interpolation operation unit obtains according to speed planning is calculated the interpolation length of each interpolation cycle, and decompose to the coordinate axis that participates in motion, axis servomotor obtains the movement length of each interpolation cycle.Rough interpolation module adopts multi-thread programming and prediction processing mode to carry out real time execution, can 5000 program segment of advanced processing, avoid occurring the data phenomenon of hungering and thirst in NC Machining Process.
Described generation transient curve unit comprises: calculate every adjacent segments in cutter path length and angle, according to digital control system permissible error, determine that the switching length of line segment, adjacent segments switching line segment adopted control vertex B-spline Curve to carry out curve transition, cross control vertex B-spline Curve consistent with tangent line and the line segment direction at segment link point place, generate the permissible error value that the continuous level and smooth cutter path of transient curve of curvature and the maximum deflection difference value of original path are less than digital control system.
Described speed planning unit refers to that the level and smooth cutter path that generates the continuous transient curve of curvature plans according to S shape acceleration and deceleration model the speed of feed that each interpolation cycle cutter moves along smooth curve under switching constraint velocity conditions, and switching constraint condition comprised constraint speed that control vertex cubic B-spline transient curve allows in Interpolation Process and the maximum feeding constraint speed of Machine Tool Dynamics characteristic.
Described interpolation operation unit refers to the speed of feed that obtains each interpolation cycle according to speed planning unit, and calculate the arc length of each interpolation cycle motion, the coordinate figure of being obtained the parameter batten of each interpolation cycle by mistake control vertex B-spline Curve, obtains participating in kinematic axis in the movement length of each interpolation cycle.
The movement length of each interpolation cycle of the participation kinematic axis that described smart interpolation module obtains according to the interpolation operation unit of rough interpolation module, adopt digital integration interpolating method to carry out data processing, and the data after each interpolation cycle processing are transported to the motion of the driver drives numerically-controlled machine that participates in kinematic axis, thereby complete digital control processing task.
The present invention extracts the location coordinate information of kinematic axis and working process parameter information from nc program, according to system permissible error, determine that switching length and switching line segment between adjacent segments adopted control vertex B-spline Curve to carry out curve transition, under the condition allowing in systematic error, adopt control vertex B-spline Curve to carry out curve transition and replaced switching line segment, generate the continuous level and smooth cutter path of curvature, and adopt S shape acceleration and deceleration model to generating the continuous level and smooth cutter path of curvature and carry out speed planning and interpolation operation being realized task of the present invention.
Compare with existing little line segment interpolation technique, the present invention is in NC Machining Process, first partly adopted control vertex B-spline Curve to carry out curve transition the switching of adjacent segments, generate cutter path and can realize level and smooth continuous transition, taking into full account under the prerequisite of system speed constraint and error constraints, carry out speed planning and interpolation operation, the motion obtaining is more steady, speed is more level and smooth, meet system requirement on machining accuracy simultaneously, counting yield is high, and algorithm is simple easily to be realized, and is applicable to high-speed, high precision numerical control machine for processing.
Accompanying drawing explanation
Fig. 1 hardware configuration schematic diagram of the present invention.
Fig. 2 structural representation of the present invention.
Fig. 3 crosses control vertex B-spline Curve schematic diagram.
Fig. 4 crosses control vertex B-spline Curve error model schematic diagram.
Schematic diagram is controlled in the acceleration and deceleration of Fig. 5 S shape.
The little line segment machining path of Fig. 6 schematic diagram.
Fig. 7 adopts the inventive method speed of feed schematic diagram.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
As shown in Figure 1, the hardware configuration schematic diagram of the present embodiment.This structure forms upper and lower computer open architecture by PC and DSP motion controller, hardware system is mainly by host computer, PCI drives, motion controller, four parts of driver and servo alternating current generator form, by PCI, drive the data communication realizing between host computer and slave computer, PC is realized man-machine interaction as host computer, interpretation of programs, cutter compensation, cross control vertex B-spline Curve fade function, human-computer interaction interface 1 is realized program processing, track emulation, monitoring in real time, parameter management function, the core DSP process chip of motion controller 2 is TMS320F28335, dominant frequency is 150MHz, adopt Harvard structure, realization is to the curvature continuously smooth cutter path speed planning generating, interpolation operation and smart interpolation function, the result that essence interpolation obtains is sent to driver 3 by hardware circuit, drive AC servo motor 4 to rotate, thereby drive numerically-controlled machine motion, realize the digital control processing of part to be processed.
As shown in Figure 2, the present embodiment comprises: human-computer interface module, interpretation of programs module, cutter compensation module, rough interpolation module, essence interpolation module, wherein: the intercommunication of human-computer interface module and interpretation of programs module, human-computer interface module is transferred to interpretation of programs module nc program, interpretation of programs module generation abnormal conditions are passed to human-computer interface module in real time, the intercommunication of human-computer interface module and rough interpolation module, human-computer interface module is passed to rough interpolation module kinematic parameter, rough interpolation module generation abnormal conditions are passed to human-computer interface module in real time, cutter compensation module and smart interpolation module and human-computer interface module realize one-way communication, cutter compensation module and smart interpolation module generation abnormal conditions are passed to human-computer interface module in real time, interpretation of programs module is connected with cutter compensation module and transmits machining path information and working process parameter information, cutter compensation module is connected with rough interpolation module and transmits cutter path information, rough interpolation module is connected and transmits interpolation data with smart interpolation module, rough interpolation module is by generating control vertex B-spline Curve transient curve, speed planning and interpolation operation cell formation.
The present embodiment implementation process is as follows:
1, from nc program file, extract machining path information and working process parameter information
Described machining path information refers to starting point and the terminal point coordinate value of every machining path.
Described working process parameter information refers to the dependent instructions such as M, F in nc program file, S, T, D.
2, machining path Information generation cutter path information
Described cutter path information refers to starting point and the terminal point coordinate value of center cutter in NC Machining Process, by cutter, mend path computing and cutter path adapter unit, adopt C tool function compensation way to carry out cutter compensation, the described machining path information of nc program is converted to cutter path information.
3, the linear cutter path by adjacent switching part generates the curve cutter path seamlessly transitting
As shown in Figure 3, calculate adjacent two line segments in cutter path
with
length, angle and patchcord segment length, adopted control vertex B-spline Curve to carry out curve transition on switching line segment, cross control vertex B-spline Curve consistent with switching line segment direction in the tangential direction with segment link point place, curvature is zero, and transient curve is the closer to P
3the curvature of some position curve is larger, the limits of error δ setting according to digital control system
0determine control vertex P
3, the controlled summit P of method that adopts approximate circular arc to process
1and P
5, adopt approximate circular arc six halving methods to determine control vertex P
2and P
4obtain five control vertexs of transient curve, according to five control vertexs, adopted control vertex B-spline Curve approximating method to obtain transient curve, the cutter path of this transient curve and the maximum deflection difference value of original cutter path are less than the limits of error value δ that digital control system is set
0, as shown in Figure 4,
4, according to cutter path geometrical property and Machine Tool Dynamics characteristic, set up speed of feed constraint condition
The cutter path geometrical property of crossing control vertex B-spline Curve according to described, is meeting under the prerequisite of machining precision, and the pass between speed of feed and transient curve radius-of-curvature is:
Wherein, v
ifor speed of feed, T is interpolation cycle, ρ
1for crossing the radius-of-curvature of control vertex B-spline Curve, δ
1the longbow high level error allowing for system.
According to described Machine Tool Dynamics characteristic, transient curve adopts the method for circular arc approximate processing, and the pass that can obtain between speed of feed and acceleration is:
Wherein, A
maxpeak acceleration for system.
By formula (1) and (2), can be obtained, the speed of feed constraint condition of the described transient curve of crossing control vertex B-spline Curve is:
5, speed planning
Described described speed planning is the speed of feed of planning that under speed of feed constraint condition each interpolation cycle cutter moves along cutter path.
The present embodiment be take S shape Acceleration-deceleration Control Method and is introduced speed planning process as example, and it does not form limitation of the invention.
As shown in Figure 5, described S shape Acceleration-deceleration Control Method forms by seven sections: add accelerating sections, even accelerating sections, subtract accelerating sections, at the uniform velocity section, accelerating and decelerating part, even braking section, subtract braking section.
6, interpolation operation
Described interpolation operation is that finger obtains the speed of feed of current period according to the velocity profile line generating, and calculates arc length, thereby the parameter of curve of obtaining is obtained the point coordinate on curve by parameter of curve, thereby obtains the position coordinates of each axle.
20 the little line segments in Fig. 6 of take are example, with described S shape Acceleration-deceleration Control Method, carry out speed planning, obtain feed speed curve that each interpolation cycle cutter moves along machining path as shown in Figure 7.
It is example that the present embodiment be take the little line segment machining path of two dimension, the method of real-time generation curvature continuous path has been described, and the method that adopts S shape Acceleration-deceleration Control Method to carry out interpolation to newly-generated level and smooth cutter path under precision and the servo ability integration constraint condition of lathe, can shorten process time, improve piece surface crudy, be adapted to the numerically-controlled machine of high-speed, high precision.