Mechanical arm control method and device based on SMA wire control, electronic equipment and storage medium
By loading the calibration coefficients of the initial resistance and displacement data set, combining dynamic PID parameter adjustment and historical duty cycle prediction algorithm, the current and resistance parameters are monitored in real time, and the problem of difficult to take into account both displacement accuracy and response speed in SMA wire control is achieved, achieving high accuracy, fast response and stable signal output.
Patent Information
- Application Number
- CN202510788425.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-13
AI Technical Summary
The heating-cooling hysteresis and nonlinear deformation characteristics of SMA wire in the prior art make it difficult to take into account the tiny displacement accuracy and dynamic response speed of traditional PID control. At the same time, the PWM output stability and feedback signal reliability lack systematic detection, which easily introduces control errors or safety hazards.
By loading the calibration coefficients of the initial resistance and displacement data set, combining dynamic PID parameter adjustment and historical duty cycle prediction algorithm, the current and resistance parameters are monitored in real time, the PWM duty cycle output range is limited, and a modular independent control architecture is designed to achieve accurate displacement control and stable signal output.
Improve displacement control accuracy, shorten response time, enhance system stability and anti-saturation, reduce energy consumption, prevent hardware damage, ensure signal output stability, and avoid control jitter.
Smart Images

Figure CN120326631A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mechanical control, and particularly to a control method, device, electronic device and storage medium for a robotic arm based on SMA wire control. Background Art
[0002] With the development of intelligent manufacturing and flexible drive technology, SMA wires have gradually become a research hotspot for new robotic arm actuators due to the lightweight of the drive device, simple structure and low energy consumption. However, the heating-cooling hysteresis and non-linear deformation characteristics of SMA wires make it difficult for traditional PID control to balance the micro-displacement accuracy and dynamic response speed. At the same time, in the prior art, there is a lack of systematic detection means for the PWM output stability and the reliability of the feedback signal, which is likely to introduce control errors or safety hazards.
[0003] Therefore, there are defects in the prior art and it needs to be improved and developed. Summary of the Invention
[0004] Embodiments of the invention provide a control method, device, electronic device and storage medium for a robotic arm based on SMA wire control, which are used to solve the problems that in the prior art, due to the heating-cooling hysteresis and non-linear deformation characteristics of SMA wires, it is difficult for traditional PID control to balance the micro-displacement accuracy and dynamic response speed, and at the same time, in the prior art, there is a lack of systematic detection means for the PWM output stability and the reliability of the feedback signal, which is likely to introduce control errors or safety hazards.
[0005] In the first aspect of the embodiments of the present invention, a control method for a robotic arm based on SMA wire control is provided. The robotic arm includes several joints of the robotic arm individually driven by SMA wires, and the method includes: When the joint of the robotic arm is fixed at the zero displacement point, measure the initial resistance R0 of the SMA wire, and when the joint of the robotic arm generates a displacement S to the maximum displacement S max then measure the resistance of the SMA wire at each generated displacement to obtain a displacement-resistance data set, and linearly fit the displacement-resistance data set to obtain a relationship between the SMA wire and the joint displacement of the robotic arm , where R is the resistance of the SMA wire measured when the joint displacement of the robotic arm is S, and calculate the displacement calibration coefficient k by substituting the joint displacement S, resistance R, and initial resistance R0; load the initial values Kp, Ki, Kd of the PID control parameters, where the proportional coefficient Kp is 10, the integral coefficient Ki is 0.1, and the differential coefficient Kd is 0.5; Read the fluctuations of the resistance value of the SMA wire collected by the ADC sampling and the PWM output. If the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable, then receive the set displacement instruction sent by the host computer; otherwise, re-read the ADC sampling fluctuations and the PWM output until the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable; According to the set displacement instruction and the maximum displacement S of the robotic arm max , determine whether the set displacement is within [0, S max . If so, update the PID; otherwise, ignore the set displacement instruction and alarm until the set displacement is within [0, S max ; According to the resistance value of the SMA wire collected by the ADC sampling and the displacement calibration coefficient k, calculate the displacement deviation e(t) to generate the PID control quantity Dpid; Predict the next PWM duty cycle Dout according to the historical duty cycle Dpid; Output the Dout of each SMA wire in the joints of the robotic arm to the PWM to proportionally increase the heating power of each independent SMA wire for driving each joint in the robotic arm.
[0006] Furthermore, the calculating the displacement deviation e(t) according to the resistance value of the SMA wire collected by the ADC sampling and the displacement calibration coefficient k to generate the PID control quantity Dpid includes: Obtain the current resistance value of the SMA wire according to the ADC sampling; Calculate the current displacement of the joint of the robotic arm according to the current resistance value of the SMA wire and the displacement calibration coefficient k; Calculate the displacement deviation e(t) according to the difference between the current displacement of the joint of the robotic arm and the previous displacement of the joint of the robotic arm; wherein, when the current displacement of the joint of the robotic arm is the first displacement, the previous displacement of the joint of the robotic arm is 0; Generate the PID control quantity Dpid according to the displacement deviation e(t), and the formula is: Dpid = Kp·e(t)+Ki·∑e(t)+Kd·(de(t) / dt).
[0007] Furthermore, generating the PID control quantity Dpid according to the displacement deviation e(t) includes: Dynamically adjust the PID parameters according to the displacement deviation e(t), wherein, if |e(t)|>10mm, then increase Kp to 2 times the initial value, Ki = 0, and Kd remains the initial value; If 10mm ≥ |e(t)| > 2mm, then Kp remains at its initial value, Ki = 0.1, and Kd remains at its initial value; If |e(t)| ≤ 2mm, then Kd increases to 1.5 times its initial value, and Kp and Ki remain at their initial values; If e(t) remains unchanged continuously, then the integral accumulation value of ∑e(t) is cleared.
[0008] Further, the prediction of the next PWM duty cycle Dout based on the historical duty cycle Dpid includes: Calculating the next PWM duty cycle Dout according to Dout = Dout0 + y·(Dpid1 - Dpid2 - 1); where Dout0 is the current PWM duty cycle during prediction; y is the prediction gain coefficient, and its value range is (0.2, 0.5); Dpid1 is the current PID control quantity during prediction, Dpid2 is the previous PID control quantity during prediction, and when Dpid1 is the first generated PID control quantity, Dpid2 is equal to 0; When the calculation result of Dout is within the range of [10%, 90%], output the next PWM duty cycle Dout; otherwise, recalculate the next PWM duty cycle Dout until the calculation result of Dout is within the range of [10%, 90%].
[0009] Further, the output of Dout of each SMA wire in the joints of the robotic arm to PWM to proportionally increase the heating power of each independent SMA wire for driving each joint of the robotic arm includes: monitoring the current and resistance parameters. If the current exceeds 1.5 times the rated current or the resistance exceeds 110% of the corresponding resistance value, then turn off the PWM output; otherwise, continuously detect the current and resistance parameters. max If the current exceeds 1.5 times the rated current or the resistance exceeds 110% of the corresponding resistance value, then turn off the PWM output; otherwise, continuously detect the current and resistance parameters.
[0010] Further, the evaluation criteria for the stability of the PWM output channel include at least one of the following: the frequency obtained by an oscilloscope and a multimeter is within ±0.1%, the duty cycle is within ±1%, the error between the average voltage and the theoretical value < 2%, and the jitter < 5ns.
[0011] In the second aspect of the embodiments of the present invention, there is provided a device for a control method of a robotic arm based on SMA wire control, including: A loading module, configured to load the initial resistance R0 of the SMA wire measured when the joints of the robotic arm are fixed at the zero displacement point, and the resistance of the SMA wire measured when the joints of the robotic arm generate a displacement S to the maximum displacement S max to obtain a displacement-resistance data set, and linearly fit the displacement-resistance data set to obtain the relationship between the SMA wire and the joint displacement of the robotic arm , where R is the resistance of the SMA wire measured when the joint displacement of the robotic arm is S. The displacement calibration coefficient k is calculated by substituting the joint displacement S, the resistance R, and the initial resistance R0; the initial values of the PID control parameters Kp, Ki, and Kd are loaded, where the proportional coefficient Kp is 10, the integral coefficient Ki is 0.1, and the derivative coefficient Kd is 0.5; A reading module, configured to read the fluctuation of the resistance value of the SMA wire collected by the ADC sampling and the PWM output. If the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable, it receives the set displacement command sent by the host computer; otherwise, it reads the ADC sampling fluctuation and the PWM output again until the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable; A judgment module, configured to judge whether the set displacement is within [0, S max , according to the set displacement command and the maximum displacement S of the robotic arm max . If so, the PID is updated; otherwise, the set displacement command is ignored and an alarm is given until the set displacement is within [0, S max ; A first calculation module, configured to calculate the displacement deviation e(t) according to the resistance value of the SMA wire collected by the ADC sampling and the displacement calibration coefficient k, so as to generate a PID control quantity Dpid; A second calculation module, configured to predict the next PWM duty cycle Dout according to the historical duty cycle Dpid; An output module, configured to output Dout of each SMA wire in the joints of the robotic arm to the PWM to proportionally increase the heating power of each independent SMA wire, for driving each joint in the robotic arm.
[0012] In a third aspect of the embodiments of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the control method of the robotic arm based on SMA wire control is implemented.
[0013] In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is executed by the processor, the control method of the robotic arm based on SMA wire control is implemented.
[0014] Beneficial effects: As can be seen from the above technical solutions, the present invention provides a control method for a robotic arm based on SMA wire control: 1. Improve the accuracy of displacement control: Through the dynamic PID parameter hierarchical adjustment mechanism, in the large error area (|e(t)| > 10 mm), the proportional coefficient Kp is increased to 2 times the initial value and the integral term is turned off to quickly reduce the displacement deviation; in the small error area (|e(t)| ≤ 2 mm), the differential coefficient Kd is increased to 1.5 times the initial value to effectively suppress oscillations. Combined with the accurate calibration of the displacement-resistance linear model, the improvement of displacement control accuracy is achieved.
[0015] 2. Achieve fast response and delay compensation: Based on the PWM prediction algorithm of historical duty cycle data, the next cycle duty cycle is predicted through the formula Dout = Dout0 + y·(Dpid1 - Dpid2 - 1), and the SMA thermal inertia delay is compensated by combining the prediction gain coefficient, shortening the system response time.
[0016] 3. Improve anti-saturation and stability: By limiting the PWM duty cycle output range to 10% - 90%, avoid the performance degradation of SMA filaments caused by overheating or insufficient drive; design a dynamic integral reset mechanism, which can clear the integral accumulation value when the error remains unchanged for 10 ms, preventing the out-of-control of the control quantity caused by mechanical jamming.
[0017] 4. Improve reliability: Real-time monitor the current and resistance parameters. When the current exceeds 1.5 times the rated value or the resistance exceeds 110% of the corresponding resistance value, immediately cut off the PWM output to prevent the SMA filament from being overloaded and burned or the mechanical structure from being damaged due to over-travel. max 5. Achieve modular independent control and energy consumption optimization: The single-joint single-wire independent drive architecture can convert the upper computer angle command into a displacement command by combining the joint displacement of the robotic arm with the geometric mapping relationship θ = ƒ(S), realizing the coordinated motion control of multiple joints; limit the invalid duty cycle output through anti-saturation processing to reduce the overall energy consumption.
[0018] 6. Parameter self-adaptability: Based on measuring the resistance of the SMA filament when the joint of the robotic arm is fixed at the zero displacement point and when the joint of the robotic arm is driven to produce a displacement S to the maximum displacement S, realize the linear fitting of multi-displacement point calibration, dynamically correct the resistance-displacement model, adapt to the parameter drift of the SMA filament during long-term use, and ensure the stability of control accuracy.
[0019] 7. Improve the stability of signal output: Detect the frequency error (±0.1%), duty cycle deviation (±1%) and voltage jitter (< 5 ns) of the PWM output channel through an oscilloscope and a multimeter to ensure the high stability of the drive signal and avoid the tremor of the robotic arm caused by control jitter. max 8. Improve the accuracy of displacement control: Through the dynamic PID parameter hierarchical adjustment mechanism, in the large error area (|e(t)| > 10 mm), the proportional coefficient Kp is increased to 2 times the initial value and the integral term is turned off to quickly reduce the displacement deviation; in the small error area (|e(t)| ≤ 2 mm), the differential coefficient Kd is increased to 1.5 times the initial value to effectively suppress oscillations. Combined with the accurate calibration of the displacement-resistance linear model, the improvement of displacement control accuracy is achieved.
[0020] 9. Achieve fast response and delay compensation: Based on the PWM prediction algorithm of historical duty cycle data, the next cycle duty cycle is predicted through the formula Dout = Dout0 + y·(Dpid1 - Dpid2 - 1), and the SMA thermal inertia delay is compensated by combining the prediction gain coefficient, shortening the system response time.
[0021] It should be understood that all combinations of the foregoing concepts and additional concepts described in more detail below are considered to be part of the inventive subject matter of the present disclosure as long as such concepts are not mutually inconsistent.
[0022] The foregoing and other aspects, embodiments, and features of the teachings of the present invention can be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as the features and / or advantageous effects of exemplary embodiments, will be apparent from the following description or will be learned through practice of specific embodiments in accordance with the teachings of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings are not drawn to scale with respect to actual reference objects. In the drawings, each identical or approximately identical component shown in each figure may be denoted by the same reference numeral. For clarity, not every component is labeled in each figure. Now, embodiments of various aspects of the present invention will be described by way of example and with reference to the drawings, wherein: Figure 1 It is a flowchart of a control method for a robotic arm based on SMA wire control in an embodiment of the present application.
[0024] Figure 2 It is a flowchart of step S102 in an embodiment of the present application.
[0025] Figure 3 It is a flowchart of step S104 in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present invention without creative efforts fall within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein shall have the ordinary meanings understood by those of ordinary skill in the art to which the present invention pertains.
[0027] In the description and claims of this invention patent application, the terms "first", "second" and similar terms do not denote any order, quantity or importance, but are merely used to distinguish different components. Similarly, unless the context clearly indicates otherwise, singular forms such as "a", "an" or "the" and similar terms do not denote a limitation of quantity, but rather indicate the existence of at least one. Terms such as "comprising" or "including" mean that the elements or items appearing before "comprising" or "including" cover the features, wholes, steps, operations, elements and / or components listed after "comprising" or "including", and do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations. Terms such as "upper", "lower", "left", "right" are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0028] In the prior art, due to the heating-cooling hysteresis and non-linear deformation characteristics of the SMA wire, it is difficult for traditional PID control to balance the micro-displacement accuracy and dynamic response speed. At the same time, in the prior art, there is a lack of systematic detection means for the stability of PWM output and the reliability of feedback signals, which easily introduces problems of control errors or safety hazards.
[0029] In view of this, an embodiment of the present invention provides a control method for a robotic arm based on SMA wire control. The robotic arm includes several joints of the robotic arm individually driven by SMA wires. Referring to Figure 1 , including: Step S102: When the joint of the robotic arm is loaded and fixed at the zero displacement point, measure the initial resistance R0 of the SMA wire, and when the joint of the robotic arm generates a displacement S to the maximum displacement S max then measure the resistance of the SMA wire at each generated displacement to obtain a displacement-resistance data set, and linearly fit the displacement-resistance data set to obtain the relationship between the SMA wire and the joint displacement of the robotic arm , where R is the resistance of the SMA wire measured when the joint displacement of the robotic arm is S. By substituting the joint displacement S, resistance R, and initial resistance R0, calculate to obtain the displacement calibration coefficient k; load the initial values Kp, Ki, Kd of the PID control parameters, where the proportional coefficient Kp is 10, the integral coefficient Ki is 0.1, and the differential coefficient Kd is 0.5; Step S104: Read the fluctuations of the resistance value of the SMA wire collected by the ADC sampling and the PWM output. If the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable, then receive the set displacement instruction sent by the host computer; otherwise, re-read the ADC sampling fluctuations and the PWM output until the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable; Step S106: According to the set displacement instruction and the maximum displacement S of the robotic arm max , judge whether the set displacement is within the range of [0, S max . If so, update the PID; otherwise, ignore the set displacement instruction and alarm until the set displacement is within the range of [0, S max ; Step S108: Calculate the displacement deviation e(t) based on the resistance value of the SMA wire collected by the ADC sampling and the displacement calibration coefficient k to generate the PID control quantity Dpid; Step S110: Predict the next PWM duty cycle Dout according to the historical duty cycle Dpid; Step S112: Output Dout of each SMA wire in the joints of the robotic arm to the PWM to proportionally increase the heating power of each independent SMA wire for driving each joint in the robotic arm.
[0030] Steps S102 to S104 are the initialization stage, and step S104 is a self-check, providing reference parameters for subsequent control and ensuring hardware stability through self-check. Steps S106 to S112 are the main loop stage. The SMA wire corresponding to each joint of each robotic arm will output Dout respectively. In some embodiments, output Dout of each SMA wire in the joints of the robotic arm to the PWM to proportionally increase the heating power of each independent SMA wire for driving each joint in the robotic arm, including: monitoring current and resistance parameters. If the current exceeds 1.5 times the rated current or the resistance exceeds 110% of the corresponding resistance value of S max , then turn off the PWM output; otherwise, continuously detect the current and resistance parameters. It has a dual protection mechanism, where current monitoring prevents overheating and burning out, and resistance monitoring prevents mechanical over-travel. Ensure instant response through real-time detection, with the highest priority. The current threshold is set based on the rated current-carrying capacity of the SMA wire to avoid overheating damage. The resistance safety value corresponds to the maximum mechanical travel to prevent material failure caused by excessive stretching. After meeting the current and resistance requirements during Dout output, steps S106 to S112 will be looped again to complete the work of the robotic arm. Monitoring the current and resistance parameters is an independent thread and runs in parallel to ensure system safety.
[0031] Each joint of the robotic arm is independently configured with a SMA wire and controlled through an independent PWM channel. The joint angle and the wire displacement have a geometric mapping, such as a crank - connecting rod mechanism, where the angle θ = f(S). The angle command from the host computer is converted into a displacement command through S = f⁻¹(θ), where S is the displacement of the joint of the robotic arm, and then the process control is carried out according to steps S102 - S112.
[0032] Real - time feedback is formed through resistance sampling and displacement calculation. The PID control quantity is dynamically adjusted according to the deviation to ensure accurate tracking of the target displacement. The duty cycle of the next cycle is predicted using the difference in historical control quantities to offset the SMA thermal inertia delay. The anomaly monitoring is independent of the main loop and directly cuts off the output through threshold judgment, which can avoid hardware damage.
[0033] In some embodiments, the initial resistance value R0 of the SMA wire is loaded, the displacement calibration coefficient k is calculated, and the initial values of the PID control parameters, namely the proportional coefficient Kp, the integral coefficient Ki, and the differential coefficient Kd, are loaded. Refer to Figure 2 , including: Step S1021: Measure the initial resistance R0 of the SMA wire when the joint of the robotic arm is fixed at the zero - displacement point; Step S1022: Measure the resistance of the SMA wire at each displacement when driving the joint of the robotic arm to generate a displacement S to the maximum displacement S max to obtain a displacement - resistance data set; Step S1023: Linearly fit the displacement - resistance data set to obtain the relationship between the SMA wire and the joint displacement of the robotic arm ; Step S1024: Obtain the displacement calibration coefficient k according to the relationship between the SMA wire and the joint displacement of the robotic arm; Step S1025: Collect the initial values of the PID control parameters, the proportional coefficient Kp, the integral coefficient Ki, and the differential coefficient Kd, which are 10, 0.1, and 0.5 respectively.
[0034] Steps S1021 - S1024 are the calibration process, which provides a resistance - displacement conversion model for the control algorithm to ensure the accuracy of displacement calculation. Step S1025 provides reference parameters for dynamic PID adjustment. The non - linear influence of SMA is eliminated through calibration, and the resistance change is linearly mapped to the displacement. The initial PID parameters are set based on empirical values to balance the response speed and stability.
[0035] In some embodiments, according to the resistance value of the SMA wire collected by ADC sampling and the displacement calibration coefficient k, the displacement deviation e(t) is calculated to generate the PID control quantity Dpid. Refer to Figure 3 , including: Step S1041: Obtain the current resistance value of the SMA wire according to ADC sampling; Step S1042: Calculate the current displacement of the joints of the robotic arm according to the current resistance value of the SMA wire and the displacement calibration coefficient k; Step S1043: Calculate the displacement deviation e(t) according to the difference between the current displacement of the joints of the robotic arm and the previous displacement of the joints of the robotic arm; wherein, when the current displacement of the joints of the robotic arm is the first displacement, the previous displacement of the joints of the robotic arm is 0; Step S1044: Generate a PID control quantity Dpid according to the displacement deviation e(t), and the formula is: Dpid = Kp·e(t) + Ki·∑e(t) + Kd·(de(t) / dt).
[0036] In some embodiments, generating a PID control quantity Dpid according to the displacement deviation e(t) includes: Dynamically adjust the PID parameters according to the displacement deviation e(t). Among them, if |e(t)| > 10mm, increase Kp to 2 times the initial value, Ki = 0, and Kd remains the initial value; if 10mm ≥ |e(t)| > 2mm, Kp remains the initial value, Ki = 0.1, and Kd remains the initial value; if |e(t)| ≤ 2mm, increase Kd to 1.5 times the initial value, and Kp and Ki remain the initial value; if e(t) remains unchanged continuously, clear the integral accumulation value of ∑e(t).
[0037] Deviation calculation and PID generation convert the displacement error into a control quantity, driving the system to converge to the target displacement. ∑e(t) is the integral term, representing the cumulative historical error, which can be used to eliminate the steady-state deviation. de(t) / dt is the differential term, which can be used to predict the change trend of the error and suppress oscillations. In the small error area (|e(t)| ≤ 2mm), enhance the differential coefficient Kd to 0.75 to suppress high-frequency oscillations and improve the positioning accuracy; in the medium error area, enable the integral term to eliminate the steady-state error; in the large error area, turn off the integral to prevent overshoot and ensure that the displacement control accuracy ≤ 0.04mm. If the error remains unchanged for 5 cycles (10ms), reset the integral term so that ∑e(t) = 0 to avoid out-of-control output when the manipulator is stuck. Switching the control strategy according to the error size can balance the convergence speed and stability.
[0038] In some embodiments, predicting the next PWM duty cycle Dout according to the historical duty cycle Dpid includes: Calculate the next PWM duty cycle Dout according to Dout = Dout0 + y·(Dpid1 - Dpid2 - 1); where Dout0 is the current PWM duty cycle during prediction; y is the prediction gain coefficient, and its value range is (0.2, 0.5); Dpid1 is the current PID control quantity during prediction, and Dpid2 is the previous PID control quantity during prediction. When Dpid1 is the PID control quantity generated for the first time, Dpid2 is equal to 0; when the calculation result of Dout is within the range of [10%, 90%], output the next PWM duty cycle Dout; otherwise, recalculate the next PWM duty cycle Dout until the calculation result of Dout is within the range of [10%, 90%].
[0039] The prediction algorithm uses the historical control quantity difference to predict the future output, which is used to compensate for system delay and make the response time < 50 ms. Design the prediction gain coefficient y to adjust the prediction sensitivity. The larger the y value, the more aggressive the compensation. By restricting the duty cycle range, ensure that the SMA wire works within the safe power range.
[0040] In some embodiments, the evaluation criteria for the stability of the PWM output channel include at least one of the following: the frequency obtained by an oscilloscope and a multimeter is within ±0.1%, the duty cycle is within ±1%, the error between the average voltage and the theoretical value < 2%, and the jitter < 5 ns. Quantify the PWM output quality from four dimensions: frequency, duty cycle, voltage, and timing to achieve multi-dimensional stability evaluation. Among them, the frequency affects the periodic adjustment of the heating power. The duty cycle deviation is directly related to the linearity of the output power. Low jitter can avoid the tremor of the robotic arm caused by the fluctuation of the control signal.
[0041] Another embodiment of the present invention also provides a device for a control method of a robotic arm based on SMA wire control, including: A loading module for loading the initial resistance value R0 of the SMA wire, the displacement calibration coefficient k, and the initial values Kp, Ki, and Kd of the PID control parameters; A reading module for reading the ADC sampling fluctuation and the PWM output. If the ADC sampling fluctuation range does not exceed 1% and the PWM output channel is stable, receive the set displacement instruction sent by the host computer; otherwise, re-read the ADC sampling fluctuation and the PWM output until the ADC sampling fluctuation range does not exceed 1% and the PWM output channel is stable; A judgment module for judging according to the set displacement instruction and the maximum displacement S of the robotic arm max , judge whether the set displacement is within the range of [0, S max . If so, update the PID; otherwise, ignore the set displacement instruction and alarm until the set displacement is within the range of [0, S max ; The first calculation module is used to calculate the displacement deviation e(t) based on the resistance value of the SMA wire collected by ADC sampling and the displacement calibration coefficient k, so as to generate the PID control quantity Dpid. The second calculation module is used to predict the next PWM duty cycle Dout based on the historical duty cycle Dpid. The output module is used to output Dout of each SMA wire in the joints of the robotic arm to the PWM to proportionally increase the heating power of each independent SMA wire, for driving each joint in the robotic arm.
[0042] Another embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the control method of the robotic arm based on SMA wire control.
[0043] The so-called processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), off-the-shelf Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The processor is the control center of the data processing device of the gateway, and uses various interfaces and lines to connect all parts of the data processing device of the entire gateway.
[0044] Another embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the control method of the robotic arm based on SMA wire control.
[0045] The memory may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory is preferably but not limited to a high-speed random access memory. For example, it may also be a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may also optionally include a memory remotely set relative to the processor, and these remote memories may be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and their combinations.
[0046] Those skilled in the art can understand that to implement all or part of the processes in the above method embodiments, a program can be used to instruct relevant hardware. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (abbreviation: HDD), or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memories.
[0047] In summary, a control method, device, electronic device, and storage medium for a robotic arm based on SMA wire control provided by the present invention improve the accuracy of displacement control: through a dynamic PID parameter hierarchical adjustment mechanism, in the large error area (|e(t)|>10mm), the proportional coefficient Kp is increased to 2 times the initial value and the integral term is turned off to quickly reduce the displacement deviation; in the small error area (|e(t)|≤2mm), the differential coefficient Kd is increased to 1.5 times the initial value to effectively suppress oscillations. Combining with the accurate calibration of the displacement-resistance linear model, the improvement of displacement control accuracy is achieved; fast response and delay compensation are realized: based on the PWM prediction algorithm of historical duty cycle data, the duty cycle of the next cycle is predicted through the formula Dout = Dout0 + y·(Dpid1 - Dpid2 - 1), and the SMA thermal inertia delay is compensated by combining the prediction gain coefficient, so that the system response time is shortened; the anti-saturation and stability are improved: by restricting the PWM duty cycle output range to 10% - 90%, the performance degradation caused by overheating or insufficient drive of the SMA wire is avoided; a dynamic integral reset mechanism can be designed to clear the integral accumulation value when the error remains unchanged for 10ms, preventing the out-of-control of the control quantity caused by mechanical jamming; the reliability is improved: the current and resistance parameters are monitored in real time. When the current exceeds 1.5 times the rated value or the resistance exceeds 110% of the corresponding resistance value, the PWM output is immediately cut off to prevent the SMA wire from being overloaded and burned or the mechanical structure from being damaged due to over-travel; modular independent control and energy consumption optimization are realized: a single-joint single-wire independent drive architecture can convert the upper computer angle command into a displacement command by combining the joint displacement of the robotic arm with the geometric mapping relationship θ = ƒ(S) to realize multi-joint coordinated motion control; the overall energy consumption is reduced by restricting the output of invalid duty cycles through anti-saturation processing; parameter self-adaptability: based on when the joint of the robotic arm is fixed at the zero displacement point and when the joint of the robotic arm is driven to generate a displacement S to the maximum displacement S max max Measure the resistance of the SMA wire afterwards, achieve linear fitting for multi-displacement point calibration, dynamically correct the resistance-displacement model, adapt to the parameter drift of the SMA wire during long-term use, and ensure the stability of control accuracy; improve the signal output stability: detect the frequency error (±0.1%), duty cycle deviation (±1%) and voltage jitter (<5 ns) of the PWM output channel through an oscilloscope and a multimeter to ensure the high stability of the drive signal and avoid the tremor of the robotic arm caused by control jitter.
[0048] Although the present invention has been disclosed above with the preferred embodiments, it is not intended to limit the present invention. Those with ordinary knowledge in the technical field to which the present invention pertains can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to that defined by the claims.
Claims
1. A control method for a robotic arm based on SMA wire control, the robotic arm comprising several joints of the robotic arm individually driven by SMA wires, characterized in that, Including: When the joints of the loading robotic arm are fixed at the zero displacement point, measure the initial resistance R0 of the SMA wire and displace the joints of the robotic arm by S to the maximum displacement S max Then measure the resistance of the SMA wire at each displacement to obtain a displacement-resistance data set, and linearly fit the displacement-resistance data set to obtain the relationship between the displacement of the SMA wire and the joints of the robotic arm , where R is the resistance of the SMA wire measured when the joint displacement of the robotic arm is S. Calculate the displacement calibration coefficient k by substituting the joint displacement S, resistance R, and initial resistance R0; Load the initial values Kp, Ki, Kd of the PID control parameters, where the proportional coefficient Kp is 10, the integral coefficient Ki is 0.1, and the differential coefficient Kd is 0.5; Read the fluctuations of the resistance value of the SMA wire collected by the ADC sampling and the PWM output. If the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable, then receive the set displacement instruction sent by the host computer; otherwise, re-read the ADC sampling fluctuations and the PWM output until the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable; According to the set displacement instruction and the maximum displacement S of the robotic arm max , it is judged whether the set displacement is within the range of [0, S max . If so, update the PID; otherwise, ignore the set displacement instruction and alarm until the set displacement is within the range of [0, S max ; Calculate the displacement deviation e(t) according to the resistance value of the SMA wire collected by the ADC sampling and the displacement calibration coefficient k, so as to generate the PID control quantity Dpid; Predict the next PWM duty cycle Dout according to the historical duty cycle Dpid; Output Dout of each SMA wire in the joints of the robotic arm to the PWM to proportionally increase the heating power of each independent SMA wire for driving each joint in the robotic arm.
2. The control method of a robotic arm based on SMA wire control according to claim 1, wherein The calculating the displacement deviation e(t) according to the resistance value of the SMA wire collected by the ADC sampling and the displacement calibration coefficient k to generate the PID control quantity Dpid includes: Obtain the current resistance value of the SMA wire according to the ADC sampling; Calculate the current displacement of the joint of the robotic arm according to the current resistance value of the SMA wire and the displacement calibration coefficient k; Calculate the displacement deviation e(t) according to the difference between the current displacement of the joint of the robotic arm and the previous displacement of the joint of the robotic arm; wherein, when the current displacement of the joint of the robotic arm is the first displacement, the previous displacement of the joint of the robotic arm is 0; Generate the PID control quantity Dpid according to the displacement deviation e(t), and the formula is: Dpid = Kp·e(t)+Ki·∑e(t)+Kd·(de(t) / dt).
3. The control method of a robotic arm based on SMA wire control according to claim 1, characterized in that, The generating the PID control quantity Dpid according to the displacement deviation e(t) includes: Dynamically adjust the PID parameters according to the displacement deviation e(t), wherein, If |e(t)|>10mm, then increase Kp to 2 times the initial value, Ki = 0, and Kd remains the initial value; If 10mm≥|e(t)|>2mm, then Kp remains the initial value, Ki = 0.1, and Kd remains the initial value; If |e(t)|≤2mm, then increase Kd to 1.5 times the initial value, and Kp and Ki remain the initial values; If e(t) remains unchanged continuously, then clear the integral accumulation value of ∑e(t).
4. The control method of a robotic arm based on SMA wire control according to claim 1, characterized in that, The predicting the next PWM duty cycle Dout according to the historical duty cycle Dpid includes: Calculate the next PWM duty cycle Dout according to Dout = Dout0 + y·(Dpid1 - Dpid2 - 1); where Dout0 is the current PWM duty cycle during prediction; y is the prediction gain coefficient, and the value range is (0.2, 0.5); Dpid1 is the current PID control quantity during prediction, Dpid2 is the previous PID control quantity during prediction, and when Dpid1 is the first generated PID control quantity, Dpid2 is equal to 0; When the calculation result of Dout is within the range of [10%, 90%], output the next PWM duty cycle Dout; otherwise, recalculate the next PWM duty cycle Dout until the calculation result of Dout is within the range of [10%, 90%].
5. The control method of a robotic arm based on SMA wire control according to claim 1, characterized in that, The Dout of each SMA wire in the joints of the robotic arm is output to the PWM, and the heating power of each independent SMA wire is increased proportionally for driving each joint in the robotic arm, including: monitoring the current and resistance parameters. If the current exceeds 1.5 times the rated current or the resistance exceeds 110% of the corresponding resistance value, the PWM output is turned off; otherwise, the current and resistance parameters are continuously detected. max If the current exceeds 1.5 times the rated current or the resistance exceeds 110% of the corresponding resistance value, the PWM output is turned off; otherwise, the current and resistance parameters are continuously detected.
6. The control method of a robotic arm based on SMA wire control according to claim 1, characterized in that The evaluation criteria for the stability of the PWM output channel include at least one of the following obtained through an oscilloscope and a multimeter: the frequency is within ±0.1%, the duty cycle is within ±1%, the error between the average voltage and the theoretical value < 2%, and the jitter < 5 ns.
7. An apparatus for a control method of a robotic arm based on SMA wire control, characterized in that, It includes: Loading module, which is used to load the mechanical arm. When the joints of the mechanical arm are fixed at the zero displacement point, the initial resistance R0 of the SMA wire is measured. When the joints of the mechanical arm generate a displacement S to the maximum displacement S, max the resistance of the SMA wire at each generated displacement is measured to obtain a displacement-resistance data set, and the displacement-resistance data set is linearly fitted to obtain the relationship between the SMA wire and the joint displacement of the mechanical arm. where R is the resistance of the SMA wire measured when the joint displacement of the mechanical arm is S. By substituting the joint displacement S, the resistance R, and the initial resistance R0, the displacement calibration coefficient k is calculated; the initial values Kp, Ki, and Kd of the PID control parameters are loaded, where the proportional coefficient Kp is 10, the integral coefficient Ki is 0.1, and the differential coefficient Kd is 0.5; A reading module, which is used to read the fluctuation of the resistance value of the SMA wire collected by the ADC sampling and the PWM output. If the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable, receive the set displacement instruction sent by the host computer; otherwise, reread the ADC sampling fluctuation and the PWM output until the fluctuation range of the resistance value of the SMA wire collected by the ADC sampling does not exceed 1% and the PWM output channel is stable. A judgment module, configured to judge whether the set displacement is within the range of [0, S] according to the set displacement instruction and the maximum displacement S of the robotic arm. If so, update the PID; otherwise, ignore the set displacement instruction and give an alarm until the set displacement is within the range of [0, S]. max , and judge whether the set displacement is within the range of [0, S max . If so, update the PID; otherwise, ignore the set displacement instruction and give an alarm until the set displacement is within the range of [0, S max ; A first calculation module, which is used to calculate the displacement deviation e(t) according to the resistance value of the SMA wire collected by the ADC sampling and the displacement calibration coefficient k to generate a PID control quantity Dpid. A second calculation module, which is used to predict the next PWM duty cycle Dout according to the historical duty cycle Dpid. An output module, which is used to output Dout of each SMA wire in the joints of the robotic arm to the PWM to proportionally increase the heating power of each independent SMA wire for driving each joint in the robotic arm.
8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the control method of the robotic arm based on SMA wire control according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the control method of the robotic arm based on SMA wire control according to any one of claims 1 to 6.
Citation Information
Patent Citations
Shape memory alloy-driven swing type displacement conversion and amplification mechanism and method thereof
CN106014896A
Shape memory alloy motor structure for image stabilization and control method
CN118100579A
Shape memory alloy device and control method
US20030053912A1
Position control method for shape memory alloy actuator
US20090007561A1
Control of a shape memory alloy actuation arrangement
US20110277462A1
Cited By
Method and device for controlling air valve of SMA sphygmomanometer to release air at fixed air release speed, electronic equipment and storage medium
CN121059129A
A method, device, electronic device, and storage medium for controlling a gas valve of an SMA sphygmomanometer to deflate at a fixed deflation rate
CN121059129B