Linear motor trajectory control method based on Bezier curve
By using the segmented fitting method of Bezier curve in CNC machine tools, the velocity discontinuity and poor response sensitivity problems in linear motor control signal interpolation planning are solved, and the smooth motion and accurate tracking of linear motors are realized, which improves the Response speed and accuracy.
Patent Information
- Application Number
- CN202410388224.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-04-01
AI Technical Summary
In the prior art, the control signal interpolation planning of linear motors in CNC machine tools has problems of discontinuous speed and poor response sensitivity, resulting in excessive acceleration of linear motor movement and hysteresis response.
Using the segmented fitting method based on the Bezier curve, by collecting handwheel pulse signals and setting multiple control signals into one fitting segment, establishing a collinear model to adjust the control signal of the next fitting segment to ensure the linear motor Move according to smooth Bezier curves to improve response speed and accuracy.
The smooth connection points and acceleration control of linear motor movement is realized, ensuring accurate tracking and real-time response to external control equipment, and improving movement accuracy and response speed.
Smart Images

Figure CN118192406B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of numerically controlled machine tools, and in particular relates to a linear motor moving trajectory control method based on a Bezier curve. Background Art
[0002] In the field of CNC machine tools, the control signal source of linear motors comes from not only the motion planning of the CNC system itself, but also from external command signals, such as handwheels. The handwheel is also called a hand-cranked pulse generator, which has a code disk with alternating light and dark lines and two photoelectric transceivers. When the handwheel rotates, the photoelectric transceiver generates two sets of alternating pulse signals. The phase sequence of the pulse signal represents the direction of the handwheel rotation, and the number of pulses represents the distance the handwheel is shaken. After receiving the pulse signal, the CNC system will determine the distance and direction that the workbench should move based on the control signal and phase sequence, and then perform appropriate interpolation planning on the control signal, that is, smoothing processing, to fit the discrete control signal into a continuous control signal. The CNC system controls the movement of actuators such as linear motors according to the fitted control signal, so that it produces movement consistent with the handwheel movement.
[0003] At present, there are two main methods for interpolation planning of external signals. The first is the linear interpolation method, which directly connects discrete signal data with a straight line, resulting in discontinuous speed at the connection point, and an infinite acceleration will be generated at the connection point, which is not conducive to the control of the linear motor. The first is the Bezier curve interpolation method. After collecting all discrete signals, this method fits them to obtain a smooth fitting curve. However, in this method, the movement of the linear motor seriously lags behind the external control devices such as the handwheel, and the response sensitivity of the linear motor is poor. Summary of the invention
[0004] The object of the present invention is to provide a linear motor movement trajectory control method based on Bezier curve, which can ensure that the connection points of the segmented Bezier curve remain smooth and ensure that the linear motor accurately tracks and responds in real time to the final position of an external control device.
[0005] In order to achieve the above object, a technical solution provided by a specific embodiment of the present invention is as follows:
[0006] A linear motor movement trajectory control method based on Bezier curve, comprising:
[0007] Step 1: collect the handwheel pulse signal and convert it into a control signal for controlling the motion of the linear motor, set n control signals as a fitting segment, where the first control signal of the first fitting segment represents the initial position of the handwheel, and the nth control signal of the previous fitting segment is the first control signal of the next fitting segment, n≥3;
[0008] Step 2: collect n control signals of the first fitting segment, and use the Bezier curve model to fit the control signal curve of the fitting segment;
[0009] Step 3: Establish a collinear model of the n-1th and nth control signals of the previous fitting segment, adjust the second control signal of the next fitting segment according to the collinear model, use the Bezier curve model to fit the control signal curve of the next fitting segment, and control the linear motor to move according to the control signal curve of the previous fitting segment;
[0010] Step 4: Repeat step 3 until the linear motor moves to the final position.
[0011] In one or more embodiments of the present invention, establishing a collinear model of the n-1th and nth control signals of the previous fitting segment includes: taking the acquisition period as the horizontal coordinate and the control signal as the vertical coordinate, establishing a rectangular coordinate system, wherein the coordinate points corresponding to the n-1th and nth control signals are (x n-1 ,y n-1 ) and (x n ,y n ), calculate the collinear model of y=kx+b based on these two coordinate points, where b=y n -k*x n =y n-1 -k*x n-1 .
[0012] In one or more embodiments of the present invention, in step three, the n-1th and nth control signals of the previous fitting segment and the adjusted second control signal of the next fitting segment are located on the same straight line in the rectangular coordinate system.
[0013] In one or more embodiments of the present invention, adjusting the second control signal of the next fitting segment according to the collinear model includes: the coordinate point of the second control signal of the next fitting segment in the rectangular coordinate system is (x n+1 ,y n+1 ), and its sampling period x n+1 Substitute into the collinear model to obtain its control signal y n+1 =k*x n+1 +b, change y n+1 Replaced by the second control signal of the next fitting segment.
[0014] In one or more embodiments of the present invention, controlling the linear motor to move according to the control signal curve of the previous fitting segment includes: the machine tool system obtains the speed corresponding to each servo cycle of the linear motor according to the control signal curve of the previous fitting segment, and controls the movement of the linear motor according to the obtained speed.
[0015] In one or more embodiments of the present invention, moving the linear motor to the final position includes: stopping fitting after fitting the control signal curve of the last segment, controlling the movement of the linear motor according to the control signal curves of the last two segments, and moving the linear motor to the final position.
[0016] In one or more embodiments of the present invention, in each fitting segment, the control signal corresponding to the end of the control signal curve is consistent with the control signal of the nth acquisition cycle.
[0017] In one or more embodiments of the present invention, n=4.
[0018] In one or more embodiments of the present invention, the acquisition periods of the respective fitting segments are equal.
[0019] Compared with the prior art, the linear motor movement trajectory control method based on Bezier curve in the embodiment of the present invention has simple steps and is easy to operate. It can not only ensure that the connection points of the segmented Bezier curve remain smooth and avoid sudden changes in the acceleration of the linear motor, but also ensure that the linear motor accurately tracks and responds to the final position of the external control device in real time, thereby improving the movement accuracy and response speed of the linear motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a flow chart of a linear motor movement trajectory control method based on Bezier curve in one embodiment of the present invention;
[0022] Figure 2 It is the hand wheel pulse signal;
[0023] Figure 3 It is a control signal curve fitted by linear interpolation;
[0024] Figure 4 is a control signal curve fitted by a Bezier curve;
[0025] Figure 5 It is a control signal curve fitted by piecewise Bezier curve;
[0026] Figure 6 A control signal curve after collinear adjustment of the connection points of the piecewise Bezier curve;
[0027] Figure 7It is a control signal curve fitted by a linear motor movement trajectory control method based on Bezier curve in one embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] First, if Figure 2 As shown in the figure, it is the pulse signal generated by the handwheel photoelectric transceiver. Assuming that the handwheel pulse signal is collected from time 0, after several collection cycles, Figure 3 and Figure 4 As shown, multiple handwheel position points A, B, C, D, E, F, etc. will be generated at different times, and these are the command positions that actuators such as linear motors need to follow.
[0030] But generally speaking, the CNC system has a collection cycle T for the handwheel signal. C It must be greater than the servo cycle T of the control signal generated by the system S , the linear motor moves according to the control signal. Therefore, it is necessary to C The command signal is interpolated and subdivided into periods of T S control signal.
[0031] Obviously, the control signal can be processed by linear interpolation and Bezier curve, and the processing results are as follows: Figure 3 like Figure 4 As shown. It can be clearly seen that the curve obtained by linear interpolation has discontinuous left and right derivatives of the connection point, i.e., the velocity, and will generate an infinite acceleration at the connection point, which is unreasonable for the control of the linear motor. Although the curve obtained by Bezier curve interpolation is smooth, it is necessary to obtain all control signals before controlling the movement of the linear motor, and the movement of the linear motor lags seriously behind the handwheel.
[0032] In order to solve the above problems, Figure 5 As shown, we can consider segmented Bezier curve fitting, that is, fitting once after sampling a certain number of point information and controlling the motor movement. In this way, after completing a segment of curve fitting, the execution of motor control will only be delayed by a few acquisition cycles in terms of real-time performance, and because curve fitting is performed only once every segment, it can also free up the computing power of the CNC system.
[0033] But by Figure 5 It can be clearly seen that the connection point of each fitting curve is not smooth, the left and right derivatives of the connection point are discontinuous, and there is still excessive acceleration at the connection point.
[0034] In order to eliminate this uneven point, for two consecutive n-point Bezier curves, assuming that all points are on the same two-dimensional plane, according to the Bezier curve fitting formula of formula (1), the connection point can be represented by a two-dimensional vector of formula (2).
[0035]
[0036]
[0037] The curvature formula of the connection point is as follows:
[0038]
[0039] According to formula (1), formula (2) and formula (3), we can get:
[0040]
[0041] Let t = 1 and t = 0 in the derivative formula of the left and right curve segments, respectively, and the left and right limits of the derivative of the connection point of the two curve segments are obtained as follows:
[0042]
[0043] Obviously, if the connection point of two curve segments is required to be smooth, that is, the derivative of the point exists, then the left and right limits of the derivative of the connection point can be made equal, that is, P n-2 , P n-1 , P n Three points to meet:
[0044]
[0045] It can be concluded that if a segmented n-point Bezier curve is required to be smooth everywhere, it is only necessary to connect the point and its two adjacent points on the left and right to be collinear.
[0046] According to the above conclusions, Figure 5 The Bezier curve shown in the figure is processed as follows: insert point C' after sampling point C so that points B, C, and C' are collinear, and then perform piecewise Bezier curve fitting. The result is shown in the figure. Figure 6 shown.
[0047] Obviously, the piecewise Bezier curve constructed after inserting point C' is smooth everywhere, but a sampling point will be inserted out of thin air each time the curve is fitted, which will cause the CNC system to produce an additional acquisition cycle lag in position response, and this lag will accumulate with the increase in the number of fitting times, that is, as time goes by, the CNC system's response to the linear motor position will become more and more delayed.
[0048] Based on the above reasons, it is more important for the linear motor to track and respond to the final position of the hand wheel in real time, while the intermediate movement process of the linear motor is less important, and only the speed is required to be continuous during its movement. Therefore, the following can be made: Figure 7 As shown in the improvement, in this improvement method, according to the principle of three-point collinearity, point D' is constructed to replace the original point D, so as to ensure that the piecewise Bezier curve is smooth everywhere, and at the same time, the accuracy of the CNC system's tracking of the final position of the hand wheel and the real-time response can be guaranteed.
[0049] Therefore, based on the above-mentioned improvement scheme for the linear motor moving trajectory curve, the following can be obtained: Figure 1 The linear motor movement trajectory control method based on Bezier curve in one embodiment of the present invention includes steps one to four.
[0050] In step 1, when the handwheel rotates, the numerical control system collects the pulse signal of the handwheel and converts it into a control signal, and sets the collected n control signals as a fitting segment, wherein the first control signal of the first fitting segment represents the initial position of the handwheel, that is, 0. The nth control signal of the previous fitting segment is the first control signal of the next fitting segment, n≥3. The external control device can be a handwheel or other device.
[0051] In step 2, n control signals of the first fitting segment are collected, and a Bezier curve model is used to fit the control signal curve of the fitting segment.
[0052] Specifically, after setting a specific value of n in step 1, after collecting all control signals of the first segment, the fitting segment is immediately fitted using a Bezier curve model to obtain a control signal curve of the fitting segment.
[0053] In step three, a collinear model of the n-1th and nth control signals of the previous fitting segment is established, the second control signal of the next fitting segment is adjusted according to the collinear model, the control signal curve of the next fitting segment is fitted using the Bezier curve model, and the linear motor is controlled to move according to the control signal curve of the previous fitting segment.
[0054] Specifically, a rectangular coordinate system is established with the acquisition period as the horizontal coordinate and the control signal as the vertical coordinate, and the collinear model of y=kx+b is calculated based on the n-1th and nth control signals of the previous fitting segment and their corresponding acquisition periods.
[0055] In the specific calculation, the coordinate points corresponding to the n-1th and nth control signals in the previous fitting segment are (x n-1 ,y n-1 ) and (x n ,y n ), calculate the collinear model of y=kx+b based on these two coordinate points, where
[0056] b=y n -k*x n =y n-1 -k*x n-1 .
[0057] Since the n-1th and nth control signals of the previous fitting segment and the adjusted second control signal of the next fitting segment are located on the same straight line of the above-mentioned rectangular coordinate system, the second acquisition cycle of the next fitting segment is substituted into the collinear model for solution, and the solved value is replaced with the second control signal of the next fitting segment.
[0058] In the specific calculation, the coordinate point of the second control signal of the next fitting segment in the rectangular coordinate system is (x n+1 ,y n+1 ), where the sampling period x n+1 As a known parameter, substitute it into the collinear model to obtain its control signal y n+1 =k*x n+1 +b, change y n+1 Replaced by the second control signal of the next fitting segment.
[0059] Then, the Bezier curve model is used to fit the control signal curve corresponding to the n control signals of the next fitting segment. According to the fitted control signal curve, the machine tool control system can obtain the speed corresponding to each servo cycle of the linear motor and control the linear motor to move according to the obtained speed. Figures 3 to 7 As shown in the figure, the period of the control signal that controls the movement of the linear motor is called the servo period T S , servo cycle T S Less than the acquisition period T of the external control device pulse signal C After fitting the control signal curve, according to the servo cycle T S Subdivide the control signal curve and obtain each servo cycle T S The corresponding motor speed controls the linear motor to move to the specified position at the obtained speed, thereby achieving continuous control and smooth movement of the linear motor.
[0060] In step 4, step 3 is repeated until the linear motor moves to the final position.
[0061] Specifically, in the process of continuously repeating step 3, if the external signal is lost after fitting a certain control signal curve, it means that the external control device has stopped operating, and the control signal curve is the last control signal curve. At this time, the CNC system stops fitting and controls the linear motor to move according to the control signal curves of the last two sections, and moves the linear motor to the final position.
[0062] In one embodiment, for the control signal curve of each fitting segment, the control signal corresponding to its end should be consistent with the control signal of the nth acquisition cycle actually collected by each fitting segment, thereby ensuring the accuracy of the linear motor's position tracking of the external control device.
[0063] In one embodiment, n can be set to 4, that is, a four-point Bezier curve model is used to fit each fitting segment. After n is set to 4, from the first fitting segment onwards, each fitting segment only needs to collect three new pulse signals to complete the four-point Bezier curve fitting. Moreover, compared with the handwheel position, the position of the linear motor will only lag behind the collection cycle of three pulse signals. Of course, the specific value of n can be set according to the operator's needs and the performance of the machine tool, and can also be set to values such as 3, 5, 6, 7, 8, etc.
[0064] In one embodiment, in order to facilitate signal acquisition and system calculation, the acquisition period of each fitting segment can be kept consistent. Of course, under special working conditions, the acquisition period of a single or multiple fitting segments can be appropriately adjusted.
[0065] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0066] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A linear motor movement trajectory control method based on Bezier curve, characterized in that: include: Step 1: collect the handwheel pulse signal and convert it into a control signal for controlling the motion of the linear motor, set n control signals as a fitting segment, where the first control signal of the first fitting segment represents the initial position of the handwheel, and the nth control signal of the previous fitting segment is the first control signal of the next fitting segment, n≥3; Step 2: collect n control signals of the first fitting segment, and use the Bezier curve model to fit the control signal curve of the fitting segment; Step 3: Establish a collinear model of the n-1th and nth control signals of the previous fitting segment, adjust the second control signal of the next fitting segment according to the collinear model, use the Bezier curve model to fit the control signal curve of the next fitting segment, and control the linear motor to move according to the control signal curve of the previous fitting segment; Step 4: Repeat step 3 until the linear motor moves to the final position; Wherein, the establishment of the collinear model of the n-1th and nth control signals of the previous fitting segment includes: taking the acquisition period as the horizontal coordinate and the control signal as the vertical coordinate, establishing a rectangular coordinate system, wherein the coordinate points corresponding to the n-1th and nth control signals are (x n-1 ,y n-1 ) and (x n ,y n ), calculate the collinear model of y=kx+b based on these two coordinate points, where , b = y n -k×x n = y n-1 -k×x n-1 .
2. The linear motor movement trajectory control method based on Bezier curve according to claim 1, characterized in that: In the step three, the n-1th and nth control signals of the previous fitting segment and the adjusted second control signal of the next fitting segment are located on the same straight line in the rectangular coordinate system.
3. The linear motor movement trajectory control method based on Bezier curve according to claim 1, characterized in that: The step of adjusting the second control signal of the next fitting segment according to the collinear model includes: the coordinate point of the second control signal of the next fitting segment in the rectangular coordinate system is (x n+1 ,y n+1 ), its sampling period x n+1 Substitute into the collinear model to obtain its control signal y n+1 =k×x n+1 +b, change y n+1 Replaced by the second control signal of the next fitting segment.
4. The linear motor movement trajectory control method based on Bezier curve according to claim 1, characterized in that: Controlling the linear motor to move according to the control signal curve of the last fitting section includes: the machine tool system obtains the speed corresponding to each servo cycle of the linear motor according to the control signal curve of the last fitting section, and controls the linear motor to move according to the obtained speed.
5. The linear motor movement trajectory control method based on Bezier curve according to claim 1, characterized in that: The method of moving the linear motor to the final position includes: After fitting the control signal curve of the last section, the fitting is stopped, and the linear motor is controlled to move according to the control signal curves of the last two sections, so as to move the linear motor to the final position.
6. The linear motor movement trajectory control method based on Bezier curve according to claim 1, characterized in that: In each fitting segment, the control signal corresponding to the end of the control signal curve is consistent with the control signal of the nth acquisition cycle.
7. The linear motor movement trajectory control method based on Bezier curve according to claim 1, characterized in that: n=4。 8. The linear motor movement trajectory control method based on Bezier curve according to claim 1, characterized in that: The acquisition period of each fitting segment is equal.
Citation Information
Patent Citations
Terminal positioning track fitting method based on Bezier curve
CN102998684A
Track fitting method and device, equipment and storage medium
CN113327264A
Robot pose control method and device based on Bezier curve and electronic equipment
CN115268447A
Cutter motion data processing method based on Bezier curve
CN116755391A
Fairing method, system and equipment for connection corner of arc and straight line and storage medium
CN117032078A
