Disclosure of Invention
The invention aims to overcome the defect that a rehabilitation robot in the prior art is easy to cause secondary injury to a patient by adopting a direct torque control method, and provides a control method, a control system, electronic equipment and a storage medium of the rehabilitation robot.
The invention solves the technical problems through the following technical scheme:
a control method of a rehabilitation robot, comprising:
setting the tail end of the rehabilitation robot to reduce the gravity;
acquiring a first contact force between the tail end of the rehabilitation robot and an external environment;
acquiring real-time motion data of the tail end, wherein the real-time motion data comprises real-time height, real-time speed and real-time acceleration;
determining a second contact force between the tip and the external environment from an impedance model and the real-time motion data;
determining a weight reduction correction value according to the tail end gravity reduction force, the first contact force and the second contact force;
respectively determining the given speed and the given acceleration of the tail end according to the gravity reducing correction value and a PID (proportion (P), integral (I) and differential) algorithm;
controlling the movement of the tip according to the given velocity and the given acceleration.
Preferably, the control method further includes:
and constructing the impedance model, wherein the parameters of the impedance model comprise a preset virtual spring and a preset virtual damper.
Preferably, the control method further includes:
setting a reference trajectory of the tip movement, wherein the reference trajectory comprises a desired height, a desired velocity, and a desired acceleration;
the step of determining a second contact force between the tip and the external environment from an impedance model and the real-time motion data comprises:
determining a second contact force between the tip and the external environment from the impedance model, the reference trajectory, and the real-time motion data.
Preferably, the step of determining the given velocity and the given acceleration of the tip end according to the weight loss correction value and the PID algorithm respectively comprises:
calculating the given speed according to:
calculating the given acceleration according to:
wherein Δ F represents a weight loss correction value, Kp1Representing the speed proportionality coefficient, Kd1Representing the velocity differential coefficient, Kp2Expressing the proportional coefficient of acceleration, Kd2Represents an acceleration differential coefficient;
and/or the presence of a gas in the gas,
the step of controlling the motion of the tip according to the given velocity and the given acceleration includes:
determining a speed drive command of a motor driver of the tip according to the given speed;
determining an acceleration driving instruction of the motor driver according to the given acceleration;
and driving the motor driver according to the speed driving command and the acceleration driving command.
A control system of a rehabilitation robot, comprising:
the first setting module is used for setting the terminal gravity reducing force of the rehabilitation robot;
a first obtaining module for obtaining a first contact force between the distal end of the rehabilitation robot and an external environment;
the second acquisition module is used for acquiring real-time motion data of the tail end, wherein the real-time motion data comprises real-time height, real-time speed and real-time acceleration;
a first determination module for determining a second contact force between the tip and the external environment from an impedance model and the real-time motion data;
the second determining module is used for determining a weight reduction correction value according to the tail end weight reduction force, the first contact force and the second contact force;
the third determining module is used for respectively determining the given speed and the given acceleration of the tail end according to the weight loss correction value and a PID algorithm;
and the control module is used for controlling the movement of the tail end according to the given speed and the given acceleration.
Preferably, the control system further comprises:
the impedance model is constructed by a construction module, wherein the parameters of the impedance model comprise a preset virtual spring and a preset virtual damper.
Preferably, the control system further comprises:
a second setting module for setting a reference trajectory of the tip movement, wherein the reference trajectory comprises a desired height, a desired velocity, and a desired acceleration;
the first determining module is specifically configured to determine a second contact force between the tip and the external environment from the impedance model, the reference trajectory, and the real-time motion data.
Preferably, the third determining module comprises:
a first calculation unit configured to calculate the given speed according to:
a second calculation unit configured to calculate the given acceleration according to:
wherein Δ F represents a weight loss correction value, Kp1Representing the speed proportionality coefficient, Kd1Representing the velocity differential coefficient, Kp2Expressing the proportional coefficient of acceleration, Kd2Indicating accelerationA differential coefficient;
and/or the presence of a gas in the gas,
the control module includes:
a first determination unit configured to determine a speed drive instruction of the motor driver of the tip end according to the given speed;
a second determination unit configured to determine an acceleration driving instruction of the motor driver according to the given acceleration;
and the driving unit is used for driving the motor driver according to the speed driving instruction and the acceleration driving instruction.
An electronic device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the control method of any one rehabilitation robot.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, realizes the steps of any of the above-mentioned control methods of a rehabilitation robot.
The positive progress effects of the invention are as follows: the invention adopts an indirect moment mode to control the tail end force of the rehabilitation robot, and particularly, the control of the tail end force of the rehabilitation robot is indirectly realized by controlling the given speed and the given acceleration of the tail end of the rehabilitation robot so as to realize the interactive control between the rehabilitation robot and the external environment, for example, the safe and controllable assistance to a patient can be realized in the rehabilitation motion process of the patient so as to be beneficial to the rehabilitation of the patient.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
The present embodiment provides a control method of a rehabilitation robot, and fig. 1 shows a flowchart of the control method of the present embodiment. Referring to fig. 1, the control method of the present embodiment includes:
s1, setting the tail end of the rehabilitation robot to reduce the gravity;
s2, acquiring a first contact force between the tail end of the rehabilitation robot and the external environment;
s3, acquiring real-time motion data of the tail end;
s4, determining a second contact force between the tail end and the external environment according to the impedance model and the real-time motion data;
s5, determining a gravity-reducing correction value according to the tail end gravity-reducing force, the first contact force and the second contact force;
s6, respectively determining the given speed and the given acceleration of the tail end according to the weight loss correction value and the PID algorithm;
and S7, controlling the movement of the tail end according to the given speed and the given acceleration.
In this embodiment, the rehabilitation robot preferably includes a lower limb rehabilitation robot, and the external environment preferably includes a patient performing rehabilitation training by using the lower limb rehabilitation robot, for example, when the lower limb rehabilitation robot is used for hip weight reduction rehabilitation training of the patient, the tail end of the rehabilitation robot contacts with the hip of the patient to provide assistance for the hip of the patient and achieve hip weight reduction.
In step S1 of this embodiment, the terminal gravity reducing force may be specifically set according to the self condition of the patient, for example, the terminal gravity reducing force may be set according to the weight of the patient and the rehabilitation stage. In step S2 of this embodiment, the first contact force between the distal end of the rehabilitation robot and the external environment during the rehabilitation training process, that is, the interaction force between the distal end of the rehabilitation robot and the hip of the patient, may be measured in real time by the torque sensor. In step S3, in this embodiment, real-time motion data of the distal end of the rehabilitation robot during the rehabilitation training process, that is, real-time motion data of the hip of the patient contacted by the distal end of the rehabilitation robot, may be measured in real time by a motor-side encoder at the distal end of the rehabilitation robot, and the real-time motion data specifically includes real-time height, real-time speed, and real-time acceleration.
The present embodiment further includes a step of constructing an impedance model before step S1. Specifically, in this embodiment, the parameters of the impedance model preferably include the mass, the preset virtual spring and the preset virtual damping. The introduction of the preset virtual spring and the preset virtual damping is beneficial to improving the response speed and the stability of the control method of the embodiment, and the preset virtual spring and the preset virtual damping can be obtained by an experience or simulation method.
In this embodiment, referring to fig. 2, the parameters of the impedance model are respectively denoted as mass M, preset virtual spring K and preset virtual damping B, and the first contact force during the rehabilitation training process is denoted as F
iRecording the real-time motion data in the rehabilitation training process as the real-time height x and the real-time speed respectively
And real-time acceleration
The end gravity-reducing force of the rehabilitation robot is recorded as F
refRespectively recording the reference motion data of the tail end of the rehabilitation robot as reference height x
refReference speed
And a reference acceleration
The weight loss correction value Δ F is:
wherein, Δ x ═ x
refX, characterizing the tracking height error of the patient's hip joint during rehabilitation training,
characterizing the tracking speed error of the patient's hip joint during rehabilitation training,
and (3) representing the tracking acceleration error of the hip joint of the patient in the rehabilitation training process.
Further, in the present embodiment, the rehabilitation robot may have two working modes, a following mode and an active mode. Specifically, when the following mode is selected, the rehabilitation robot is only used for the weight loss of the hip of the patient, and the reference motion data in the embodiment is a constant; when the active mode is selected, the rehabilitation robot is used for driving the hip of the patient to move according to a reference track while realizing the weight reduction of the hip of the patient, correspondingly, the control method of the embodiment further comprises the step of setting the reference track of the movement of the tail end of the rehabilitation robot, wherein the reference track comprises a desired height, a desired speed and a desired acceleration, and the reference movement data in the embodiment can be determined according to the desired height, the desired speed and the desired acceleration included in the reference track.
In this embodiment, the weight loss correction Δ F is used as an open-loop input to the PID algorithm to determine the given speed of the tip end, respectively
With a given acceleration
Further, in the present embodiment, when performing PID control, the integral step may be omitted, and specifically, the given speed may be calculated according to the following formula
With a given acceleration
Wherein, Kp1Representing the speed proportionality coefficient, Kd1Representing the velocity differential coefficient, Kp2Expressing the proportional coefficient of acceleration, Kd2Representing the acceleration differential coefficient.
In the embodiment, the introduced preset virtual spring K and the introduced preset virtual damper B can be directly used for PID control parameter self-tuning in the simulation process, and an accurate dynamic model does not need to be established according to the parameters of the rehabilitation robot, so that the design time of a PID algorithm can be greatly shortened, in addition, the influence of environmental factors such as static friction and the like does not need to be considered, the adaptability of the PID algorithm is improved, and the software and hardware cost is saved.
In this embodiment, step S7 may specifically include the following steps:
determining a speed driving command of a motor driver at the tail end according to the given speed;
determining an acceleration driving instruction of a motor driver according to the given acceleration;
and driving the motor driver according to the speed driving command and the acceleration driving command.
Therefore, the control of the end force of the rehabilitation robot is indirectly realized by controlling the given speed and the given acceleration of the end of the rehabilitation robot, and the control of the end force of the rehabilitation robot is realized by adopting an indirect moment mode.
In this embodiment, in the rehabilitation training process of the patient, the steps S2-S7 are repeatedly performed to achieve the assistance and weight reduction on the hip of the patient, so as to assist the patient in performing rehabilitation training. Fig. 3 and 4 show bode diagrams of two kinds of rehabilitation robots, wherein, fig. 3 corresponds to the rehabilitation robot employing the control method of the present embodiment, the rehabilitation robot corresponding to fig. 4 is the same as the embodiment except that the impedance model in the embodiment is not adopted, and it can be known from fig. 3 and 4 that only PID control is performed without impedance control, so that when the P (proportion) link of PID control is selected to be large, the rehabilitation robot has unstable input frequency band, the impedance control of the embodiment is introduced on the basis of PID control, so that the amplitude margin value and the phase angle margin of the rehabilitation robot can be increased, an unstable input frequency band does not exist, and then can select great P link to accelerate response speed, improve the performance of rehabilitation robot, for example, when selecting the mode of following, can improve the following performance of rehabilitation robot.
The control method of the rehabilitation robot provided by the embodiment controls the terminal force of the rehabilitation robot in an indirect torque mode, and specifically, indirectly controls the terminal force of the rehabilitation robot by controlling a given speed and a given acceleration of the terminal of the rehabilitation robot so as to realize interactive control between the rehabilitation robot and an external environment, for example, safe and controllable assistance to a patient can be realized in the rehabilitation motion process of the patient so as to be beneficial to the rehabilitation of the patient.
Example 2
The present embodiment provides a control system of a rehabilitation robot, and fig. 5 shows a block schematic diagram of the control system of the present embodiment. Referring to fig. 5, the control system of the present embodiment includes:
thefirst setting module 11 is used for setting the terminal gravity reducing force of the rehabilitation robot;
a first obtainingmodule 12 for obtaining a first contact force between the distal end of the rehabilitation robot and the external environment;
the second obtainingmodule 13 is configured to obtain real-time motion data of the terminal;
afirst determination module 14 for determining a second contact force between the tip and the external environment from the impedance model and the real-time motion data;
a second determiningmodule 15, configured to determine a gravity-reducing correction value according to the terminal gravity-reducing force, the first contact force, and the second contact force;
the third determiningmodule 16 is used for respectively determining the given speed and the given acceleration of the tail end according to the weight loss correction value and a PID algorithm;
and acontrol module 17 for controlling the movement of the tip according to the given speed and the given acceleration.
In this embodiment, the rehabilitation robot preferably includes a lower limb rehabilitation robot, and the external environment preferably includes a patient performing rehabilitation training by using the lower limb rehabilitation robot, for example, when the lower limb rehabilitation robot is used for hip weight reduction rehabilitation training of the patient, the tail end of the rehabilitation robot contacts with the hip of the patient to provide assistance for the hip of the patient and achieve hip weight reduction.
Thefirst setting module 11 in this embodiment may specifically set the distal end gravity reducing force according to the self condition of the patient, for example, the distal end gravity reducing force may be set according to the weight of the patient and the rehabilitation stage. In this embodiment, the first obtainingmodule 12 may specifically measure, in real time, a first contact force between the distal end of the rehabilitation robot and the external environment during the rehabilitation training process, that is, an interaction force between the distal end of the rehabilitation robot and the hip of the patient through the torque sensor. In this embodiment, the second obtainingmodule 13 may specifically measure, in real time, real-time motion data of the tail end of the rehabilitation robot during the rehabilitation training process through a motor-side encoder at the tail end of the rehabilitation robot, that is, real-time motion data of the hip of the patient contacted by the tail end of the rehabilitation robot, where the real-time motion data specifically includes real-time height, real-time speed, and real-time acceleration.
Referring to fig. 5, the present embodiment further includes aconstruction module 18 for constructing an impedance model. Specifically, in this embodiment, the parameters of the impedance model preferably include the mass, the preset virtual spring and the preset virtual damping. The introduction of the preset virtual spring and the preset virtual damping is beneficial to improving the response speed and the stability of the control method of the embodiment, and the preset virtual spring and the preset virtual damping can be obtained by an experience or simulation method.
In this embodiment, referring to fig. 2, the parameters of the impedance model are respectively denoted as mass M, preset virtual spring K and preset virtual damping B, and the first contact force during the rehabilitation training process is denoted as F
iRecording the real-time motion data in the rehabilitation training process as the real-time height x and the real-time speed respectively
And real-time acceleration
The end gravity-reducing force of the rehabilitation robot is recorded as F
refRespectively recording the reference motion data of the tail end of the rehabilitation robot as reference height x
refReference speed
And a reference acceleration
The weight loss correction value Δ F is:
wherein, Δ x ═ x
refX, characterizing the tracking height error of the patient's hip joint during rehabilitation training,
characterizing the tracking speed error of the patient's hip joint during rehabilitation training,
and (3) representing the tracking acceleration error of the hip joint of the patient in the rehabilitation training process.
Further, in the present embodiment, the rehabilitation robot may have two working modes, a following mode and an active mode. Specifically, when the following mode is selected, the rehabilitation robot is only used for the weight loss of the hip of the patient, and the reference motion data in the embodiment is a constant; when the active mode is selected, the rehabilitation robot is used for driving the hip of the patient to move according to the reference track while realizing the weight reduction of the hip of the patient, and correspondingly, the control system of the embodiment further comprises asecond setting module 19 for setting the reference track of the movement of the distal end of the rehabilitation robot, wherein the reference track comprises the desired height, the desired speed and the desired acceleration, and the reference movement data in the embodiment can be determined according to the desired height, the desired speed and the desired acceleration included in the reference track.
In this embodiment, the weight loss correction Δ F is used as an open-loop input to the PID algorithm to determine the given speed of the tip end, respectively
With a given acceleration
Further, the third determining
module 16 in this embodiment may include the first calculating
unit 161 and the second calculating
unit 162, and the integration element may be omitted when performing PID control in this embodiment. Specifically, the method comprises the following steps:
the
first calculation unit 161 may calculate the given speed according to the following equation
The
second calculation unit 162 may calculate the given acceleration according to the following equation
Wherein, Kp1Representing the speed proportionality coefficient, Kd1Representing the velocity differential coefficient, Kp2Expressing the proportional coefficient of acceleration, Kd2Representing the acceleration differential coefficient.
In the embodiment, the introduced preset virtual spring K and the introduced preset virtual damper B can be directly used for PID control parameter self-tuning in the simulation process, and an accurate dynamic model does not need to be established according to the parameters of the rehabilitation robot, so that the design time of a PID algorithm can be greatly shortened, in addition, the influence of environmental factors such as static friction and the like does not need to be considered, the adaptability of the PID algorithm is improved, and the software and hardware cost is saved.
In this embodiment, thecontrol module 17 may specifically include:
afirst determination unit 171 for determining a speed driving command of the motor driver of the tip end according to a given speed;
asecond determination unit 172 for determining an acceleration driving instruction of the motor driver according to a given acceleration;
the drivingunit 173 is configured to drive the motor driver according to the speed driving command and the acceleration driving command.
Therefore, the control of the end force of the rehabilitation robot is indirectly realized by controlling the given speed and the given acceleration of the end of the rehabilitation robot, and the control of the end force of the rehabilitation robot is realized by adopting an indirect moment mode.
In this embodiment, in the rehabilitation training process of the patient, the first obtainingmodule 12 is repeatedly invoked to thecontrol module 17 to achieve the assistance and weight reduction on the hip of the patient, so as to assist the patient in performing rehabilitation training. Fig. 3 and 4 show bode diagrams of two kinds of rehabilitation robots, wherein, fig. 3 corresponds to a rehabilitation robot employing the control system of the present embodiment, the rehabilitation robot corresponding to fig. 4 is the same as the embodiment except that the impedance model in the embodiment is not adopted, and it can be known from fig. 3 and 4 that only PID control is performed without impedance control, so that when the P (proportion) link of PID control is selected to be large, the rehabilitation robot has unstable input frequency band, the impedance control of the embodiment is introduced on the basis of PID control, so that the amplitude margin value and the phase angle margin of the rehabilitation robot can be increased, an unstable input frequency band does not exist, and then can select great P link to accelerate response speed, improve the performance of rehabilitation robot, for example, when selecting the mode of following, can improve the following performance of rehabilitation robot.
The control system of the rehabilitation robot provided by the embodiment controls the terminal force of the rehabilitation robot in an indirect torque mode, and particularly indirectly controls the terminal force of the rehabilitation robot by controlling the given speed and the given acceleration of the terminal of the rehabilitation robot so as to realize interactive control between the rehabilitation robot and an external environment, for example, safe and controllable assistance to a patient can be realized in the rehabilitation motion process of the patient, so that the rehabilitation of the patient is facilitated.
Example 3
The present embodiment provides an electronic device, which may be represented in the form of a computing device (for example, may be a server device), and includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the control method of the rehabilitation robot provided in embodiment 1.
Fig. 6 shows a schematic diagram of a hardware structure of the present embodiment, and as shown in fig. 6, theelectronic device 9 specifically includes:
at least oneprocessor 91, at least onememory 92, and abus 93 for connecting the various system components (including theprocessor 91 and the memory 92), wherein:
thebus 93 includes a data bus, an address bus, and a control bus.
Memory 92 includes volatile memory, such as Random Access Memory (RAM)921 and/orcache memory 922, and can further include Read Only Memory (ROM) 923.
Memory 92 also includes a program/utility 925 having a set (at least one) ofprogram modules 924,such program modules 924 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Theprocessor 91 executes various functional applications and data processing, such as a control method of a rehabilitation robot provided in embodiment 1 of the present invention, by running a computer program stored in thememory 92.
Theelectronic device 9 may further communicate with one or more external devices 94 (e.g., a keyboard, a pointing device, etc.). Such communication may be through an input/output (I/O)interface 95. Also, theelectronic device 9 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via thenetwork adapter 96. Thenetwork adapter 96 communicates with the other modules of theelectronic device 9 via thebus 93. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with theelectronic device 9, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, according to embodiments of the application. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 4
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements the steps of the control method of the rehabilitation robot provided in embodiment 1.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible embodiment, the present invention may also be implemented in the form of a program product including program code for causing a terminal device to perform the steps of implementing the control method of the rehabilitation robot described in embodiment 1 when the program product is run on the terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may be executed entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.