Improved method, apparatus, computer device and storage medium for position input shaping
By performing differentiation, shaping and integration processing on the position command, an output signal for controlling the servo motor is generated, which solves the phase lag problem in the prior art, improves the response speed and positioning accuracy of the servo system, and avoids equipment damage.
Patent Information
- Application Number
- CN202510822986.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Existing position input shaping methods cause phase lag, affecting the positioning accuracy of the servo system and equipment safety.
By performing differential processing on the position command, shaping it using a preset shaper, and combining it with integral and proportional processing, an output signal for controlling the servo motor is generated to eliminate phase lag.
It improves the response speed of the servo system, reduces positioning errors and equipment damage, and improves positioning accuracy and equipment safety.
Smart Images

Figure CN120342274B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of input shaping, and in particular to an improved method and device for position input shaping, a computer device and a storage medium. BACKGROUND
[0002] In an alternating current servo system, the existence of elastic connecting devices such as couplings and reduction boxes can cause residual jitter at the load end when a high-speed running servo motor is positioned, which can easily affect the positioning accuracy and even cause damage to machine tools and processing equipment. At present, the jitter is generally suppressed by a position input shaping method. The position input shaping is performed by convolving the input signal with a series of pulse signals. The shaped signals are sequentially input into the servo system. When the last input signal arrives, the vibrations caused by all input signals at the load end cancel each other out, achieving the purpose of suppressing positioning jitter.
[0003] However, the current position input shaping method for shaping the position command can cause a large phase lag in the shaped command, and the phase lag can prolong the overall control time of the system. SUMMARY
[0004] Embodiments of the present application provide an improved method and device for position input shaping, a computer device and a storage medium, aiming to solve the problem of phase lag in the current position input shaping method.
[0005] In a first aspect, the embodiments of the present application provide an improved method for position input shaping, which comprises:
[0006] obtaining a position command sent by an upper computer and performing differential processing on the position command by a differential operator to obtain a differential signal;
[0007] inputting the differential signal into a preset shaper to make the preset shaper output a shaped position command;
[0008] performing integral processing and proportional processing on the shaped position command to obtain an output signal and controlling the rotation angle of a servo motor according to the output signal to control the movement distance of a load.
[0009] In a second aspect, the embodiments of the present application also provide an improved device for position input shaping, which comprises:
[0010] a first obtaining unit configured to obtain a position command sent by an upper computer and perform differential processing on the position command by a differential operator to obtain a differential signal;
[0011] a first input unit configured to input the differential signal into a preset shaper to make the preset shaper output a shaped position command;
[0012] The integral-proportional unit is used to perform integral and proportional processing on the shaped position instruction to obtain an output signal and control the rotation angle of the servo motor according to the output signal to control the moving distance of the load.
[0013] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor connected to the memory, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.
[0014] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.
[0015] Embodiments of the present invention provide an improved method, apparatus, computer device, and storage medium for position input shaping. The method includes: obtaining a position instruction sent by a host computer, performing differential processing on the position instruction using a differential operator to obtain a differential signal; inputting the differential signal into a preset shaper so that the preset shaper outputs a shaped position instruction; performing integral and proportional processing on the shaped position instruction to obtain an output signal, and controlling the rotation angle of a servo motor based on the output signal to control the movement distance of a load. Embodiments of the present invention can perform differential processing on the position instruction to detect the changing trend of the position instruction in advance, provide an advanced control signal to the preset shaper, perform integral processing on the shaped position instruction to ensure that the output signal is consistent with the position value of the position instruction, and finally compensate the integral signal through proportional processing to obtain an output signal. The output signal is then used to control the movement of the load, thereby improving the impact of phase lag and response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 1 is a flow chart of an improved method for position input shaping provided by an embodiment of the present invention;
[0018] Figure 2 This is a logic block diagram of an improved method for position input shaping provided by an embodiment of the present invention;
[0019] Figure 3 1 is a comparative simulation diagram of an improved method for position input shaping provided by an embodiment of the present invention;
[0020] Figure 4 This is a flow chart of pulse convergence check for an improved method for position input shaping provided by an embodiment of the present invention;
[0021] Figure 5 This is a schematic diagram of a first sub-flow of the method for improving position input shaping provided by an embodiment of the present invention;
[0022] Figure 6 2 is a schematic diagram of a second sub-process of the method for improving position input shaping provided by an embodiment of the present invention;
[0023] Figure 7 3 is a schematic diagram of a third sub-flow of the method for improving position input shaping provided by an embodiment of the present invention;
[0024] Figure 8 2 is a schematic diagram of a fourth sub-process of the method for improving position input shaping provided by an embodiment of the present invention;
[0025] Figure 9 This is a schematic diagram of a fifth sub-flow of the method for improving position input shaping provided by an embodiment of the present invention;
[0026] Figure 10 2 is a schematic diagram of a sixth sub-flow of the method for improving position input shaping provided by an embodiment of the present invention;
[0027] Figure 11 is a schematic block diagram of an improved device for position input shaping provided by an embodiment of the present invention;
[0028] Figure 12 It is a schematic block diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0030] It will be understood that when used in this specification and the appended claims, the terms “include” and “comprising” indicate the presence of described features, integers, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, operations, elements, components and / or groups thereof.
[0031] It should also be understood that the terminology used in this specification is for the purpose of describing specific embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should further be understood that the term "and / or" as used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, including and including these combinations.
[0032] See also Figure 1 , Figure 1 This is a flow chart of a method for improving position input shaping provided by an embodiment of the present invention. The method for improving position input shaping according to an embodiment of the present invention can be applied to computer equipment to improve the phase lag caused by position input shaping, shorten the response delay, and improve the load response speed. Figure 1 As shown, the method includes steps S100 to S120.
[0033] S100, obtaining a position instruction sent by a host computer, and performing differential processing on the position instruction through a differential operator to obtain a differential signal.
[0034] In embodiments of the present invention, the position input shaping method for servo motor precision positioning can be applied to a variety of fields, including the control of industrial robots and manipulators, high-precision servo motor positioning systems, motion control of machine tools and processing equipment, and material handling equipment in automated production lines. For example, in the control of industrial robots and manipulators, industrial robots (such as six-axis manipulators) must move at high speed along complex trajectories when performing tasks such as grasping, assembly, and spraying. Elastic joints and loads can cause end-stage jitter. Traditional position input shaping can suppress end-stage jitter, but its phase lag can increase trajectory tracking errors. In high-precision servo motor positioning systems, servo motor-driven precision worktables (such as semiconductor lithography platforms and electronic component placement machines) must be quickly positioned with micron-level accuracy. The phase lag of traditional position input shaping methods can lead to positioning errors. In the motion control of machine tools and processing equipment, elastic components such as couplings and lead screws in CNC lathes and milling machines can cause vibration during high-speed cutting. The phase lag of traditional position input shaping can worsen the surface roughness of the machined surface and even damage the tool. The improved method for position input shaping provided by the present invention can suppress the jitter in the above-mentioned scenario while eliminating phase lag, thereby avoiding damage to the device.
[0035] A position command is a pulse-like signal used to control the positioning of a servo system (such as a motor or robotic arm). It exists as a pulse train, with each pulse corresponding to a basic displacement unit of the servo system (e.g., each pulse represents a 0.01mm displacement). It is used to drive the servo motor or load to the target position and is a core input signal for feedforward control. For example, if the target position is 100mm, the position command might be expressed as 10,000 pulses (100mm ÷ 0.01mm / pulse = 10,000 pulses). Position commands are generally issued by a host computer (such as a PLC or controller). The servo drive receives the position command and controls the motor's rotation based on the pulse count and frequency to drive the device.
[0036] After acquiring the position command, unlike traditional position input shaping methods that directly shape the position command through a shaper, the present invention first differentiates the position command using a differential operator to obtain a differential signal. Specifically, the position command can be differentiated using the differential operator to enhance the signal's rate of change. For example, if the position command is a step signal r(t), differentiation can be used to obtain its rate of change. This operation allows the signal's "changing trend" on the time axis to be captured in advance. Assuming the differential operator is s (Laplace domain), the differential signal after differentiation is s*R(s), where R(s) is the Laplace transform of the position command.
[0037] S110 , inputting the differential signal into a preset shaper so that the preset shaper outputs a shaped position instruction.
[0038] The preset shaper can be one of the following: a zero vibration (ZV) input shaper, a zero vibration and derivative (ZVD) input shaper, a four-pulse zero vibration second-order derivative (ZVDD) shaper, or an extra insensitivity (EI) input shaper. The specific type of shaper depends on the servo system. The following describes the principles of input shaping and the four shapers.
[0039] Input shaping principle
[0040] The motor-load dual-inertia system can be equivalent to a second-order system, and its step response is determined by a pair of dominant poles. The transfer function of the system is shown below:
[0041] ;
[0042] After the inverse Laplace transform of the second-order system:
[0043] ;
[0044] in, is the damped oscillation frequency, w n is the natural frequency, s is the Laplace operator, is the damping ratio, t is the time, and e is the base of the natural logarithm.
[0045] Assume that the amplitude and time delay of one of the pulses in the shaper are A t , t t , then the response caused by this pulse is:
[0046] ;
[0047] The total response of the system is the sum of the responses caused by all impulses, that is, the sum of the input signal convolved with the n pulse train as shown below:
[0048] ;
[0049] in, .
[0050] The residual oscillation ratio is defined as the ratio of the amplitude after the addition to the amplitude without the shaper:
[0051] ;
[0052] The final requirement is to make the oscillation zero, so:
[0053] ;
[0054] By setting the above equations to 0, various input shapers, such as ZV, ZVD, ZVDD, and EI, can be calculated. The input shapers can suppress vibration problems caused by flexible load positioning.
[0055] ZV Shaper
[0056] The ZV shaper consists of two pulses and is the simplest input shaper. To minimize the shaping time, the first pulse is assumed to start at time 0, and in order for the system to reach the target point, the sum of the amplitudes of the two pulses should be 1.
[0057] Constraints:
[0058] ;
[0059] Get the ZV shaper parameters:
[0060] .
[0061] ZVD Shaper
[0062] The accuracy of the system model is required for ZV shaper, while the established approximate second-order system has errors in angular frequency and damping ratio. In order to enhance the robust performance of input shaper for system vibration suppression, the residual vibration expression is constrained. At this time, a constraint condition of the derivative of the residual oscillation expression is added to the constraint equation to form the ZVD shaper.
[0063] Constraint condition:
[0064] ;
[0065] ;
[0066] Get the parameters of ZVD shaper:
[0067] ;
[0068] Where, .
[0069] ZVDD shaper
[0070] In order to further improve the robustness of the input shaper, a four-pulse zero-vibration second-order differential ZVDD shaper will be constructed.
[0071] Constraint condition:
[0072] ;
[0073] Get the parameters of ZVDD shaper:
[0074] ;
[0075] Where, .
[0076] EI shaper
[0077] The EI input shaper is also composed of three pulses. Compared with the ZVD shaper, it does not require zero derivative at the vibration frequency, but only requires small enough sensitivity near the vibration frequency. Essentially, a pair of zeros is configured near the under-damped pole of the system, and the zero-pole is not required to be accurately cancelled out, which further enhances the robustness while ensuring vibration suppression effect.
[0078] Set V0 as the maximum percentage of residual vibration allowed by the system, and get the parameters of the EI shaper:
[0079] ;
[0080] S120 , performing integration and proportional processing on the shaped position command to obtain an output signal and controlling the rotation angle of the servo motor according to the output signal to control the moving distance of the load.
[0081] In an embodiment of the present invention, the shaped position command is essentially a shaped differential signal. This shaped position command is subjected to integration and proportional processing to achieve signal reconstruction, thereby obtaining an output signal. The resulting output signal is used to control the rotation angle of the servo motor, thereby controlling the travel distance of the load, thereby improving the load's response speed. Signal reconstruction includes an integral and proportional component. The integral component is used to restore the position dimension of the signal. The integral operator can be an integral process 1 / s. A proportional operator K is then introduced and superimposed on the integrated signal to adjust the degree of phase compensation.
[0082] like Figure 2 As shown in the figure, a quasi-differential link is added to the position input shaping, so as to improve the phase characteristics and eliminate the lag through signal conditioning without changing the vibration suppression nature of the input shaping (still relying on pulse convolution to offset vibration). The quasi-differential link includes a differential link, an integral link, and a proportional link. The differential link is to perform differential processing on the position command to obtain a differential signal, the integral link is to perform integral processing on the shaped position command, and the proportional link is to perform proportional processing on the position command and superimpose it on the integral signal, ultimately achieving the purpose of improving the phase lag. Figure 3 As shown, Figure 3 This is the position input shaping phase compensation comparison simulation diagram, Figure 3 It can be seen that after adding the quasi-differential link, the phase lag of the position input shaping algorithm is improved compared with the position input shaping algorithm without adding the quasi-differential link, and it has a better vibration suppression effect.
[0083] In certain embodiments, for example, in embodiments of the present invention, Figure 5 As shown, step 120 includes steps S121-S122.
[0084] S121, performing integration processing on the shaped position by an integral operator to obtain an integral signal and performing proportional processing on the position instruction by a proportional operator to obtain a proportional signal;
[0085] S122: Sum the integral signal and the proportional signal to obtain the output signal.
[0086] In the embodiment of the present invention, let R(s) be the position command, Y`(s) be the shaped differential signal, the integral operator be 1 / s, and the proportional operator be K. Then, after integrating Y`(s), Y`(s)·1 / s can be obtained. Then, the proportional operator is introduced and superimposed with the integrated signal to obtain the output signal Y(s)=K·R(s)+Y`(s)·1 / s. It can be seen that the larger the K value, the smaller the phase lag. However, the vibration suppression effect needs to be balanced to avoid weakening the vibration suppression performance due to an excessively large K value.
[0087] Taking the phase compensation process of 100mm precision positioning of servo motor as an example, assuming that the position command is 10,000 pulses (each pulse represents 0.01mm displacement), the servo motor-load system is equivalent to a second-order underdamped system, and the natural frequency ω n =100rad / s, damping ratio t=0.1, damped oscillation frequency ω d =0.99.5rad / s. The preset shaper is a ZV shaper, then A1=0.55, A2=0.45, t1=0s, t2=0.0316s. Differentiate the position command r(t)=10000 to obtain the differential signal s·R(s)=10000. Input the differential signal into the ZV shaper to obtain the shaped differential signal Y`(s). Then Y`(s)=10000·(0.55+0.45e -0.0316 ). After integrating the shaped differential signal (the integral operator is 1 / s), we can get Y`(s)·1 / s=10000·(0.55 / s+0.45e -0.0316 / s), introduce the proportional operator K (assuming K = 0.8), and superimpose it with the integral signal to obtain the output signal Y(s) = K·R(s) + Y`(s)·1 / s = 0.8·10000 / s+10000·(0.55 / s+0.45e -0.0316 / s).
[0088] In certain embodiments, for example, in embodiments of the present invention, Figure 6 As shown, the improved method for position input shaping further includes steps S130-S131.
[0089] S130, performing floating-point data detection on the output signal to confirm whether floating-point data exists in the output signal;
[0090] S131: If the floating-point data exists in the output signal, perform floating-point compensation on the output signal.
[0091] In an embodiment of the present invention, the output signal is a position instruction after input shaping and phase compensation, and exists in the form of a pulse sequence. Each pulse corresponds to the basic displacement unit of the servo system. For example, when the output signal is 10,000 pulses, the corresponding target displacement is 10,000×0.01mm=100mm. The number of pulses directly determines the positioning end point.
[0092] like Figure 4 As shown, Figure 4 This is a flowchart of the pulse convergence check process, which includes floating-point compensation, remainder compensation, and remainder monitoring. For floating-point compensation, after obtaining the output signal, a floating-point data check is performed on the output signal to confirm whether floating-point data exists. If floating-point data exists, floating-point compensation can be performed on the output signal. For example, if the output signal calculated in a certain control cycle contains 1234.6 pulses, floating-point data is confirmed to exist, and the floating-point data is 0.6, floating-point compensation is required to eliminate the error caused by the floating-point data.
[0093] In certain embodiments, for example, in embodiments of the present invention, Figure 7 As shown, the step S131 also includes steps S1311-S1313.
[0094] S1311, rounding the output signal in a current control cycle to output integer data of the output signal, and storing the floating-point data in a compensation register;
[0095] S1312, in a next control cycle, adding the floating-point data of the previous control cycle to the output signal of the next control cycle to obtain a compensated output signal;
[0096] S1313: If the floating-point data exists in the compensated output signal, round the compensated output signal to output integer data in the compensated output signal, and store the floating-point data in a compensation register.
[0097] In an embodiment of the present invention, when floating-point data exists in the output signal of a control cycle, the output signal can be rounded and output, and then the floating-point data of the output signal can be stored. In the next control cycle, the floating-point data can be read, and the floating-point data can be added to the output signal of the next control cycle to obtain the compensated output signal, and it can be confirmed whether the compensated output signal contains floating-point data. If so, the above process is repeated.
[0098] For example, the input shaping algorithm calculates an output of 1234.6 pulses in the first control cycle. This is rounded to an integer, resulting in an actual output of 1234 pulses. The decimal fraction, 0.6, is retained and stored in the compensation register for correction in the next control cycle. The input shaping algorithm calculates an output of 567.2 pulses in the second control cycle. Adding the compensation value of 0.6 from the previous cycle yields 567.8 pulses, which are rounded to an integer and output as 567 pulses. The decimal fraction, 0.8, is temporarily stored. The cumulative output of the first two control cycles is 1234 + 567 = 1799 pulses, but the actual floating-point calculation should be 1234.6 + 567.2 = 1801.8 pulses. With decimal compensation, the temporarily stored 0.8 pulse is carried forward into subsequent cycle calculations, avoiding cumulative error (traditional algorithms would lose 0.8 pulses if rounded directly).
[0099] In certain embodiments, for example, in embodiments of the present invention, Figure 8 As shown, the improved method for position input shaping further includes steps S140-S142.
[0100] S140, if it is detected that there is no data output in the current control cycle, then confirm whether the target pulse number of the current displacement instruction is consistent with the actual output pulse number;
[0101] S141, if the target pulse number is inconsistent with the actual output pulse number, calculating the difference between the target pulse number and the actual output pulse number to obtain a compensation value;
[0102] S142: Outputting compensation pulses based on the compensation value so that the actual output pulse number is consistent with the target pulse number.
[0103] In an embodiment of the present invention, in addition to compensating for floating-point data, remainder compensation can also be performed. Specifically, after a control instruction is completed, that is, when no data is currently output, the target number of pulses corresponding to the current displacement instruction is determined to be consistent with the actual number of output pulses. If they are consistent, no remainder compensation is required. If they are inconsistent, the difference between the target number of pulses and the actual number of output pulses is calculated to obtain a compensation value, and a compensation pulse is output based on the compensation value to make the actual number of output pulses consistent with the target number of output pulses.
[0104] For example, when the motor completes a command (target pulse count of 10,000 pulses), the actual output pulse count of the position input shaping output is rounded to 9,999. The difference between the target pulse count and the actual output pulse count is 1, which is stored in the remainder register. When the command is completed and the remainder register is not zero, an additional compensation pulse is output to bring the total output pulse count to 10,000. If the remainder is -1 (one more pulse is output), a -1 compensation pulse is output (i.e., one less pulse). This ensures that at the positioning endpoint, the actual displacement is consistent with the target displacement (10,000 × 0.01 mm = 100 mm), avoiding a 0.01 mm positioning error caused by pulse loss.
[0105] In certain embodiments, for example, in embodiments of the present invention, Figure 9 As shown, the improved method for position input shaping further includes steps S150-S151.
[0106] S150, confirming the number of input pulses and the number of output pulses in the current control cycle, and calculating the difference between the number of input pulses and the number of output pulses to obtain a real-time remainder;
[0107] S151, adjusting the number of pulse inputs in the next control cycle according to the real-time remainder.
[0108] In an embodiment of the present invention, the real-time remainder can be monitored in real time to ensure input-output consistency closed-loop control. Specifically, the real-time remainder can be obtained by detecting the difference between the number of input pulses and the number of output pulses in real time, and then the number of pulse inputs in the next control cycle can be adjusted based on the real-time remainder.
[0109] In certain embodiments, for example, in embodiments of the present invention, Figure 10 As shown, the improved method for position input shaping further includes steps S1511-S1513.
[0110] S1511, confirm whether the real-time remainder is a positive number;
[0111] S1512, if the real-time remainder is a positive number, reducing the number of pulse inputs in the next control cycle according to the real-time remainder;
[0112] S1513: If the real-time remainder is a negative number, the number of pulse inputs in the next control cycle is increased according to the real-time remainder.
[0113] In an embodiment of the present invention, the number of input pulses in a certain control cycle is 100, and the number of output pulses is 100.9 pulses. The output is rounded to 101, and the number of output pulses exceeds the number of input pulses by 1. The real-time remainder is -1. When the input shaping calculation is performed in the next control cycle, the weight of 1 pulse is deducted (that is, 1 pulse is reduced when calculating the output).
[0114] The improvement of position input shaping provided by the present invention can sense the changing trend of the position instruction in advance by performing differential processing on the position instruction, provide an advanced control signal for the preset shaper, and ensure that the output signal is consistent with the position quantity of the position instruction by performing integral processing on the shaped position instruction. Finally, the integral signal is compensated by proportional processing to obtain the output signal, thereby improving the impact of phase lag.
[0115] Figure 11 FIG is a schematic block diagram of an improved device 200 for position input shaping provided by an embodiment of the present invention. Figure 11 As shown, corresponding to the above improved method for position input shaping, the present invention also provides an improved device 200 for position input shaping. The improved device 200 for position input shaping includes a unit for executing the above improved method for position input shaping. Figure 11 The position input shaping improvement device 200 includes a first acquisition unit 201 , a first input unit 202 and an integral proportional unit 203 .
[0116] The first acquisition unit 201 is used to acquire the position instruction sent by the host computer, and perform differential processing on the position instruction through a differential operator to obtain a differential signal;
[0117] A first input unit 202 is configured to input the differential signal into a preset shaper so that the preset shaper outputs a shaped position instruction;
[0118] The integral-proportional unit 203 is used to perform integral and proportional processing on the shaped position command to obtain an output signal and control the rotation angle of the servo motor according to the output signal to control the moving distance of the load.
[0119] In some embodiments, such as this embodiment, the integral proportional unit 203 further includes a processing unit and a summing unit.
[0120] The processing unit is configured to perform integration processing on the shaped position by an integral operator to obtain an integral signal and perform proportional processing on the position instruction by a proportional operator to obtain a proportional signal;
[0121] A summing unit is configured to sum the integral signal and the proportional signal to obtain the output signal.
[0122] In some embodiments, such as this embodiment, the apparatus 200 for improving position input shaping further includes a first confirmation unit and a first compensation unit.
[0123] The first confirming unit is configured to perform floating-point data detection on the output signal to confirm whether the output signal contains floating-point data.
[0124] The first compensation unit is configured to perform floating-point compensation on the output signal if the output signal contains the floating-point data.
[0125] In some embodiments, such as the present embodiment, the first compensation unit further comprises a first rounding unit, a first adjusting unit and a second rounding unit.
[0126] The first rounding unit is configured to round the output signal in a current control period to output integer data of the output signal and store the floating-point data into a compensation register.
[0127] The first adjusting unit is configured to add the floating-point data of a previous control period to an output signal of a next control period to obtain a compensated output signal in the next control period.
[0128] The second rounding unit is configured to round the compensated output signal to output integer data of the compensated output signal and store the floating-point data into the compensation register if the compensated output signal contains the floating-point data.
[0129] In some embodiments, such as the present embodiment, the position input shaping improvement device 200 further comprises a first detecting unit, a first calculating unit and a first compensation unit.
[0130] The first detecting unit is configured to confirm whether a target pulse number of a current displacement instruction is consistent with an actual output pulse number if it is detected that there is no data output in a current control period.
[0131] The first calculating unit is configured to calculate a difference between the target pulse number and the actual output pulse number to obtain a compensation value if the target pulse number is not consistent with the actual output pulse number.
[0132] The first compensation unit is configured to output a compensation pulse based on the compensation value to make the actual output pulse number consistent with the target pulse number.
[0133] In some embodiments, such as the present embodiment, the position input shaping improvement device 200 further comprises a second calculating unit and a second adjusting unit.
[0134] The second calculating unit is configured to confirm an input pulse number and an output pulse number in a current control period and calculate a difference between the input pulse number and the output pulse number to obtain a real-time remainder.
[0135] The second adjustment unit is used to adjust the number of pulse inputs in the next control cycle according to the real-time remainder.
[0136] In some embodiments, such as this embodiment, the second adjustment unit further includes a second confirmation unit, a third adjustment unit, and a fourth adjustment unit.
[0137] The second confirmation unit is used to confirm whether the real-time remainder is a positive number;
[0138] a third adjusting unit, configured to reduce the number of pulse inputs in the next control cycle according to the real-time remainder if the real-time remainder is a positive number;
[0139] The fourth adjustment unit is configured to increase the number of pulse inputs in the next control cycle according to the real-time remainder if the real-time remainder is a negative number.
[0140] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned position input shaping improvement device and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and brevity of description, they will not be repeated here.
[0141] The above-mentioned device for improving position input shaping can be implemented in the form of a computer program. The computer program can be used in Figure 12 Runs on the computer equipment shown.
[0142] See also Figure 12 , Figure 12 This is a schematic block diagram of a computer device provided in an embodiment of the present application. This device can be either a terminal or a server. A terminal can be a smartphone, tablet computer, laptop computer, desktop computer, personal digital assistant, wearable device, or other electronic device with communication capabilities. A server can be a standalone server or a server cluster consisting of multiple servers.
[0143] See Figure 12 The computer device 300 includes a processor 302 , a memory, and a network interface 305 connected via a system bus 301 , wherein the memory may include a non-volatile storage medium 303 and an internal memory 304 .
[0144] The non-volatile storage medium 303 may store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, the processor 302 may execute an improved method for position input shaping.
[0145] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300.
[0146] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute an improved method for position input shaping.
[0147] The network interface 305 is used to communicate with other devices. Those skilled in the art will appreciate that Figure 12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 300 to which the solution of the present application is applied. The specific computer device 300 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0148] It should be understood that in the embodiment of the present application, the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (FSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0149] Those skilled in the art will appreciate that all or part of the steps in the method of the above-described embodiment can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the steps in the method of the above-described embodiment.
[0150] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program implements any embodiment of the above-mentioned method for improving position input shaping.
[0151] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.
[0152] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0153] In the several embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the various units is merely a logical functional division, and actual implementation may employ other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0154] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted as needed. The units in the devices of the embodiments of the present invention may be combined, divided, or deleted as needed. Furthermore, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0155] If this integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device to execute all or part of the steps of the method described in various embodiments of the present invention.
[0156] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0157] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, to the extent such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to encompass such changes and modifications.
[0158] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A method for improving position input shaping, characterized in that: The method comprises: Obtaining the position instruction sent by the host computer, and performing differential processing on the position instruction through a differential operator to obtain a differential signal; Inputting the differential signal into a preset shaper so that the preset shaper outputs a shaped position instruction; Performing integration and proportional processing on the shaped position command to obtain an output signal and controlling the rotation angle of the servo motor according to the output signal to control the moving distance of the load; If it is detected that there is no data output in the current control cycle, check whether the target pulse number of the current displacement instruction is consistent with the actual output pulse number; If the target pulse number is inconsistent with the actual output pulse number, calculating the difference between the target pulse number and the actual output pulse number to obtain a compensation value; outputting a compensation pulse based on the compensation value so that the actual output pulse number is consistent with the target pulse number; The step of performing integration processing and proportional processing on the shaped position instruction to obtain an output signal includes: Performing an integration process on the shaped position by an integral operator to obtain an integral signal and performing a proportional process on the position instruction by a proportional operator to obtain a proportional signal; The integrated signal and the proportional signal are summed to obtain the output signal.
2. The method according to claim 1, wherein The method further comprises: Performing floating-point data detection on the output signal to confirm whether floating-point data exists in the output signal; If the floating-point data exists in the output signal, floating-point compensation is performed on the output signal.
3. The method according to claim 2, wherein The step of performing floating-point compensation on the output signal comprises: rounding the output signal in a current control cycle to output integer data of the output signal, and storing the floating-point data in a compensation register; In a next control cycle, adding the floating-point data of the previous control cycle to the output signal of the next control cycle to obtain a compensated output signal; If the floating-point data exists in the compensated output signal, the compensated output signal is rounded to output integer data in the compensated output signal, and the floating-point data is stored in a compensation register.
4. The method according to claim 1, wherein The method further comprises: confirming the number of input pulses and the number of output pulses of the current control cycle, and calculating the difference between the number of input pulses and the number of output pulses to obtain a real-time remainder; The number of pulse inputs in the next control cycle is adjusted according to the real-time remainder.
5. The method according to claim 4, wherein The step of adjusting the number of pulse inputs in the next control cycle according to the real-time remainder comprises: confirming whether the real-time remainder is a positive number; If the real-time remainder is a positive number, the number of pulse inputs in the next control cycle is reduced according to the real-time remainder; If the real-time remainder is a negative number, the number of pulse inputs in the next control cycle is increased according to the real-time remainder.
6. An improved device for position input shaping, characterized in that: The device comprises: A first acquisition unit is used to acquire a position instruction sent by the host computer, and perform differential processing on the position instruction through a differential operator to obtain a differential signal; a first input unit, configured to input the differential signal into a preset shaper so that the preset shaper outputs a shaped position instruction; an integral-proportional unit, configured to perform integral and proportional processing on the shaped position command to obtain an output signal and control the rotation angle of the servo motor according to the output signal to control the moving distance of the load; The first detection unit is used to confirm whether the target pulse number of the current displacement instruction is consistent with the actual output pulse number if it is detected that no data is output in the current control cycle; a first calculating unit, configured to calculate a difference between the target number of pulses and the actual number of output pulses to obtain a compensation value if the target number of pulses is inconsistent with the actual number of output pulses; a first compensation unit, configured to output a compensation pulse based on the compensation value so that the actual output pulse number is consistent with the target pulse number; Wherein, the integral proportion unit includes: a processing unit, configured to perform integration processing on the shaped position by an integral operator to obtain an integral signal and perform proportional processing on the position instruction by a proportional operator to obtain a proportional signal; A summing unit is configured to sum the integral signal and the proportional signal to obtain the output signal.
7. A computer device, characterized in that: The computer device includes a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 can be implemented.
Citation Information
Patent Citations
Positioning control device and its method
JP1998161716A