At present, the stepper motor servo system also occupies a considerable proportion in the numerical control system. The domestically-made CNC electric discharge wire-cutting machine tool and a considerable part of the domestic and foreign EDM machines use a stepper motor servo system. Because the interpolation accuracy of the system trajectory is improved, the machining accuracy of the machine tool will be improved. Therefore, the continuous smooth trajectory control for the stepper motor servo system is studied, which has certain theoretical significance and practical application value. 1 Description of Smooth Track Mathematical Model In mathematics, any line segment can always be infinitely segmented. An arc of any diameter can be connected end-to-end by an infinite number of line segments, that is, it can be segmented into infinite segments with tiny segments [2]. In addition, the contour of the workpiece composed of a plurality of curves should satisfy the trajectory continuous criterion that the end point of the previous curve is the starting point of the next curve. Therefore, to make the actual trajectory of a complex curve ideally coincide with the theoretical trajectory, the pulse equivalent must be reduced as much as possible, and the gradient of the straight line segment synthesized by the X and Y direction movements should be as wide as possible, that is, Each pulse must not only be small but it can be changed at will . 1.1 Establishment of Linear Smooth Incremental Mathematical Model <br> For any point P(x,y) on the straight line whose starting point is (x0,y0) and the ending point is (x1,y1), there are always: Established. The coordinates of the i-th and i+1 points on the straight line are (xi, yi) and (xi+1, yi+1). , Δy=K . Δx Where K is the slope; Δy=yi+1-yi,Δx=xi+1-xi 1.2 The establishment of arc smoothing incremental mathematical model <br> The general expression of a circle is (x-x0)2+(y-y0)2=R2, where: (x0, y0) represents the coordinates of the center of the circle, and R represents the circle Arc radius. Now (x0,y0) is taken as the origin of a relative coordinate system. Then the equation of the circle is x'2+y'2=R2, where: x'=x-x0,y'=y-y0, then for the arc Any two adjacent points (xi, yi) and (xi+1, yi+1) can be obtained: X'i=xi-x0,y'i=yi-y0 Subtracting the above two formulae respectively yields: x'i+1-x'i=xi+1-xi, y'i+1-y'i=yi+1-yi, ie in the workpiece coordinate system (XY The incremental values ​​of the two adjacent points Pi and Pi+1 in the workpiece relative coordinate system (X'-Y') are equal to each other Δx'=Δx, Δy'=Δy. The Pi+1 coordinates are represented by the Pi-point coordinates and substituted into the equation of the circle to obtain: (x'i+Δx')2+(y'i+Δy')2=R2, In the formula, F0 and F1 are symbol signs, which are determined by the quadrant in which the point (x'i, y'i) is located and whether the arc forming direction CF is slewing (CF=0) or counter-circle (CF=1). The incremental mathematical model of the arc is: When |Δy|>|Δx|, 1.3 Establishment of an Incremental Mathematical Model for Ellipsoid Smoothing <br> According to the linear and arc smoothing incremental mathematical model, it is not difficult to obtain a smooth incremental mathematical model for elliptical trajectories: Where: a, b - are the major and minor axes of the ellipse, respectively; 1.4 The establishment of hyperbolic smooth incremental mathematical model <br> Similarly, the smooth incremental mathematical model of hyperbolic trajectory is: The mathematical models of a, b, F0, F1 and ellipse are the same. Among them, Fs and F1 are symbol signs, and F1 is related to the quadrant where the corresponding point on the curve is located and the direction of motion CF; Fs is related to the direction of the opening of the parabola. When the opening is up or right, Fs is positive, otherwise it is negative. 2 Windows operating mechanism and system interface The operating mechanism of Windows is the message-driven mechanism. The message from Windows comes from the device. In the processing of these messages, many other messages were generated. The message needs to be sent to the appropriate window function. For this purpose, the application continuously calls the Windows GetMessage function to get the message from the message queue and to call the DispatchMessage function to interpret the message. The DispatchMessage function determines which of the program and window functions or Windows window functions gets the message, so that Windows hides the complex details and then calls the appropriate window function directly. 3 system function As shown in FIG. 1, the entire control system includes a control core module, a mobile module, a positioning module, a processing module, a real-time monitoring module, a real-time task processing module, and an auxiliary module. Figure 1 system function diagram Among them, the control core module is the key of the system, including curve interpolation module, NC program interpretation and execution module, machine tool signal detection module and machine tool control module. Figure 2 Center positioning of column The processing module controls the Z axis servo feed or the X, Y axis interpolation feed motion according to the state of the discharge gap. Since the discharge status is monitored in real time, reasonable feed control can be obtained so that the processing efficiency is always maintained in the best and most stable discharge state. 4 Conclusion By establishing a mathematical model of continuous smooth trajectory interpolation, and based on the principle of stepper motor synchronous drive, not only can improve the interpolation accuracy of the trajectory (determined by the stepper motor subdivision number, the higher the subdivision number, the smaller the pulse equivalent) , reduce the principle error of trajectory interpolation. At the same time, with the help of the features of the computer's fast calculations, it is possible to directly go out of the lines, arcs, ellipses, hyperbolas, parabolas, involute curves. And can further realize the trajectory offset, tool compensation function. Other Supporting Equipment,Automatic Envelope Making Machine,Wallet Envelope Machine,Automatic Wallet Envelope Machine Ruian Paper Product Machinery Co.,Ltd , https://www.rppmachine.com
The basis of the smooth trajectory is stepper motor micro-stepping subdivision and variable step synchronization control technology, that is to say each pulse equivalent is not fixed but according to the requirements, the change is controlled by the computer and the number of changes is greater. More, then the closer the workpiece contour is to the actual trajectory [1]. With the aid of the computer's fast calculations, direct function calculations are used to determine the increments that should be used in the two-dimensional X and Y directions.
that is:
Take Δx as a certain value, such as 1μm, 0.1μm, and 0.01μm, then the slope can be used to obtain Δy as K, 0.1K, and 0.01K.
X'i+1=xi+1-x0,y'i+1=yi+1-y0
And there are:
When |Δy|<|Δx|,
F0, F1 - is a sign related to the quadrant where the corresponding point on the curve is located and the direction of motion CF.
1.5 Parabolic Smoothing Incremental Mathematical Model <br> Similarly, the smoothing incremental mathematical model of parabolic trajectory is:
It is not difficult to establish a mathematical model of other quadratic curves using the same modeling method, and it will not be repeated here.
Since EDM is a real-time control system, its real-time performance is incompetent for Windows. To do this, the message-driven mechanism of Windows needs to be appropriately modified. The interrupt frequency of the clock in the microcomputer is 18.2Hz, which can not meet the requirements of the real-time control system. The 8253 clock chip must be programmed so that it can reach the frequency required by the real-time control system (above 1000Hz), due to the change of the interrupt frequency. Will affect the performance of the Windows system, so after changing the interrupt frequency, you must call the original Windows clock interrupt routine at the original frequency in order to ensure the normal and stable operation of Windows.
The main window has a decorative MDI frame style, coordinate display window, NC program window, and processing parameter window as its child windows. The data input window uses a non-modal dialog window. The main window controls the creation and closing of the data input window. When starting a module, the main window establishes a data input window and transmits data to it; when the data input is completed and the run button is pressed, the main window controls the input window to obtain the input data and transmit the data back to the main window. And close the data input window; then call the processing program of the corresponding module to generate the NC code. Finally, the main window loads the NC program into the NC program window and starts the real-time task processing program to execute the NC code.
The mobile module completes the rapid movement of the electrode and can perform full-range movement, half-way movement, and movement to a specified position.
The positioning module completes some automatic positioning functions in EDM, such as end face positioning, column center positioning, hole center positioning, and angular positioning. The column centering is used as an example to illustrate the positioning process. As shown in Figure 2, let the electrode contact sensing distance Xs (Xs> R + r, R is the workpiece radius, r is the radius of the electrode), with the current coordinates as the base point, the control electrode moves X X positive direction, then The electrode descends a certain distance, and then performs a correct sensing of X in the negative direction three times, and records the X coordinate Xp of the point. Similarly, if the same operation is performed in the negative X direction to obtain Xe, the center of the workpiece in the X direction can be obtained. The coordinate Xc = (Xp-Xe)/2; similarly, the Y coordinate can be obtained by operating in the Y direction. If you know the electrode diameter d, you can calculate the diameter of the workpiece D = Xp-Xe-d. The above actions are completely controlled by the microcomputer and do not require manual intervention. Therefore, the positioning accuracy is high and can meet the precision requirements of EDM.
The auxiliary module completes some auxiliary functions in the system. Such as the editing of the NC code, the online help of the system, the modification of the discharge regulation, the simulation of the NC code processing, and the trace display.
The movement module, positioning module and processing module in the above module all require X, Y two-axis linkage interpolation to realize the movement trajectory. Its continuous smooth trajectory control is calculated directly from the mathematical model of the trajectory. Due to the difference between EDM machining and NC milling, when the short circuit is encountered during machining, reverse interpolation motion is needed to eliminate the short circuit state [3].
In the Winodws graphical operating platform to develop a numerical control system, the command image is represented as a graphical button, the operation is clear, very convenient, and can achieve multi-tasking, improve the efficiency of the system operation. Since all programs are written in an object-oriented C++ language, the portability and extensibility of the program are better.