PI controller parameter optimization method and device, control system, terminal and medium
By setting multiple height sampling points within the stroke range of the sewing machine presser foot and using the iterative clamping method to optimize the PI controller parameters, the problem of insufficient presser foot control accuracy was solved, efficient adaptation to different sewing materials and working conditions was achieved, and sewing quality and efficiency were improved.
Patent Information
- Application Number
- CN202511103105.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-08-07
AI Technical Summary
In the existing sewing machine presser foot control, the PI controller parameters are not optimized, resulting in insufficient control accuracy, affecting sewing efficiency and sewing quality.
By setting multiple height sampling points within the presser foot stroke range of the sewing machine, the iterative clamping method is used to optimize the proportional gain KP and integral gain KI of the PI controller, and the parameter range is dynamically adjusted to obtain the optimized parameters.
It realizes precise control of different presser foot heights, adapts to different sewing materials and working conditions, and improves the efficiency and quality of sewing work.
Smart Images

Figure CN120704116A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of sewing machine presser foot control, and relates to a PI controller parameter optimization method and device, a control system, a terminal and a medium. Background Art
[0002] In the field of sewing machine presser foot control, the Proportional-Integral-Differential (PID) closed-loop control algorithm is commonly used to achieve hovering of the presser foot at an arbitrary target height. However, the algorithm's control performance is highly dependent on the proper setting of control parameters such as the proportional gain KP and the integral gain KI. Improper settings of these control parameters can lead to insufficient control accuracy during presser foot lifting.
[0003] Specifically, the proportional gain KP determines the controller's response speed. A larger proportional gain KP means the controller can more quickly identify and correct deviations, thereby quickly adjusting the presser foot to the target height. However, an excessively large proportional gain KP may cause overshoot or even oscillation, affecting system stability and reliability. Conversely, an excessively small proportional gain KP results in a sluggish controller response and may produce large steady-state errors. Furthermore, the integral gain KI is designed to reduce the system's steady-state error and improve output accuracy. Increasing the integral gain KI enhances the controller's ability to correct accumulated errors, helping to accelerate reaching the setpoint. However, an excessively large integral gain KI can also exacerbate the system's tendency to oscillate. These problems, caused by improperly selected control parameters, not only reduce sewing efficiency but also seriously impact sewing quality and equipment reliability. Summary of the Invention
[0004] The present application provides a PI controller parameter optimization method and device, a control system, a terminal and a medium, which are used to solve the problem of insufficient presser foot lifting control accuracy caused by unoptimized PI controller parameters.
[0005] In the first aspect, the present application provides a PI controller parameter optimization method, comprising: setting a plurality of height sampling points within the presser foot stroke range of a sewing machine; for each of the height sampling points, determining the initial parameters of any one of the proportional gain KP and integral gain KI of the PI controller, as well as the initial parameter range of the other parameter through preliminary testing; and optimizing the other parameter within the initial parameter range using an iterative clamping method to obtain the optimized parameters of the PI controller.
[0006] In an implementation of the first aspect, the iterative clamping method is used to optimize the other parameter within the initial parameter interval, including: step S310, obtaining the intermediate value of the initial parameter interval; step S320, generating a pulse width modulation control signal based on the initial parameter and the intermediate value of the initial parameter interval, and driving the presser foot lifting mechanism of the sewing machine to perform the presser foot lifting action; step S330, obtaining the presser foot displacement signal collected in real time by the presser foot height sensor, and generating a presser foot lifting trajectory through signal processing; step S340, dynamically adjusting the boundary of the initial parameter interval according to the trend of the presser foot lifting trajectory to generate a new parameter interval; step S350, judging whether the range of the new parameter interval is less than a preset threshold; if so, using the intermediate value of the new parameter interval as the optimization parameter of the PI controller; otherwise, using the new parameter interval as the initial parameter interval, and repeating steps S310 to S340 until the range of the new parameter interval is less than the preset threshold.
[0007] In an implementation of the first aspect, dynamically adjusting the boundaries of the initial parameter interval according to the trend of the presser foot lifting trajectory includes: obtaining the overshoot amount of the presser foot lifting trajectory; judging whether the overshoot amount is within the allowable overshoot range; if so, determining that the presser foot lifting trajectory does not overshoot, and using the middle value of the initial parameter interval as the lower limit of the new parameter interval, and using the upper limit of the initial parameter interval as the upper limit of the new parameter interval; otherwise, determining that the presser foot lifting trajectory overshoots, and using the lower limit of the initial parameter interval as the lower limit of the new parameter interval, and using the middle value of the initial parameter interval as the upper limit of the new parameter interval.
[0008] In an implementation of the first aspect, determining the initial parameters of the proportional gain KP of the PI controller and the initial parameter range of the integral gain KI through preliminary testing includes: selecting multiple sewing machines of the same model and specifications as test prototypes; testing each of the test prototypes separately to obtain the proportional gain KP test parameters and integral gain KI test parameters that optimize the performance of the test prototype at each of the height sampling points; performing arithmetic averaging on the proportional gain KP test parameters of all test prototypes at the same height sampling point to obtain the initial parameters of the proportional gain KP; determining the fluctuation range of the integral gain KI test parameters based on the distribution characteristics of the integral gain KI test parameters of all test prototypes at the same height sampling point, and using the fluctuation range as the initial parameter range of the integral gain KI.
[0009] In an implementation of the first aspect, determining the initial parameters of the integral gain KI of the PI controller and the initial parameter range of the proportional gain KP through preliminary testing includes: selecting multiple sewing machines of the same model and specifications as test prototypes; testing each of the test prototypes separately to obtain the proportional gain KP test parameters and integral gain KI test parameters that optimize the performance of the test prototype at each of the height sampling points; performing arithmetic averaging on the integral gain KI test parameters of all test prototypes at the same height sampling point to obtain the initial parameters of the integral gain KI; determining the fluctuation range of the proportional gain KP test parameters based on the distribution characteristics of the proportional gain KP test parameters of all test prototypes at the same height sampling point, and using the fluctuation range as the initial parameter range of the proportional gain KP.
[0010] In an implementation of the first aspect, it further includes: setting the pressure-adjusting nuts of the test prototypes at the middle scale; at the middle scale, the corresponding compression amounts of the pressure-adjusting springs of all the test prototypes remain consistent.
[0011] In the second aspect, the present application provides a PI controller parameter optimization device, including: a sampling setting module, used to set multiple height sampling points within the presser foot stroke range of the sewing machine; a preliminary testing module, used to determine the initial parameters of any one of the proportional gain KP and integral gain KI of the PI controller, and the initial parameter range of the other parameter for each of the height sampling points through preliminary testing; an iterative optimization module, used to optimize the other parameter within the initial parameter range using an iterative clamping method to obtain the optimized parameters of the PI controller.
[0012] In the third aspect, the present application provides a sewing machine control system, comprising: a PI controller parameter optimization device as described above, used to obtain the optimized parameters of the PI controller; a parameter configuration module, connected to the PI controller parameter optimization device, used to configure the PI controller based on the optimized parameters of the PI controller to obtain an optimized PI controller; a motion control module, connected to the parameter configuration module, used to control the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action based on the optimized PI controller.
[0013] In a fourth aspect, the present application provides an electronic device, comprising: a memory, the memory being used to store a computer program; and a processor, the processor being used to execute the computer program stored in the memory, so that the electronic device executes any one of the methods described above.
[0014] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements any of the above-described methods when the computer program is executed by a processor.
[0015] As described above, the PI controller parameter optimization method and device, control system, terminal, and medium described in this application have the following beneficial effects:
[0016] (1) Through precise PI controller parameter optimization design, it can meet the user's control accuracy for different presser foot heights;
[0017] (2) It can effectively adapt to the characteristics of different sewing materials and diverse working conditions, providing strong support for the efficient and high-quality development of sewing work. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Shown is a schematic diagram of presser foot lifting curves corresponding to different integral gains KI according to an embodiment of the present application.
[0019] Figure 2 Shown is a schematic diagram of presser foot lifting curves corresponding to different integral gains KP according to an embodiment of the present application.
[0020] Figure 3 Shown is a structural schematic diagram of an industrial sewing machine according to an embodiment of the present application.
[0021] Figure 4 Shown is a flow chart of a PI controller parameter optimization method according to an embodiment of the present application.
[0022] Figure 5 Shown is a flowchart of a preliminary test of an embodiment of the present application.
[0023] Figure 6 Shown is a flowchart of a preliminary test of another embodiment of the present application.
[0024] Figure 7 Shown is a flowchart of an iterative squeeze method according to an embodiment of the present application.
[0025] Figure 8 Shown is a flowchart of dynamically adjusting the boundaries of an initial parameter interval according to an embodiment of the present application.
[0026] Figure 9 Shown is a flow chart of optimizing the proportional gain KP according to an embodiment of the present application.
[0027] Figure 10 Shown is a flow chart of optimizing the integral gain KI according to an embodiment of the present application.
[0028] Figure 11 Shown is a structural schematic diagram of a PI controller parameter optimization device according to an embodiment of the present application.
[0029] Figure 12 Shown is a structural schematic diagram of a sewing machine control system according to an embodiment of the present application.
[0030] Figure 13 Shown is a structural schematic diagram of an electronic device according to an embodiment of the present application.
[0031] Component number description
[0032] 11 Presser foot lifter electromagnet
[0033] 12 Presser foot lifting mechanism
[0034] 13 Presser foot
[0035] 14 Pressure regulating spring
[0036] 15 Pressure regulating nut
[0037] 16 Presser foot height sensor
[0038] 21 Sampling Setting Module
[0039] 22 Preliminary Test Module
[0040] 23 Iterative Optimization Module
[0041] 31 Parameter configuration module
[0042] 32 Motion Control Module
[0043] 41 Memory
[0044] 42 processors
[0045] 43 Display DETAILED DESCRIPTION
[0046] The following describes the embodiments of the present application through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0047] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. Therefore, the illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0048] Before further explaining the present application in detail, the controllers and control parameters that may be involved in the following embodiments of the present application are first explained:
[0049] <1> The PI controller used in this application can be either an incremental PI controller or a position PI controller. An incremental PI controller takes the difference between the control quantity at the current moment and the control quantity at the previous moment, using the difference as the new control quantity, effectively avoiding the error accumulation problem in the integral link. Its core features include a differential operation mechanism and recursive output calculation. A position PI controller achieves control by controlling the deviation between the current system's actual position and the desired position.
[0050] <2> The control parameters corresponding to the PI controller include proportional gain KP and integral gain KI. The precise control of the presser foot height is achieved through the synergistic effect of these two key parameters. The proportional gain KP refers to the ratio of the output signal to the input signal, and the integral gain KI refers to the integral of the output signal and time.
[0051] <3> The influence of integral gain KI on the response speed of presser foot lifting: When the proportional gain KP is fixed (for example, KP = 1.2) and the integral gain KI is adjusted, the presser foot lifting curve corresponding to different integral gains KI (such as 0.05, 0.1, 0.2) is tested at the same target height (such as 5mm). Figure 1 As shown in the figure, the purple curve (KI1=0.2) shows the fastest response speed, but is accompanied by obvious overshoot and subsequent oscillation; the red curve (KI2=0.1) achieves a better balance between speed and stability; and the blue curve (KI3=0.05) completely avoids overshoot, but the rise time is prolonged.
[0052] <4> The influence of proportional gain KP on the response speed of presser foot lifting: When the integral gain KI is fixed (such as KI = 0.1) and the proportional gain KP is adjusted, Figure 2 As shown in the figure, the green curve (KP1=2.0) shows a slow but steady rise characteristic with a rise time of 120ms; the red curve (KP2=1.5) completes positioning within 90ms without overshoot; and the blue curve (KP3=0.8) reaches the target height in only 60ms, but produces overshoot and continuous oscillation.
[0053] Figure 1 and Figure 2 The horizontal axis corresponds to different acquisition points. These acquisition points are set at fixed intervals (e.g., 180 microseconds) during the presser foot lifting process. This means that presser foot height data is collected every 180 microseconds. The vertical axis represents the collected presser foot height value. At this point, the presser foot height value is actually only the sampled value from the microcontroller's analog-to-digital converter (ADC) and has not yet been converted to the actual height value in millimeters.
[0054] It should be noted that the control parameters of the controller also include a differential gain KD, but the differential gain KD is not within the scope of discussion of this application.
[0055] In actual application scenarios, PI controller parameters need to be dynamically adjusted based on changes in operating conditions. For example, due to the complex and ever-changing operating environment of sewing machines, electromagnets easily generate heat during operation, and this heat generation can affect their performance, thereby affecting the effectiveness of the control parameters. Furthermore, factors such as differences in the scales of different pressure regulating nuts, changes in mechanical friction after long-term use of sewing machines, dimensional changes in mechanical structures due to thermal expansion and contraction, and certain errors in the production and assembly of machine parts can also cause changes in control parameters. Due to the inevitable errors in the production and assembly of machine parts, parameter settings can vary significantly between different devices. Even if parameter calibration is completed at the factory, the original parameters may no longer be applicable with long-term use of the equipment, resulting in a gradual decline in control performance.
[0056] The following embodiments of this application provide a PI controller parameter optimization method and device, control system, terminal, and medium. The technical solution of this application can be applied to scenarios such as the motor speed control system, presser foot height control, and thread tension adjustment of sewing machines. By optimizing control parameters, it improves sewing quality and effectively adapts to the characteristics of different sewing materials and diverse working conditions, providing strong support for efficient and high-quality sewing work.
[0057] See also Figure 3 , which is a schematic diagram of the structure of an industrial sewing machine according to an embodiment of the present application. Figure 3 As shown, the industrial sewing machine in this embodiment includes a presser foot lifting electromagnet 11 , a presser foot lifting mechanism 12 , a presser foot 13 , a pressure adjusting spring 14 , a pressure adjusting nut 15 and a presser foot height sensor 16 .
[0058] Specifically, the presser foot lifting electromagnet 11 is connected to the presser foot 13 via a presser foot lifting mechanism 12, which includes a vertically movable presser foot rod. The lower end of the pressure-adjusting spring 14 acts on the presser foot rod, while the upper end abuts against a scale-marked pressure-adjusting nut 15. The presser foot 13 is fixedly mounted at the end of the presser foot rod, forming a bidirectional force system: the presser foot lifting electromagnet 11 applies an upward pulling force to the presser foot 13 via the presser foot lifting mechanism 12, while the pressure-adjusting spring 14 generates downward pressure via the presser foot rod. During sewing operations, a presser foot height sensor 16 located at the head of the sewing machine can monitor the displacement changes of the presser foot in real time.
[0059] During sewing machine operation, the pedal displacement or pressure signal from the electronic kneerest is converted into an input current signal for the presser foot lifter electromagnet 11. When the operator steps back on the pedal or applies kneerest pressure, the presser foot lifter electromagnet 11 generates a magnetic force under the action of the current, lifting the presser foot 13 upward through the presser foot lifter mechanism 12. In theory, the pedal displacement or kneerest pressure is positively correlated with the height to which the presser foot 13 is lifted. Conversely, when the pedal or kneerest pressure is released, the current to the presser foot lifter electromagnet 11 decreases or is disconnected, causing the presser foot lifter mechanism 12 to descend under the action of gravity. In theory, the distance it descends is positively correlated with the pedal displacement or kneerest pressure. When the pedal or kneerest is fully reset, the presser foot lifter mechanism 12 returns to its initial position.
[0060] It should be noted that the PI controller parameter optimization method described in this application can be run on various types of hardware devices. The hardware device can be a computer including components such as a memory, a storage controller, one or more microcontroller units (MCUs), a peripheral interface, an RF circuit, an audio circuit, a speaker, a microphone, an input / output (I / O) subsystem, a display screen, other output or control devices, and external ports; the computer includes but is not limited to personal computers such as desktop computers, laptops, tablet computers, smart phones, smart TVs, and personal digital assistants (PDAs). In other embodiments, the hardware device can also be a local server or a cloud server. The server can be arranged on one or more physical servers according to various factors such as function and load, or it can be composed of a distributed or centralized server cluster, which is not limited in this embodiment.
[0061] The principles and implementation methods of a PI controller parameter optimization method and device, control system, terminal and medium of this embodiment will be described in detail below, so that those skilled in the art can understand a PI controller parameter optimization method and device, control system, terminal and medium of this embodiment without creative work.
[0062] See also Figure 4 , which is a flow chart of a PI controller parameter optimization method according to an embodiment of the present application. Figure 4 As shown, the present application provides a PI controller parameter optimization method, including the following steps S100 to S300.
[0063] In step S100, a plurality of height sampling points are set within the presser foot stroke range of the sewing machine.
[0064] In this embodiment, the presser foot travel range of the sewing machine refers to the vertical movement range of the presser foot from the initial position to the target height, and its specific value is determined by the mechanical structure and control system of the sewing machine.
[0065] Specifically, the initial position usually corresponds to the reference position of the presser foot, that is, the initial height when the operator does not trigger the pedal or knee rest device; and the target height depends on the maximum stroke displacement of the pedal or knee rest.
[0066] In actual applications, the determination of the presser foot stroke range needs to consider factors such as sewing thickness requirements and mechanical limit protection. The typical industrial sewing machine presser foot stroke range is between 0 and 15 mm.
[0067] This embodiment employs an equidistant distribution principle for the arrangement of height sampling points. For example, a sampling point can be set every millimeter within the presser foot travel range of 0 to 15 mm, resulting in a total of 16 discrete positions. The sampling point density can be adjusted based on the control accuracy requirements. For high-precision sewing applications, the density can be increased to one sampling point every 0.5 mm, while for general applications, a sparse configuration of one sampling point every 2 mm can be used. This discrete height sampling method effectively avoids the signal noise problem associated with continuous detection and provides a clear set value sequence for subsequent parameter adjustments.
[0068] In this implementation, by setting multiple height sampling points, the lifting height of the presser foot can be tracked and controlled more accurately. This method is more adaptable to the needs of the sewing machine under different working conditions than the traditional single sampling point.
[0069] In step S200 , for each of the height sampling points, initial parameters of either the proportional gain KP or the integral gain KI of the PI controller, as well as an initial parameter range of the other parameter, are determined through preliminary testing.
[0070] See also Figure 5 , which is a flow chart showing a preliminary test of an embodiment of the present application. Figure 5 As shown, determining the initial parameter range of the proportional gain KP and the integral gain KI of the PI controller through preliminary testing includes the following steps S201 to S204.
[0071] In step S201, a plurality of sewing machines of the same model and specification are selected as test samples.
[0072] In this embodiment, the number of test samples can be flexibly set based on actual needs. For example, five sewing machines can be selected as test samples, and this number can be expanded to ten or more as needed. Increasing the number of samples effectively expands the test coverage, thereby comprehensively covering different usage scenarios and potential variable factors, significantly improving the applicability and reliability of the test results.
[0073] In step S202, each of the test prototypes is tested respectively to obtain the proportional gain KP test parameter and the integral gain KI test parameter that optimize the performance of the test prototype at each of the height sampling points.
[0074] Taking five test prototypes (such as A, B, C, D and E) as an example, Table 1 shows the proportional gain KP test parameters and integral gain KI test parameters that optimize the performance of each test prototype when the height sampling point is 2 mm.
[0075] Table 1. Optimized parameters and duty cycle data of test prototype A at some height sampling points
[0076] Test prototype Integral gain KI test parameters Proportional gain KP test parameters A 6.9 6.0 B 6.8 6.2 C 6.6 6.1 D 6.8 6.3 E 6.7 6.2
[0077] It should be noted that the proportional gain KP test parameter and the integral gain KI test parameter in this embodiment are values obtained in the parameter coarse adjustment stage, and their accuracy is lower than the final optimization parameters of this application.
[0078] In step S203, the proportional gain KP test parameters of all test samples at the same height sampling point are calculated by arithmetic averaging to obtain the initial parameters of the proportional gain KP.
[0079] Specifically, the following formula can be used to calculate the arithmetic average of the proportional gain KP of the five test samples when the height sampling point is 2 mm:
[0080]
[0081] It should be noted that the initial parameter calculation process of the proportional gain KP of the test prototype at other height sampling points is similar to this and will not be described in detail here.
[0082] In step S204, the fluctuation range of the integral gain KI test parameter is determined based on the distribution characteristics of the integral gain KI test parameter of all test prototypes at the same height sampling point, and the fluctuation range is used as the initial parameter interval of the integral gain KI.
[0083] Specifically, the various integral gain KI test parameters shown in Table 1 can first be sorted. For example, they can be arranged from smallest to largest to obtain an ordered sequence. Next, the mean and standard deviation of all integral gain KI test parameters are calculated, where the mean reflects the center position of the data and the standard deviation reflects the degree of dispersion of the data. Finally, the fluctuation range can be determined by adding or subtracting a certain number of standard deviations with the mean as the center. For example, if you choose to add or subtract 2 times the standard deviation, the fluctuation range can be expressed as: in represents the average value of the five integral gain KI test parameters, and σ1 represents the standard deviation of the five integral gain KI test parameters.
[0084] In other embodiments, appropriate percentiles may be selected to determine the fluctuation range. For example, the 5th percentile and the 95th percentile may be selected as the lower limit and upper limit of the fluctuation range.
[0085] See also Figure 6 , which is a flow chart showing a preliminary test of another embodiment of the present application. Figure 6 As shown, determining the initial parameters of the integral gain KI and the initial parameter range of the proportional gain KP of the PI controller through preliminary testing includes the following steps S211 to S214.
[0086] In step S211, a plurality of sewing machines of the same model and specification are selected as test prototypes.
[0087] In step S212, each of the test prototypes is tested respectively to obtain the proportional gain KP test parameter and the integral gain KI test parameter that optimize the performance of the test prototype at each of the height sampling points.
[0088] It should be noted that the embodiments of step S211 and step S212 described in this embodiment are respectively the same as the above-mentioned step S201 and step S202, and therefore, they will not be repeated here.
[0089] In step S213, performing arithmetic mean calculation on the integral gain KI test parameters of all test samples at the same height sampling point to obtain the initial parameters of the integral gain KI;
[0090] Specifically, the following formula can be used to calculate the arithmetic average of the integral gains KI of the five test samples when the height sampling point is 2 mm:
[0091]
[0092] It should be noted that the initial parameter calculation process of the integral gain KI of the test prototype at other height sampling points is similar to this and will not be described in detail here.
[0093] In step S214, the fluctuation range of the proportional gain KP test parameter is determined based on the distribution characteristics of the proportional gain KP test parameter of all test prototypes at the same height sampling point, and the fluctuation range is used as the initial parameter interval of the proportional gain KP.
[0094] It should be noted that the embodiment of step S214 described in this embodiment is similar to the above-mentioned step S204 and therefore will not be repeated here.
[0095] In one embodiment of the present application, the PI controller parameter optimization method described in the present application also includes: setting the pressure-regulating nuts of the test prototypes to the middle scale; at the middle scale, the corresponding compression amounts of the pressure-regulating springs of all the test prototypes remain consistent.
[0096] For example, the scale range on the pressure-adjusting nut is 2.0 to 3.2. The user manually rotates the pressure-adjusting nut to adjust the compression of the pressure-adjusting spring. As the pressure-adjusting nut is gradually rotated downward, that is, as the scale value on the pressure-adjusting nut increases, the pressure-adjusting spring is compressed more tightly, resulting in a significant increase in the force required to lift the presser foot. Conversely, as the scale value on the pressure-adjusting nut decreases, the pressure-adjusting spring is compressed less, and the force required to lift the presser foot also decreases.
[0097] It should be noted that in order to effectively reduce the random influence caused by the difference in the setting of the pressure regulating nut and ensure the consistency and comparability of the test conditions, the middle scale (i.e., scale = 2.6) is used as the standard position of the test in this embodiment to ensure the accuracy and reliability of the experimental data.
[0098] In this implementation, by averaging the test data of multiple sewing machines, parameter deviations caused by individual differences or accidental errors in a single device can be effectively eliminated, making the ultimately generated control parameters more universal and representative.
[0099] In step S300, the other parameter is optimized within the initial parameter interval using an iterative clamping method to obtain optimized parameters of the PI controller.
[0100] See also Figure 7 , which is a flow chart of the iterative clamping method according to one embodiment of the present application. Figure 7 As shown, optimizing the other parameter within the initial parameter interval using the iterative clamping method includes the following steps S310 to S350.
[0101] Step S310: Obtain the middle value of the initial parameter interval.
[0102] For example, if the initial parameter range of the integral gain KI is Then the middle value of the initial parameter range of the integral gain KI is If the initial parameter range of the proportional gain KP is Then the middle value of the initial parameter interval of proportional gain KP is
[0103] Step S320: Based on the initial parameter and the middle value of the initial parameter range, a pulse width modulation (PWM) control signal is generated, and the presser foot lifting mechanism of the sewing machine is driven to perform a presser foot lifting action.
[0104] In this embodiment, the duty cycle of the PWM control signal determines the driving force of the presser foot lifting mechanism.
[0105] Specifically, a larger duty cycle of the PWM control signal means that the coil in the presser foot lifter electromagnet is energized for a longer period of time per unit cycle. According to the principle of electromagnetic induction, the longer the energization time increases the magnetic field strength generated around the coil, thereby increasing the suction force generated by the electromagnet. This increased suction acts on the presser foot, causing it to lift upward. Conversely, a smaller duty cycle of the PWM control signal means that the coil in the presser foot lifter electromagnet is energized for a shorter period of time per unit cycle, resulting in a weaker magnetic suction force generated by the electromagnet, which reduces the speed at which the presser foot is lifted.
[0106] Step S330: Acquire the presser foot displacement signal collected in real time by the presser foot height sensor, and generate a presser foot lifting trajectory through signal processing.
[0107] In this embodiment, the actual presser foot lifting trajectory intuitively reflects the dynamic movement process of the presser foot from the initial position to the target height through the time-height curve.
[0108] The presser foot height sensor continuously captures the presser foot's displacement, with each data point associated with a precise timestamp. These data, arranged in a time series, form the position coordinates of the presser foot at each moment in its motion. By establishing a coordinate system with time as the horizontal axis and displacement as the vertical axis, all data points are mapped onto this plane. Advanced curve fitting technology then seamlessly connects these discrete points into a smooth curve, representing the actual presser foot lift trajectory and enabling precise visualization of the presser foot's motion.
[0109] The presser foot lifting trajectory can reflect the speed change and stability characteristics of the presser foot during the lifting process. Figure 1 and Figure 2 As shown in the figure, the horizontal axis represents time, and the vertical axis represents the displacement of the presser foot. The trajectory begins at the starting point, marking the start of the lifting action. During the continuous movement, the presser foot undergoes a period of oscillation and adjustment, which is reflected in the slight fluctuations of the trajectory line in the figure. Eventually, the presser foot movement gradually stabilizes and precisely converges to the pre-set target height.
[0110] Step S340: dynamically adjust the boundary of the initial parameter interval according to the trend of the presser foot lifting trajectory to generate a new parameter interval.
[0111] See also Figure 8 , which is a flow chart showing the dynamic adjustment of the boundaries of the initial parameter interval according to an embodiment of the present application. Figure 8 As shown, the step S340 of dynamically adjusting the boundary of the initial parameter interval according to the trend of the presser foot lifting trajectory includes the following steps S341 to S344.
[0112] In step S341, the overshoot of the presser foot lifting trajectory is obtained.
[0113] In this embodiment, the overshoot of the presser foot lifting trajectory refers to the maximum deviation of the presser foot from the target height during the lifting process. For example, if the target presser foot lifting height is H and the presser foot is actually lifted to H+ΔH, then ΔH is the overshoot of the presser foot lifting trajectory.
[0114] In step S342, it is determined whether the overshoot amount is within an allowable overshoot range.
[0115] In step S343, if yes, it is determined that the presser foot lifting trajectory does not overshoot, and the middle value of the initial parameter interval is used as the lower limit of the new parameter interval, and the upper limit of the initial parameter interval is used as the upper limit of the new parameter interval.
[0116] For example, when it is determined that the presser foot lifting trajectory does not overshoot, the parameter range of the new integral gain KI can be expressed as The initial parameter interval of the new proportional gain KP can be expressed as
[0117] In step S344, otherwise, it is determined that the presser foot lifting trajectory is overshooting, the lower limit of the initial parameter interval is used as the lower limit of the new parameter interval, and the middle value of the initial parameter interval is used as the upper limit of the new parameter interval.
[0118] For example, when it is determined that the presser foot lifting trajectory is overshooting, the parameter range of the new integral gain KI can be expressed as The initial parameter interval of the new proportional gain KP can be expressed as
[0119] Step S350, determine whether the range of the new parameter interval is less than the preset threshold; if so, use the middle value of the new parameter interval as the optimization parameter of the PI controller; otherwise, use the new parameter interval as the initial parameter interval and return to step S310 until the range of the new parameter interval is less than the preset threshold.
[0120] See also Figure 9 , which is a flow chart showing the optimization of the proportional gain KP according to an embodiment of the present application. Figure 9As shown in the figure, the target presser foot height is set to 1mm, the initial parameter of the integral gain KI is KI0, and the initial parameter range of the proportional gain KP is [KPmin, KPmax]. The median value of this initial parameter range is KPmid = (KPmin + KPmax) / 2. The PWM control signal generated based on the initial parameter KI0 and the median value KPmid drives the presser foot lifting mechanism to perform the presser foot lifting action. Simultaneously, the presser foot lifting trajectory is generated based on the presser foot displacement signal collected in real time by the presser foot height sensor.
[0121] Then, an overshoot check is performed: if the presser foot lifting trajectory overshoots, KPmin in the initial parameter interval is replaced by KPmid to generate a new parameter interval [KPmid, KPmax]. If the presser foot lifting trajectory does not overshoot, KPmax in the initial parameter interval is replaced by KPmid to generate a new parameter interval [KPmin, KPmid].
[0122] Next, an accuracy check is performed: If the difference between KPmax and KPmid is less than a preset value, it indicates that the proportional gain KP has reached the target accuracy. In this case, the middle value (KPmax + KPmid) / 2 of the parameter interval [KPmid, KPmax] is used as the optimization parameter for the proportional gain KP. Otherwise, it indicates that the proportional gain KP has not yet reached the target accuracy, and steps S310 to S340 need to be repeated to further narrow the value range of the proportional gain KP.
[0123] It should be noted that the preset value can be set according to needs.
[0124] Similarly, if the difference between KPmid and KPmin is less than 1, indicating that the proportional gain KP has reached the target value accuracy, the middle value (KPmid + KPmin) / 2 of the parameter interval [KPmin, KPmid] is used as the optimization parameter for the proportional gain KP. Otherwise, indicating that the proportional gain KP has not yet reached the target value accuracy, it is necessary to calculate the middle value of a new parameter interval to further narrow the value range of the proportional gain KP.
[0125] By executing the above steps, the optimal value of the proportional gain KP when the presser foot is at a target height of 1 mm can be determined. The process of determining the optimal value of the proportional gain KP when the target height is 2 mm is similar and will not be described here.
[0126] See also Figure 10 , which is a flow chart showing the optimization of the integral gain KI according to an embodiment of the present application. Figure 10As shown in the figure, the target presser foot height is set to 1 mm, the initial parameter of the proportional gain KP is KP0, and the initial parameter range of the integral gain KI is [KImin, KImax]. The middle value of this initial parameter range is KImid = (KImin + KImax) / 2. The PWM control signal generated based on the initial parameter KP0 and the middle value KImid drives the presser foot lifting mechanism to perform the presser foot lifting action. At the same time, the presser foot lifting trajectory is generated based on the presser foot displacement signal collected in real time by the presser foot height sensor.
[0127] Then, an overshoot check is performed: if the presser foot lifting trajectory overshoots, KImin in the initial parameter interval is replaced by KImid to generate a new parameter interval [KImid, KImax]. If the presser foot lifting trajectory does not overshoot, KImax in the initial parameter interval is replaced by KImid to generate a new parameter interval [KImin, KImid].
[0128] Next, an accuracy check is performed: If the difference between KImax and KImid is less than a preset value, the integral gain KI has reached the target accuracy. In this case, the middle value (KImax + KImid) / 2 of the parameter interval [KImid, KImax] is used as the optimization parameter for the integral gain KI. Otherwise, the integral gain KI has not yet reached the target accuracy, and steps S310 to S340 need to be repeated to further narrow the value range of the integral gain KI.
[0129] It should be noted that the preset value can be set according to needs.
[0130] Similarly, if the difference between KImid and KImin is less than 1, it indicates that the integral gain KI has reached the target accuracy. In this case, the middle value (KImid + KImin) / 2 of the parameter interval [KImin, KImid] is used as the optimization parameter for the integral gain KI. Otherwise, it indicates that the integral gain KI has not yet reached the target accuracy, and a new middle value of the parameter interval needs to be calculated to further narrow the value range of the integral gain KI.
[0131] By executing the above steps, the optimal value of the integral gain KI when the presser foot is at a target height of 1 mm can be determined. The process of determining the optimal value of the integral gain KI when the target height is 2 mm is similar and will not be described here.
[0132] This implementation significantly reduces the complexity of parameter optimization by adopting a single-variable strategy of fixing one parameter and adjusting another. For example, by fixing the integral gain KI when testing the impact of the proportional gain KP, the independent effect of the proportional gain on the system's dynamic characteristics can be clearly observed, avoiding the interference caused by the coupling of two parameters. This step-by-step optimization approach not only reduces the trial-and-error cost of parameter adjustment but also enables engineers to more systematically understand the actual impact of each parameter. Compared to traditional manual parameter adjustment methods, it is more flexible and efficient, and can better adapt to the nonlinear characteristics and external interference of sewing machines.
[0133] It should be noted that the protection scope of the PI controller parameter optimization method described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing, or replacing steps in the existing technology based on the principles of the present application are included in the protection scope of the present application.
[0134] See also Figure 11 , which is a schematic diagram showing the structure of a PI controller parameter optimization device according to an embodiment of the present application. Figure 11 As shown, the present application provides a PI controller parameter optimization device, including a sampling setting module 21, a preliminary testing module 22 and an iterative optimization module 23.
[0135] The sampling setting module 21 is used to set a plurality of height sampling points within the presser foot stroke range of the sewing machine.
[0136] The preliminary test module 22 is used to determine, for each of the height sampling points, an initial parameter of any one of the proportional gain KP and the integral gain KI of the PI controller, and an initial parameter range of the other parameter through preliminary testing.
[0137] The iterative optimization module 23 is used to optimize the other parameter within the initial parameter interval using an iterative clamping method to obtain the optimized parameters of the PI controller.
[0138] It should be noted that the structures and principles of the sampling setting module 21, preliminary testing module 22 and iterative optimization module 23 described in this embodiment correspond one-to-one to the steps in the above-mentioned PI controller parameter optimization method, so they are not repeated here.
[0139] The PI controller parameter optimization device provided in the embodiment of the present application can implement the PI controller parameter optimization method described in the present application, but the implementation device of the PI controller parameter optimization method described in the present application includes but is not limited to the structure of the PI controller parameter optimization device listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0140] See also Figure 12 , which is a schematic diagram showing the structure of a sewing machine control system according to an embodiment of the present application. Figure 12 As shown, the present application provides a sewing machine control system, including the PI controller parameter optimization device, parameter configuration module 31 and motion control module 32 as described above.
[0141] The PI controller parameter optimization device is used to execute the PI controller parameter optimization method as described in any one of the above items to obtain the optimized parameters of the PI controller.
[0142] It should be noted that the PI controller parameter optimization method performed by the PI controller parameter optimization device described in this embodiment has been described in the above embodiments and will not be repeated here.
[0143] The parameter configuration module 31 is connected to the PI controller parameter optimization device and is used to configure the PI controller based on the optimization parameters of the PI controller to obtain an optimized PI controller.
[0144] In this embodiment, configuring the PI controller includes configuring the proportional gain and the integral gain of the PI controller to ensure that the PI controller can operate according to the optimized parameters.
[0145] The motion control module 32 is connected to the parameter configuration module, and is used to control the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action based on the optimized PI controller.
[0146] In this embodiment, an optimized PI controller is used to control the presser foot lifting mechanism of the sewing machine. This implementation method can ensure that the action of the presser foot lifting mechanism of the sewing machine is more accurate and reliable.
[0147] See also Figure 13 , which is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 13 As shown, the present application provides an electronic device, including a memory 41 and a processor 42.
[0148] The memory 41 is used to store computer programs.
[0149] The processor 42 is configured to execute the computer program stored in the memory, so as to enable the electronic device to perform any of the above methods.
[0150] Preferably, the memory 41 includes various media that can cache program codes, such as ROM, RAM, magnetic disk, USB flash drive, cache card or optical disk.
[0151] Specifically, the memory 41 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 41 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present application.
[0152] The processor 42 is connected to the memory 41 and is used to execute the computer program cached in the memory 41 so that the electronic device executes the method provided in any embodiment of the present application.
[0153] Optionally, the processor 42 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0154] Optionally, the electronic device in this embodiment may further include a display 43. The display 43 is communicatively connected to the memory 41 and the processor 42, and is used to display a GUI interaction interface related to the method provided in any embodiment of the present application.
[0155] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices or methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0156] The modules / units described as separate components may or may not be physically separate, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into a processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into a single module / unit.
[0157] Those skilled in the art should further 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 this application.
[0158] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements any of the above-described methods when executed by a processor. A person of ordinary skill in the art will appreciate that all or part of the steps in the method for implementing the above-described embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state drive, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above-mentioned storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0159] The descriptions of the processes or structures corresponding to the above figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0160] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.
Claims
1. A PI controller parameter optimization method, characterized in that: include: Set multiple height sampling points within the presser foot stroke range of the sewing machine; For each of the height sampling points, determining an initial parameter of any one of the proportional gain KP and the integral gain KI of the PI controller, and an initial parameter range of the other parameter through preliminary testing; The other parameter is optimized within the initial parameter interval using an iterative clamping method to obtain optimized parameters of the PI controller.
2. The method according to claim 1, characterized in that Optimizing the other parameter within the initial parameter interval using an iterative squeeze method includes: Step S310: obtaining the middle value of the initial parameter interval; Step S320: generating a pulse width modulation control signal based on the initial parameter and the middle value of the initial parameter interval, and driving the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action; Step S330: obtaining a presser foot displacement signal collected in real time by a presser foot height sensor, and generating a presser foot lifting trajectory through signal processing; Step S340: dynamically adjusting the boundary of the initial parameter interval according to the trend of the presser foot lifting trajectory to generate a new parameter interval; Step S350, determine whether the range of the new parameter interval is less than the preset threshold; if so, use the middle value of the new parameter interval as the optimization parameter of the PI controller; otherwise, use the new parameter interval as the initial parameter interval, and repeat steps S310 to S340 until the range of the new parameter interval is less than the preset threshold.
3. The method according to claim 2, characterized in that Dynamically adjusting the boundaries of the initial parameter interval according to the trend of the presser foot lifting trajectory includes: Obtaining the overshoot of the presser foot lifting trajectory; Determining whether the overshoot amount is within an allowable overshoot range; If yes, it is determined that the presser foot lifting trajectory does not overshoot, and the middle value of the initial parameter interval is used as the lower limit of the new parameter interval, and the upper limit of the initial parameter interval is used as the upper limit of the new parameter interval; Otherwise, it is determined that the presser foot lifting trajectory is overshooting, the lower limit of the initial parameter interval is used as the lower limit of the new parameter interval, and the middle value of the initial parameter interval is used as the upper limit of the new parameter interval.
4. The method according to claim 1, wherein The initial parameters of the proportional gain KP of the PI controller and the initial parameter range of the integral gain KI are determined through preliminary tests. Select several sewing machines of the same model and specifications as test samples; Testing each of the test prototypes separately to obtain the proportional gain KP test parameter and the integral gain KI test parameter that optimize the performance of the test prototype at each of the height sampling points; Performing arithmetic averaging on the proportional gain KP test parameters of all test prototypes at the same height sampling point to obtain the initial parameters of the proportional gain KP; According to the distribution characteristics of the integral gain KI test parameters of all test prototypes at the same height sampling point, the fluctuation range of the integral gain KI test parameters is determined, and the fluctuation range is used as the initial parameter interval of the integral gain KI.
5. The method according to claim 1, wherein The initial parameters of the integral gain KI of the PI controller and the initial parameter range of the proportional gain KP are determined through preliminary tests. Select several sewing machines of the same model and specifications as test samples; Testing each of the test prototypes separately to obtain the proportional gain KP test parameter and the integral gain KI test parameter that optimize the performance of the test prototype at each of the height sampling points; Performing arithmetic averaging on the integral gain KI test parameters of all test prototypes at the same height sampling point to obtain the initial parameters of the integral gain KI; According to the distribution characteristics of the proportional gain KP test parameters of all test prototypes at the same height sampling point, the fluctuation range of the proportional gain KP test parameters is determined, and the fluctuation range is used as the initial parameter interval of the proportional gain KP.
6. The method according to claim 5, characterized in that Also includes: The pressure-adjusting nuts of the test prototypes are all set at the middle scale; at the middle scale, the corresponding compression amounts of the pressure-adjusting springs of all the test prototypes remain consistent.
7. A PI controller parameter optimization device, characterized in that: include: A sampling setting module is used to set multiple height sampling points within the presser foot stroke range of the sewing machine; a preliminary testing module, configured to determine, for each of the height sampling points, an initial parameter of either a proportional gain KP or an integral gain KI of a PI controller, and an initial parameter range of the other parameter through preliminary testing; The iterative optimization module is used to optimize the other parameter within the initial parameter interval by adopting an iterative clamping method to obtain the optimized parameter of the PI controller.
8. A sewing machine control system, characterized in that: include: The PI controller parameter optimization device as claimed in claim 7, used to obtain optimized parameters of the PI controller; a parameter configuration module, connected to the PI controller parameter optimization device, for configuring the PI controller based on the optimization parameters of the PI controller to obtain an optimized PI controller; A motion control module is connected to the parameter configuration module and is used to control the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action based on the optimized PI controller.
9. An electronic device, characterized in that: include: a memory for storing a computer program; A processor, wherein the processor is configured to execute the computer program stored in the memory so as to enable the electronic device to execute the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Self-adaptive PID incinerator temperature control method and device based on snake optimization algorithm
CN116293718A
Presser foot slow descending control method and system, electronic equipment and sewing machine
CN119372845A
Embroidery thread tension control system and method of embroidery machine
CN119932831A
Systems and methods of biofeedback using nerve stimulation
US20150142082A1
Online ad campaign tuning with PID controllers
US20160110755A1
Cited By
Gyroscope null drift online calibration method and device based on servo system position loop steady state and readable storage medium thereof
CN121163507A
A method, apparatus, and readable storage medium for online gyroscope zero drift calibration based on the position loop steady state of a servo system.
CN121163507B