PI controller parameter optimization method and device based on adaptive algorithm, and terminal
By dynamically adjusting the proportional and integral gain of the sewing machine presser foot controller using an adaptive algorithm, the problem of insufficient control accuracy caused by unoptimized PI controller parameters is solved, achieving efficient and high-quality sewing results.
Patent Information
- Application Number
- CN202511103098.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-10-17
- 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.
An adaptive algorithm-based PI controller parameter optimization method is adopted. Initial parameters are determined through preliminary testing, and multiple height sampling points are set within the sewing machine presser foot stroke range. The proportional gain KP and integral gain KI are dynamically adjusted to generate 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 CN120802597A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of sewing machine presser foot control, and relates to a PI controller parameter optimization method and device based on an adaptive algorithm and a terminal. BACKGROUND
[0002] In the field of sewing machine presser foot control, a proportion-integral-differential (PID) closed-loop control algorithm is commonly used to achieve the hovering of the presser foot at an arbitrary target height. However, the control performance of the presser foot highly depends on the reasonable setting of control parameters such as the proportional gain KP and the integral gain KI. If these control parameters are not properly set, it may cause insufficient control accuracy during the lifting of the presser foot.
[0003] Specifically, the proportional gain KP determines the response speed of the controller. When the proportional gain KP is large, it means that the controller can quickly identify and correct the deviation, thereby rapidly adjusting the presser foot to the target height. However, an excessively large proportional gain KP may cause overshoot or even oscillation, thereby affecting the stability and reliability of the system. Conversely, an excessively small proportional gain KP will result in slow reaction of the controller and may produce a large steady-state error. In addition, the integral gain KI functions to reduce the steady-state error of the system and improve the accuracy of the output. As the integral gain KI increases, the correction ability of the controller for cumulative errors is enhanced, which helps to speed up the reaching of the set point. However, an excessively large integral gain KI will also exacerbate the oscillation tendency of the system. The above problems caused by the selection of unreasonable control parameters not only reduce the sewing efficiency, but also seriously affect the sewing quality and equipment reliability. SUMMARY
[0004] The application provides a PI controller parameter optimization method and device based on an adaptive algorithm, which is used to solve the problem of insufficient control accuracy of the presser foot lifting caused by non-optimized PI controller parameters.
[0005] In a first aspect, the application provides a PI controller parameter optimization method based on an adaptive algorithm, which includes: determining the initial parameters of the proportional gain KP and the integral gain KI of the PI controller through preliminary testing; setting multiple height sampling points within the presser foot stroke range of the sewing machine; for each height sampling point, keeping either the initial parameter of the proportional gain KP or the initial parameter of the integral gain KI constant, and dynamically adjusting the other parameter based on an adaptive algorithm to obtain the optimized parameters of the PI controller.
[0006] In an implementation form of the first aspect, the dynamic adjustment of the initial parameter of the proportional gain KP based on the adaptive algorithm comprises: generating, based on the initial parameter of the proportional gain KP and the initial parameter of the integral gain KI, a pulse width modulation control signal to drive the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action; obtaining a presser foot displacement signal collected by a presser foot height sensor in real time and generating, through signal processing, a presser foot lifting trajectory; obtaining an overshoot amount of the presser foot lifting trajectory; determining whether the overshoot amount exceeds an allowed overshoot range; if yes, increasing the initial parameter of the proportional gain KP to obtain an optimized proportional gain KP; and if no, decreasing the initial parameter of the proportional gain KP to obtain the optimized proportional gain KP.
[0007] In an implementation form of the first aspect, the increasing of the initial parameter of the proportional gain KP comprises: determining, through preliminary testing, an initial parameter interval of the proportional gain KP; adding a first preset value to the initial parameter of the proportional gain KP to obtain a proportional gain KP with an increment; determining whether the proportional gain KP with the increment is within the initial parameter interval; if yes, replacing the initial parameter of the proportional gain KP with the proportional gain KP with the increment, repeating steps S310 and S320 to generate a new presser foot lifting trajectory, and repeating steps S330 and S340 to determine overshoot of the new presser foot lifting trajectory; if the new presser foot lifting trajectory has overshoot, returning to step S352; otherwise, subtracting a second preset value from the proportional gain KP with the increment to obtain the optimized proportional gain KP; and if no, reporting an error and ending the loop.
[0008] In an implementation form of the first aspect, the decreasing of the initial parameter of the proportional gain KP comprises: determining, through preliminary testing, an initial parameter interval of the proportional gain KP; subtracting a first preset value from the initial parameter of the proportional gain KP to obtain a proportional gain KP with a decrement; determining whether the proportional gain KP with the decrement is within the initial parameter interval; if yes, replacing the initial parameter of the proportional gain KP with the proportional gain KP with the decrement, repeating steps S310 and S320 to generate a new presser foot lifting trajectory, and repeating steps S330 and S340 to determine overshoot of the new presser foot lifting trajectory; if the new presser foot lifting trajectory has overshoot, returning to step S362; otherwise, adding a second preset value to the proportional gain KP with the decrement to obtain the optimized proportional gain KP; and if no, reporting an error and ending the loop.
[0009] In an implementation of the first aspect, dynamically adjusting the initial parameters of the integral gain KI based on an adaptive algorithm includes: step S410, generating a pulse width modulation control signal based on the initial parameters of the proportional gain KP and the initial parameters of the integral gain KI to drive the presser foot lifting mechanism of the sewing machine to perform the presser foot lifting action; step S420, 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 S430, obtaining the overshoot of the presser foot lifting trajectory; step S440, judging whether the overshoot exceeds the allowable overshoot range; step S450, if so, reducing the initial parameters of the integral gain KI to obtain the optimized integral gain KI; step S460, otherwise, increasing the initial parameters of the integral gain KI to obtain the optimized integral gain KI.
[0010] In an implementation of the first aspect, determining the initial parameters of the proportional gain KP and the initial parameters of the integral gain KI of the PI controller 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 the 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; 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.
[0011] 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.
[0012] In an implementation of the first aspect, determining 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 that optimize the performance of the test prototype at each of the height sampling points; 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.
[0013] In a second aspect, the application provides a PI controller parameter optimization device based on an adaptive algorithm, comprising: a preliminary test module configured to determine initial parameters of a proportional gain KP and initial parameters of an integral gain KI of a PI controller through a preliminary test; a sampling setting module configured to set a plurality of height sampling points within a presser foot stroke range of a sewing machine; and a parameter adjustment module configured to keep either of the initial parameters of the proportional gain KP and the initial parameters of the integral gain KI constant for each of the height sampling points, and dynamically adjust the other parameter based on an adaptive algorithm to obtain optimized parameters of the PI controller.
[0014] In a third aspect, the application provides a terminal, comprising: a memory configured to store a computer program; and a processor configured to execute the computer program stored in the memory to enable the terminal to perform the method of any one of the above aspects.
[0015] As described above, the PI controller parameter optimization method and device based on an adaptive algorithm, and the terminal according to the application have the following beneficial effects:
[0016] (1) The PI controller parameter optimization design based on an adaptive algorithm achieves accurate PI controller parameter optimization design, and can meet the control accuracy of different presser foot heights of users;
[0017] (2) The PI controller parameter optimization method and device based on an adaptive algorithm can effectively adapt to the characteristics of different sewing materials and diversified working condition requirements, and provide strong support for efficient and high-quality implementation of sewing work. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 FIG. 4 shows a presser foot lifting curve corresponding to different integral gains KI according to an embodiment of the application.
[0019] Figure 2 FIG. 5 shows a presser foot lifting curve corresponding to different proportional gains KP according to an embodiment of the application.
[0020] Figure 3 FIG. 6 shows a structure diagram of an industrial sewing machine according to an embodiment of the application.
[0021] Figure 4 FIG. 7 shows a flowchart of a PI controller parameter optimization method based on an adaptive algorithm according to an embodiment of the application.
[0022] Figure 5 FIG. 8 shows a flowchart of a preliminary test according to an embodiment of the application.
[0023] Figure 6 FIG. 9 shows a flowchart of dynamic adjustment of initial parameters of a proportional gain KP according to an embodiment of the application.
[0024] Figure 7A schematic diagram showing a presser foot lifting trajectory according to an embodiment of the present application.
[0025] Figure 8 A flowchart showing initial parameters of a proportional gain KP according to an embodiment of the present application.
[0026] Figure 9 A flowchart showing initial parameters of a proportional gain KP according to an embodiment of the present application.
[0027] Figure 10 A flowchart showing dynamic adjustment of initial parameters of an integral gain KI according to an embodiment of the present application.
[0028] Figure 11 A flowchart showing initial parameters of an integral gain KI according to an embodiment of the present application.
[0029] Figure 12 A flowchart showing initial parameters of an integral gain KI according to an embodiment of the present application.
[0030] Figure 13 A structural schematic diagram of a PI controller parameter optimization device based on an adaptive algorithm according to an embodiment of the present application.
[0031] Figure 14 A structural schematic diagram of a terminal according to an embodiment of the present application.
[0032] Element number explanation
[0033] 11 Presser foot electromagnet
[0034] 12 Presser foot mechanism
[0035] 13 Presser foot
[0036] 14 Pressure adjusting spring
[0037] 15 Pressure adjusting nut
[0038] 16 Presser foot height sensor
[0039] 21 Preliminary test module
[0040] 22 Sampling setting module
[0041] 23 Parameter adjustment module
[0042] 31 Memory
[0043] 32 Processor DETAILED DESCRIPTION
[0044] The present application can be further understood by the following detailed description and embodiments, which are provided by way of illustration and explanation. The present application can be applied or implemented in other different embodiments, and the details in the specification can be modified or changed based on different views 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 without conflict.
[0045] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner, and only the components related to the present application are shown in the diagrams, not the number, shape and size of the components when actually implemented. The actual implementation of each component may be a random change, and the component layout may be more complex.
[0046] Before further detailing the present application, the controller and control parameters that may be involved in the following embodiments of the present application are first described:
[0047] <1> The PI controller used in the present application can be a delta PI controller or a position PI controller. The delta PI controller calculates the difference between the current control amount and the control amount at the last moment, and uses the difference as the new control amount, effectively avoiding the error accumulation problem of the integral element. Its core features include the difference operation mechanism and the recursive output calculation. The position PI controller controls the deviation between the actual position of the system and the desired position to achieve the control purpose.
[0048] <2> The control parameters corresponding to the PI controller include the proportional gain KP and the integral gain KI, which realize the precise control of the presser height through the synergistic effect of the two key parameters proportional gain KP and integral gain KI. 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 with respect to time.
[0049] <3> The influence of integral gain KI on the response speed of the presser lifting: When the proportional gain KP is fixed (for example, KP = 1.2) and the integral gain KI is adjusted, the presser lifting curve corresponding to different integral gains KI (for example, 0.05, 0.1, 0.2) is tested at the same target height (for example, 5mm). As shown in Figure 1 , 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 good balance between speed and stability; and the blue curve (KI3 = 0.05) completely avoids overshoot, but the rising time is prolonged.
[0050] <4> The influence of the proportional gain KP on the response speed of the presser foot lifting: when fixing the integral gain KI (e.g. KI = 0.1) and adjusting the proportional gain KP, as shown in FIG. 2, the green curve (KP1 = 2.0) presents a slow but stable rising characteristic, with a rising time of 120 ms; the red curve (KP2 = 1.5) completes positioning within 90 ms without overshoot; and the blue curve (KP3 = 0.8) reaches the target height in only 60 ms, but generates overshoot and sustained oscillation. Figure 2
[0051] Figure 1 Figure 2 The abscissa in FIG. 2 corresponds to different collection points. These collection points are set at fixed time intervals (e.g. 180 microseconds) during the lifting of the presser foot, i.e. the height data of the presser foot is collected every 180 microseconds. The ordinate represents the collected height value of the presser foot. At this time, the height value of the presser foot is actually only an analog-to-digital converter (ADC) sampling value of the single-chip microcomputer, which has not yet been converted into an actual height value in millimeters.
[0052] It should be noted that the control parameters of the controller also include the derivative gain KD, but the derivative gain KD is not within the scope of discussion of the present application.
[0053] In actual application scenarios, the PI controller parameters need to be dynamically adjusted according to the changes in the working conditions. For example, due to the complex and variable operating environment of the sewing machine, the electromagnet is prone to heating during operation, and the heating condition will affect its performance, thereby affecting the effectiveness of the control parameters. In addition, differences in different pressure adjusting nuts, changes in mechanical friction after long-term use of the sewing machine, size changes of the mechanical structure due to thermal expansion and contraction, and errors in the production and assembly of machine parts will also cause changes in the control parameters. Due to the inevitable errors in the production and assembly of machine parts, the parameter settings of different devices may differ significantly. Even if the parameters have been calibrated at the time of delivery, the original parameters may no longer be applicable as the device is used for a long time, thereby causing the control performance to gradually decline.
[0054] The following embodiments of the present application provide a PI controller parameter optimization method and device, a control system, a terminal and a medium. The technical solution of the present application can be applied to the motor speed regulation system, presser foot height control, thread tension adjustment and other scenes of the sewing machine, and can improve the sewing quality by optimizing the control parameters, and can also effectively adapt to the characteristics of different sewing materials and diversified working condition requirements, providing strong support for efficient and high-quality sewing work.
[0055] Please refer to Figure 3 Fig. 1 shows a schematic diagram of an industrial sewing machine according to an embodiment of the present application. As shown in Fig. 1, the industrial sewing machine according to the embodiment comprises a presser foot lifter 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. Figure 3
[0056] Specifically, the presser foot lifter electromagnet 11 is connected to the presser foot 13 through the presser foot lifting mechanism 12, which comprises a vertically movable presser foot lever. The lower end of the pressure adjusting spring 14 acts on the presser foot lever, and the upper end abuts against the pressure adjusting nut 15 with a scale mark. The presser foot 13 is fixedly installed at the end of the presser foot lever, forming a bidirectional force system: the presser foot lifter electromagnet 11 exerts an upward pulling force on the presser foot 13 through the presser foot lifting mechanism 12, while the pressure adjusting spring 14 generates a downward pressure through the presser foot lever. During the sewing operation, the presser foot height sensor 16 arranged at the position of the sewing machine head can monitor the displacement change of the presser foot in real time.
[0057] During the operation of the sewing machine, the pedal displacement or the pressure signal of the electronic knee rest can be converted into the input current signal of the presser foot lifter electromagnet 11. When the operator steps on the pedal or applies pressure to the knee rest, the presser foot lifter electromagnet 11 generates a magnetic force under the action of the current, lifts the presser foot 13 upward through the presser foot lifting mechanism 12, and theoretically the pedal displacement or the knee rest pressure value is positively correlated with the lifting height of the presser foot 13; on the contrary, when the pedal or the knee rest pressure is released, the current of the presser foot lifter electromagnet 11 decreases or is disconnected, and the presser foot lifting mechanism 12 descends under the action of gravity, and theoretically the descending distance is positively correlated with the pedal displacement or the knee rest pressure value. When the pedal or the knee rest is completely reset, the presser foot lifting mechanism 12 descends to the initial position.
[0058] It should be noted that the PI controller parameter optimization method based on the adaptive algorithm described in the present application can run on various types of hardware devices. The hardware device can be a computer including a memory, a storage controller, one or more microcontroller units (MCU), 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 and other components; the computer includes but is not limited to personal computers such as desktop computers, notebook computers, tablet computers, smartphones, smart televisions, personal digital assistants (PDA), etc. 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 functions, loads, and other factors, or can be composed of distributed or centralized server clusters, and the present embodiment is not limited.
[0059] The following will describe in detail the principles and implementation methods of a PI controller parameter optimization method, device, and terminal based on an adaptive algorithm in this embodiment, so that those skilled in the art can understand the PI controller parameter optimization method, device, and terminal based on an adaptive algorithm in this embodiment without creative work.
[0060] See also Figure 4 , which is a flow chart of a PI controller parameter optimization method based on an adaptive algorithm according to an embodiment of the present application. Figure 4 As shown, this embodiment provides a PI controller parameter optimization method based on an adaptive algorithm, including the following steps S100 to S300.
[0061] In step S100 , initial parameters of the proportional gain KP and the integral gain KI of the PI controller are determined through preliminary testing.
[0062] See also Figure 5 , which is a flow chart showing a preliminary test of an embodiment of the present application. Figure 5 As shown, step S100 of determining initial parameters of the proportional gain KP and the integral gain KI of the PI controller through preliminary testing may include the following steps S110 to S140 .
[0063] In step S110, a plurality of sewing machines with the same model and specification are selected as test samples.
[0064] 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.
[0065] In step S120, 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.
[0066] 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.
[0067] Table 1. Optimized parameters and duty cycle data of test prototype A at some height sampling points
[0068]
[0069]
[0070] It should be noted that the proportional gain KP test parameters and the integral gain KI test parameters in the embodiment are values obtained in the parameter coarse adjustment stage, and the accuracy is lower than the final optimized parameters.
[0071] In step S130, the proportional gain KP test parameters of all test machines at the same height sampling point are arithmetically averaged to obtain the initial parameters of the proportional gain KP.
[0072] Specifically, the proportional gain KP of the 5 test machines at the height sampling point of 2 mm can be arithmetically averaged by the following formula:
[0073]
[0074] It should be noted that the initial parameter calculation process of the proportional gain KP of the test machines at other height sampling points is similar, and will not be described in detail here.
[0075] In step S140, the integral gain KI test parameters of all test machines at the same height sampling point are arithmetically averaged to obtain the initial parameters of the integral gain KI.
[0076] Specifically, the integral gain KI of the 5 test machines at the height sampling point of 2 mm can be arithmetically averaged by the following formula:
[0077]
[0078] It should be noted that the initial parameter calculation process of the integral gain KI of the test machines at other height sampling points is similar, and will not be described in detail here.
[0079] In an embodiment of the present application, the PI controller parameter optimization method based on the adaptive algorithm further comprises: setting the pressure regulating nuts of the test machines at the middle scale; and at the middle scale, the compression amounts of the pressure regulating springs of all the test machines are consistent.
[0080] For example, the scale range marked on the pressure regulating nut is 2.0 to 3.2. The user can adjust the compression amount of the pressure regulating spring by manually rotating the pressure regulating nut. When the pressure regulating nut is gradually rotated downward, that is, the scale value of the pressure regulating nut increases, the pressure regulating spring is compressed more tightly, resulting in a significant increase in the force required to lift the pressure foot upward. Conversely, the smaller the scale of the pressure regulating nut, the less the compression amount of the pressure regulating spring, and the force required to lift the pressure foot is also correspondingly reduced.
[0081] It should be noted that in order to effectively reduce the random influence caused by the difference in pressure regulating nut setting, ensure the consistency and comparability of test conditions, the middle scale (i.e. scale = 2.6) is used as the standard position for testing in the embodiment, so as to ensure the accuracy and reliability of the experimental data.
[0082] In the present embodiment, by averaging the test data of multiple sewing machines, the parameter deviation caused by individual differences or accidental errors of a single device can be effectively eliminated, so that the finally generated control parameters are more universal and representative.
[0083] In step S200, a plurality of height sampling points are set within the presser foot stroke range of the sewing machine.
[0084] In the present embodiment, the presser foot stroke range of the sewing machine refers to the vertical movement interval of the presser foot from the initial position to the target height, which is determined by the mechanical structure and control system of the sewing machine.
[0085] Specifically, the initial position corresponds to the reference position of the presser foot, i.e. the initial height when the operator does not trigger the pedal or knee rest device; while the target height depends on the maximum stroke displacement of the pedal or knee rest.
[0086] In practical applications, the determination of the presser foot stroke range needs to consider factors such as sewing thickness requirements and mechanical limit protection. The typical presser foot stroke range of an industrial sewing machine is between 0 and 15 millimeters (mm).
[0087] The setting of height sampling points in the present embodiment can adopt the principle of equal interval distribution. For example, one sampling point can be set every millimeter within the 0 to 15 mm presser foot stroke range, so that a total of 16 discrete positions can be obtained. The sampling point density can be adjusted according to the control accuracy requirements. For high-precision sewing applications, the sampling point density can be increased to every 0.5 mm, while in ordinary applications, a sparse configuration of every 2 mm can also be used. This discrete height sampling method can effectively avoid the signal noise problem caused by continuous detection, and at the same time provides a clear sequence of set values for subsequent parameter adjustment.
[0088] In the present embodiment, by setting multiple height sampling points, the lifting height of the presser foot can be more accurately tracked and controlled. This method is more adaptable to the needs of the sewing machine under different working conditions than the traditional single sampling point.
[0089] In step S300, for each of the height sampling points, either the initial parameter of the proportional gain KP or the initial parameter of the integral gain KI is kept constant, and the other parameter is dynamically adjusted based on an adaptive algorithm to obtain the optimized parameters of the PI controller.
[0090] Please refer to Figure 6, shows a flowchart of dynamically adjusting the initial parameter of the proportional gain KP of the comparative example of an embodiment of the present application. As shown in Figure 6 , dynamically adjusting the initial parameter of the proportional gain KP based on the adaptive algorithm includes the following steps S310 to S360.
[0091] Step S310, based on the initial parameter of the proportional gain KP and the initial parameter of the integral gain KI, a pulse width modulation (PWM) control signal is generated to drive the presser lifting mechanism of the sewing machine to perform the presser lifting action.
[0092] In this embodiment, the duty cycle of the PWM control signal determines the driving force of the presser lifting mechanism.
[0093] Specifically, the greater the duty cycle of the PWM control signal, the longer the coil in the presser electromagnet is energized in a unit period. According to the principle of electromagnetic induction, the extension of the energization time will increase the magnetic field strength around the coil, and thus increase the suction force generated by the electromagnet. This increased suction force will act on the presser to lift it upward. Conversely, the smaller the duty cycle of the PWM control signal, the shorter the coil in the presser electromagnet is energized in a unit period, and thus the weaker the magnetic suction force generated by the electromagnet, which reduces the presser lifting speed.
[0094] Step S320, the presser displacement signal collected by the presser height sensor in real time is obtained, and the presser lifting trajectory is generated after signal processing.
[0095] In this embodiment, the actual presser lifting trajectory intuitively reflects the dynamic movement process of the presser from the initial position to the target height through the time-height curve.
[0096] The presser height sensor continuously captures the presser displacement, and each data point corresponds to an accurate timestamp. These data are arranged in time sequence to form the position coordinates of the presser at each time during the movement. By establishing a coordinate system with time as the horizontal axis and displacement as the vertical axis, and mapping all data points to this plane, and then using advanced curve fitting technology to seamlessly connect these discrete points into a smooth curve, the curve represents the actual presser lifting trajectory, achieving accurate visualization of the presser movement state.
[0097] Referring to Figure 7 , shows a schematic diagram of the presser lifting trajectory of an embodiment of the present application.
[0098] The presser lifting trajectory can reflect the speed change and stability characteristics of the presser during the lifting process. As shown in Figure 7As shown in the figure, the horizontal axis represents time, and the vertical axis represents the displacement of the presser foot. The trajectory starts from the starting point, marking the start of the lifting action. During the continuous movement, the presser foot undergoes an oscillation adjustment period, which is reflected in the slight fluctuations of the trajectory line. Finally, the presser foot movement gradually stabilizes and converges precisely to the pre-set target height.
[0099] Step S330, obtaining the overshoot of the presser foot lifting trajectory.
[0100] In this embodiment, the overshoot of the presser foot lifting trajectory refers to the maximum deviation value of the presser foot exceeding the target height during the lifting process. For example, 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.
[0101] Step S340, determining whether the overshoot exceeds the allowed overshoot range.
[0102] Step S350, if yes, increasing the initial parameter of the proportional gain KP to obtain the optimized proportional gain KP.
[0103] Step S360, otherwise, decreasing the initial parameter of the proportional gain KP to obtain the optimized proportional gain KP.
[0104] Please refer to Figure 8 , which shows the flow chart of increasing the initial parameter of the proportional gain KP according to an embodiment of the present application. As shown in the figure, Figure 8 the step of increasing the initial parameter of the proportional gain KP in step S350 includes steps S351 to S355.
[0105] Step S351, determining the initial parameter interval of the proportional gain KP through preliminary testing.
[0106] In an embodiment of the present application, the step of determining the initial parameter interval of the proportional gain KP through preliminary testing in step S351 includes: selecting multiple sewing machines with the same model and specifications as test machines; testing each of the test machines respectively to obtain the proportional gain KP test parameter that optimizes the performance of each test machine at each height sampling point; determining the fluctuation range of the proportional gain KP test parameter according to the distribution characteristics of the proportional gain KP test parameters of all test machines at the same height sampling point, and taking the fluctuation range as the initial parameter interval of the proportional gain KP.
[0107] Specifically, first, each proportional gain KP test parameter shown in Table 1 can be sorted. For example, the sorted sequence can be arranged in ascending order. Then, the mean and standard deviation of all proportional gain KP 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 and subtracting several times the standard deviation from the mean. For example, when choosing to add and subtract 2 times the standard deviation, the fluctuation range can be expressed as: wherein represents the average of the 5 proportional gain KP test parameters, and σ represents the standard deviation of the 5 proportional gain KP test parameters.
[0108] In other embodiments, a suitable percentile can also be selected to determine the fluctuation range. For example, the 5th percentile and the 95th percentile are selected as the lower limit and the upper limit of the fluctuation range.
[0109] Step S352, increase the first preset value on the initial parameter of the proportional gain KP to obtain the proportional gain KP with increment.
[0110] Step S353, determine whether the proportional gain KP with increment is within the initial parameter interval.
[0111] Step S354, if yes, replace the initial parameter of the proportional gain KP with the proportional gain KP with increment, repeat steps S310 and S320 to generate a new presser lifting trajectory, and repeat steps S330 and S340 to determine the overshoot of the new presser lifting trajectory; if the new presser lifting trajectory has overshoot, return to step S352; otherwise, subtract the second preset value from the proportional gain KP with increment to obtain the optimized proportional gain KP.
[0112] Step S355, otherwise, error is reported, and the loop is ended.
[0113] In an embodiment of the present application, the initial parameter of the proportional gain KP is KP0, and the corresponding initial parameter interval is [KPmin, KPmax]. The initial parameter of the integral gain KI is KI0, and the corresponding initial parameter interval is [KImin, KImax].
[0114] When the presser lifting trajectory generated based on the initial parameters KP0 and KI0 has overshoot phenomenon, it indicates that the current initial parameter KP0 can be too small, and needs to be increased by 1 based on the initial parameter KP0 to obtain the proportional gain with increment (KP0+1).
[0115] First, interval range judgment is performed: if the proportional gain with increment (KP0+1) is within the range of [KPmin, KPmax], then the (KP0+1) replaces the initial parameter KP0, and a new initial parameter (KP0+1) is generated. If the (KP0+1) is not within the range of [KPmin, KPmax], then an error is reported, and the loop is ended.
[0116] Then, overshoot judgment is performed: if the foot lifting trajectory generated based on the initial parameters KI0 and the new initial parameter (KP0+1) still has an overshoot phenomenon, then it indicates that the current initial parameter (KP0+1) is still too small, and the proportional gain with increment (KP0+1+1) needs to be obtained again. If the foot lifting trajectory generated based on the initial parameters KI0 and the new initial parameter (KP0+1) does not have an overshoot phenomenon, then (KP0+1-0.5) is taken as the optimized proportional gain KP.
[0117] Please refer to Figure 9 , which shows a flowchart of reducing the initial parameter of the proportional gain KP according to an embodiment of the present application. As shown in Figure 9 , the reducing of the initial parameter of the proportional gain KP includes the following steps S361 to S365.
[0118] Step S361, the initial parameter interval of the proportional gain KP is determined through preliminary testing.
[0119] Step S362, a first preset value is subtracted from the initial parameter of the proportional gain KP, and the proportional gain with increment KP is obtained.
[0120] Step S363, it is judged whether the proportional gain with increment KP is within the initial parameter interval.
[0121] Step S364, if yes, the proportional gain with increment KP replaces the initial parameter of the proportional gain KP, steps 310 and S320 are repeated to generate a new foot lifting trajectory, and steps S330 and S340 are repeated to perform overshoot judgment on the new foot lifting trajectory; if the new foot lifting trajectory has an overshoot, then step S362 is returned; otherwise, the proportional gain with increment KP is increased by a second preset value, and the optimized proportional gain KP is obtained.
[0122] Step S365, otherwise, an error is reported, and the loop is ended.
[0123] In an embodiment of the present application, when the foot lifting trajectory generated based on the initial parameters KP0 and KI0 does not have an overshoot phenomenon, it indicates that the current initial parameter KP0 may be too large, and 1 needs to be subtracted from the initial parameter KP0 to obtain the proportional gain with increment (KP0-1).
[0124] First, interval range judgment is performed: if the proportional gain with decrement (KP0-1) is within the range of [KPmin, KPmax], then the (KP0-1) replaces the initial parameter KP0, and a new initial parameter (KP0-1) is generated. If the (KP0-1) is not within the range of [KPmin, KPmax], then an error is reported, and the loop is ended.
[0125] Then, overshoot judgment is performed: if the foot lifting trajectory generated based on the initial parameter KI0 and the new initial parameter (KP0-1) still does not have an overshoot phenomenon, then it indicates that the current initial parameter (KP0-1) is still too large, and the proportional gain with decrement (KP0-1-1) needs to be obtained again. If the foot lifting trajectory generated based on the initial parameter KI0 and the new initial parameter (KP0-1) has an overshoot phenomenon, then (KP0-1+0.5) is taken as the optimized proportional gain KP.
[0126] Referring to FIG. 4, a flowchart showing dynamic adjustment of the initial parameter of the integral gain KI according to an embodiment of the present application is shown. As shown in FIG. 4, dynamic adjustment of the initial parameter of the integral gain KI based on an adaptive algorithm includes the following steps S410 to S460. Figure 10 Figure 10 Step S410, a pulse width modulation control signal is generated based on the initial parameter of the proportional gain KP and the initial parameter of the integral gain KI, to drive the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action.
[0127] Step S420, a presser foot displacement signal collected in real time by a presser foot height sensor is acquired, and a presser foot lifting trajectory is generated after signal processing.
[0128] Step S430, an overshoot amount of the presser foot lifting trajectory is acquired.
[0129] Step S440, it is judged whether the overshoot amount exceeds an allowed overshoot range.
[0130] Step S450, if yes, the initial parameter of the integral gain KI is reduced, and an optimized integral gain KI is obtained.
[0131] Step S460, otherwise, the initial parameter of the integral gain KI is increased, and an optimized integral gain KI is obtained.
[0132] Step S460, otherwise, the initial parameter of the integral gain KI is increased, and an optimized integral gain KI is obtained.
[0133] Referring to FIG. 5, a flowchart showing reduction of the initial parameter of the integral gain KI according to an embodiment of the present application is shown. As shown in FIG. 5, the reduction of the initial parameter of the integral gain KI in step S450 includes the following steps S451 to S455. Figure 11 Figure 11 Step S451, it is judged whether the overshoot amount exceeds the allowed overshoot range.
[0134] Step S451, determining an initial parameter interval of the integral gain KI through preliminary test.
[0135] Step S452, subtracting a first preset value from the initial parameter of the integral gain KI to obtain an integral gain KI with decrement.
[0136] Step S453, judging whether the integral gain KI with decrement is within the initial parameter interval.
[0137] Step S454, if yes, replacing the initial parameter of the integral gain KI with the integral gain KI with decrement, repeating step S410 and step S420 to generate a new presser lifting trajectory, and repeating step S430 and step S440 to judge overshoot of the new presser lifting trajectory; if the new presser lifting trajectory has overshoot, returning to step S452; otherwise, increasing the integral gain KI with decrement by a second preset value to obtain the optimized integral gain KI.
[0138] Step S455, otherwise, reporting error and ending the loop.
[0139] In an embodiment of the present application, when the presser lifting trajectory generated based on the initial parameters KP0 and KI0 has overshoot, it indicates that the current integral gain KI0 is possibly too large, and it is necessary to subtract 1 from the initial parameter KI0 to obtain an integral gain KI with decrement (KI0-1).
[0140] First, interval range judgment is performed: if the integral gain KI with decrement (KI0-1) is within the range of [KImin, KImax], then (KI0-1) replaces the initial parameter KI0 to generate a new initial parameter (KI0-1). If (KI0-1) is not within the range of [KImin, KImax], then an error is reported and the loop is ended.
[0141] Then, overshoot judgment is performed: if the presser lifting trajectory generated based on the initial parameters KP0 and the new initial parameter (KI0-1) still has overshoot, it indicates that the current initial parameter (KI0-1) is still too large, and it is necessary to obtain an integral gain KI with decrement (KI0-1-1) again. If the presser lifting trajectory generated based on the initial parameters KP0 and the new initial parameter (KI0-1) does not have overshoot, then (KI0-1+0.5) is taken as the optimized integral gain KI.
[0142] Please refer to Figure 12 , which shows a flowchart of increasing the initial parameter of the integral gain KI according to an embodiment of the present application. As shown in Figure 12 , the increasing of the initial parameter of the integral gain KI in step S460 includes the following steps S461 to S465.
[0143] Step S461, determining an initial parameter interval of the integral gain KI through preliminary test.
[0144] Step S462, adding a first preset value to the initial parameter of the integral gain KI to obtain an integral gain KI with increment.
[0145] Step S463, judging whether the integral gain KI with increment is within the initial parameter interval.
[0146] Step S464, if yes, replacing the initial parameter of the integral gain KI with the integral gain KI with increment, repeating steps S410 and S420 to generate a new presser lifting trajectory, and repeating steps S430 and S4340 to judge overshoot of the new presser lifting trajectory; if the new presser lifting trajectory has no overshoot, returning to step S462; otherwise, subtracting a second preset value from the integral gain KI with increment to obtain the optimized integral gain KI.
[0147] Step S465, otherwise, reporting error and ending the loop.
[0148] In an embodiment of the present application, when the presser lifting trajectory generated based on the initial parameters KP0 and KI0 has no overshoot, it indicates that the current initial parameter KI0 is possibly too small, and needs to be increased by 1 based on the initial parameter KI0 to obtain an integral gain KI with increment (KI0+1).
[0149] First, interval range judgment is performed: if the integral gain KI with increment (KI0+1) is within the range of [KImin, KImax], then (KI0+1) replaces the initial parameter KI0 to generate a new initial parameter (KI0+1). If (KI0+1) is not within the range of [KImin, KImax], an error is reported and the loop is ended.
[0150] Then, overshoot judgment is performed: if the presser lifting trajectory generated based on the initial parameter KP0 and the new initial parameter (KI0+1) still has no overshoot, it indicates that the current initial parameter (KI0+1) is still too small, and the integral gain KI with increment (KI0+1+1) needs to be obtained again. If the presser lifting trajectory generated based on the initial parameter KP0 and the new initial parameter (KI0+1) has overshoot, (KI0+1-0.5) is taken as the optimized integral gain.
[0151] In the present implementation, the complexity of parameter optimization is significantly reduced by adopting a single-variable strategy of fixing one parameter and adjusting the other parameter. For example, when testing the impact of the proportional gain KP, the integral gain KI is fixed. The independent effect of the proportional gain on the system dynamic characteristics can be clearly observed, avoiding the interference caused by the coupling of the two parameters. This step-by-step optimization method not only reduces the trial-and-error cost of parameter adjustment, but also enables engineers to better understand the actual impact of each parameter. Compared with the traditional manual parameter adjustment method, it is more flexible and efficient, and can better adapt to the nonlinear characteristics and external disturbances of the sewing machine.
[0152] Referring to Figure 13 , a structure schematic diagram of a PI controller parameter optimization device based on an adaptive algorithm according to an embodiment of the present application is shown. As Figure 13 indicated, the present application provides a PI controller parameter optimization device based on an adaptive algorithm, which includes a preliminary test module 21, a sampling setting module 22 and a parameter adjustment module 23.
[0153] The preliminary test module 21 is used to determine the initial parameters of the proportional gain KP and the integral gain KI of the PI controller through preliminary testing.
[0154] The sampling setting module 22 is used to set multiple height sampling points within the range of the presser foot stroke of the sewing machine.
[0155] The parameter adjustment module 23 is used to keep either the initial parameter of the proportional gain KP or the initial parameter of the integral gain KI constant for each height sampling point, and dynamically adjust the other parameter based on an adaptive algorithm to obtain the optimized parameters of the PI controller.
[0156] Referring to Figure 14 , a structure schematic diagram of a terminal according to an embodiment of the present application is shown. As Figure 14 indicated, the present application provides a terminal, which includes a memory 31 and a processor 32.
[0157] The memory 31 is used to store a computer program.
[0158] The processor 32 is used to execute the computer program stored in the memory, so that the terminal executes the method described in any one of the above.
[0159] Preferably, the processor 32 can be a general processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; also can be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The memory 31 can be realized by any type of volatile or non-volatile storage device or their combination, for example, a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic storage, a flash memory, a magnetic disk or an optical disk.
[0160] In several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules / units is only a logical function division, and in actual implementation, there can be another division manner, for example, a plurality of modules or units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed ones can be through some interfaces, indirect coupling or communication connection between the devices or modules or units, and can be electrical, mechanical or other forms.
[0161] The modules / units described as separated parts can or can not be physically separated, and the parts shown as modules / units can or can not be physical modules, that is, can be located in one place, or can be distributed to multiple network units. Part or all of the modules / units can be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in each embodiment of the present application can be integrated in one processing module, or each module / unit can be physically present alone, or two or more modules / units can be integrated in one module / unit.
[0162] Those of ordinary skill in the art should further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, each example has been described in the above description in terms of its general functionality, without regard to the specific manner in which the functionality is achieved. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0163] The above description of the flow or structure of each figure has its own emphasis, and the parts not described in detail in a certain flow or structure can refer to the related description of other flows or structures.
[0164] The above embodiments are only illustrative of the principles and effects of the present application, and are not intended to limit the present application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical idea of the present application should be covered by the claims of the present application.
Claims
1. A PI controller parameter optimization method based on an adaptive algorithm, characterized in that: include: Determine the initial parameters of the proportional gain KP and the initial parameters of the integral gain KI of the PI controller through preliminary tests; Set multiple height sampling points within the presser foot stroke range of the sewing machine; For each of the height sampling points, either the initial parameter of the proportional gain KP or the initial parameter of the integral gain KI is kept constant, and the other parameter is dynamically adjusted based on an adaptive algorithm to obtain the optimized parameter of the PI controller.
2. The method according to claim 1, characterized in that Dynamically adjusting the initial parameters of the proportional gain KP based on the adaptive algorithm includes: Step S310: generating a pulse width modulation control signal based on the initial parameters of the proportional gain KP and the initial parameters of the integral gain KI to drive the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action; Step S320: 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 S330, obtaining the overshoot of the presser foot lifting trajectory; Step S340: determining whether the overshoot exceeds the allowable overshoot range; Step S350: If yes, increase the initial parameter of the proportional gain KP to obtain the optimized proportional gain KP; Step S360: Otherwise, reduce the initial parameter of the proportional gain KP to obtain the optimized proportional gain KP.
3. The method according to claim 2, characterized in that The initial parameters for increasing the proportional gain KP include: Step S351: determining an initial parameter range of the proportional gain KP through preliminary testing; Step S352: Add a first preset value to the initial parameter of the proportional gain KP to obtain an incremental proportional gain KP; Step S353: Determine whether the incremental proportional gain KP is within the initial parameter range; Step S354: If yes, replace the initial parameter of the proportional gain KP with the incremental proportional gain KP, repeat steps S310 and S320 to generate a new presser foot lifting trajectory, and repeat steps S330 and S340 to perform overshoot judgment on the new presser foot lifting trajectory; if the new presser foot lifting trajectory has overshoot, return to step S352; otherwise, subtract a second preset value from the incremental proportional gain KP to obtain the optimized proportional gain KP; Step S355: Otherwise, an error is reported and the loop ends.
4. The method according to claim 2, characterized in that The initial parameters for reducing the proportional gain KP include: Step S361: determining an initial parameter range of the proportional gain KP through preliminary testing; Step S362: Subtract a first preset value from the initial parameter of the proportional gain KP to obtain a proportional gain KP with a decrement; Step S363: determining whether the proportional gain KP with decrement is within the initial parameter range; Step S364: If yes, replace the initial parameter of the proportional gain KP with the proportional gain KP with the decrement, repeat steps 310 and S320 to generate a new presser foot lifting trajectory, and repeat steps S330 and S340 to perform overshoot judgment on the new presser foot lifting trajectory; if the new presser foot lifting trajectory has overshoot, return to step S362; otherwise, increase the proportional gain KP with the decrement by a second preset value to obtain the optimized proportional gain KP; Step S365: Otherwise, an error is reported and the loop ends.
5. The method according to claim 1, wherein Dynamically adjusting the initial parameters of the integral gain KI based on the adaptive algorithm includes: Step S410: generating a pulse width modulation control signal based on the initial parameters of the proportional gain KP and the initial parameters of the integral gain KI to drive the presser foot lifting mechanism of the sewing machine to perform a presser foot lifting action; Step S420: 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 S430, obtaining the overshoot of the presser foot lifting trajectory; Step S440: determining whether the overshoot exceeds an allowable overshoot range; Step S450: If yes, reduce the initial parameter of the integral gain KI to obtain the optimized integral gain KI; Step S460: Otherwise, increase the initial parameter of the integral gain KI to obtain the optimized integral gain KI.
6. The method according to claim 1, characterized in that The initial parameters of the proportional gain KP and the integral gain KI of the PI controller determined through preliminary tests include: 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; The integral gain KI test parameters of all test prototypes at the same height sampling point are arithmetic averaged to obtain the initial parameters of the integral gain KI.
7. The method according to claim 6, 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.
8. The method according to claim 4, characterized in that The initial parameter range of the proportional gain KP determined through preliminary testing includes: Select several sewing machines of the same model and specifications as test samples; Testing each of the test prototypes separately to obtain a proportional gain KP test parameter that optimizes the performance of the test prototype at each height sampling point; 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.
9. A PI controller parameter optimization device based on an adaptive algorithm, characterized in that: include: A preliminary test module is used to determine initial parameters of the proportional gain KP and the integral gain KI of the PI controller through preliminary tests; A sampling setting module is used to set multiple height sampling points within the presser foot stroke range of the sewing machine; A parameter adjustment module is used to keep any one of the initial parameters of the proportional gain KP and the initial parameters of the integral gain KI constant for each of the height sampling points, and dynamically adjust the other parameter based on an adaptive algorithm to obtain the optimized parameters of the PI controller.
10. A terminal, 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 terminal to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
PID parameter setting method based on step response characteristic data of controlled object
CN112286043A
Appliance with modified proportional-integral control
CN116437841A
PID parameter adjustment method and device based on SA and PID parameter adjustment system
CN119805919A
Active PID gain tuning
US20180275696A1
Pattern recognition adaptive controller
US5355305A