Disclosure of Invention
The embodiment of the invention provides a control method, a control system, a control terminal and a control medium of a robot, and aims to solve the problems that joints of a foot type robot are large in size and low in control efficiency.
In order to realize the technical problem, the invention adopts the following technical scheme:
in a first aspect, embodiments of the present invention provide a method for controlling a robot, the robot comprising a plurality of structural links and at least two functional organs, each of said functional organs comprising at least one joint; the adjacent structure connecting rods are connected through joints, and each joint is correspondingly provided with a motor;
the method comprises the following steps:
receiving a control parameter instruction; the control parameter instruction is triggered when the robot is controlled to act; the control parameter commands comprise torque commands, speed commands and angle position commands of all the motors;
acquiring actual control parameters of each motor;
and generating the driving voltage value of each motor according to the control parameter instruction and the actual control parameter.
Optionally, obtaining an actual control parameter of each motor includes:
acquiring a three-phase current value of each motor;
and acquiring the rotor position angle value of each motor.
Optionally, obtaining a three-phase current value of each motor includes:
collecting the three-phase current of each motor at the opening moment of the pulse width modulation waveform according to the time of the timed interruption and through a preset time window;
a preset number of current analog quantities are input.
Optionally, obtaining the rotor position angle value of each motor includes:
and reading the actual rotor position of each motor through a chip selection signal by adopting a communication mode of angle detection to obtain the rotor position angle value of each motor.
Optionally, generating the driving voltage value of each motor according to the control parameter instruction and the actual control parameter includes:
converting the torque instruction, the speed instruction and the angle position instruction into current instruction values corresponding to current values of a d axis and a q axis of each motor based on the proportion of the calibration table;
and performing proportional integral calculation according to the current instruction value and the actual control parameter, and outputting the driving voltage value of the square wave to each motor so as to control each motor respectively.
Optionally, performing proportional-integral calculation according to the current instruction value and the actual control parameter, and outputting the driving voltage value of the square wave to each motor, including:
performing clarke transformation and park transformation on current parameters in the actual control parameters of each motor to obtain current actual values of a direct axis d axis and a quadrature axis q axis;
according to the current instruction value and the current actual value, by combining with an anti-integral saturation algorithm and judging speed and torque output, performing targeted calculation in an approximate saturation region to generate voltage values of a d axis and a q axis;
performing inverse park transformation on the voltage values of the d axis and the q axis to obtain the voltage values of an alpha axis and a beta axis under a static coordinate system;
and performing a pulse width modulation algorithm of a space vector according to the voltage values of the alpha axis and the beta axis in the static coordinate system, thereby outputting the voltage value of a square wave to control each motor respectively.
Optionally, performing proportional-integral calculation according to the current command value and the actual control parameter, including:
and adopting at least one motor control algorithm of a vector control algorithm, a position estimation-free position algorithm and a direct torque control algorithm of the permanent magnet synchronous motor.
In a second aspect, an embodiment of the present invention provides a control system for a robot, where the control system for a robot is configured to execute the control method for a robot according to any one of the first aspect;
a control system for a robot, comprising:
the instruction receiving module is used for receiving a control parameter instruction; the control parameter instruction is triggered when the robot is controlled to act; the control parameter commands comprise torque commands, speed commands and angle position commands of all the motors;
the parameter acquisition module is used for acquiring actual control parameters of each motor;
and the calculation module is used for generating the driving voltage value of each motor according to the control parameter instruction and the actual control parameter.
In a third aspect, an embodiment of the present invention provides a terminal, including: a control system of a robot of a second aspect, the control system of a robot being adapted to perform the control method of any of the robots of the first aspect.
In a fourth aspect, embodiments of the present invention provide a readable storage medium, where instructions are executed by a processor of a control system of a robot, so that the control system of the robot can execute the control method of the robot according to any of the first aspect.
The control method of the robot provided by the embodiment of the invention comprises the steps of receiving a control parameter instruction, wherein the control parameter instruction is triggered when the robot is controlled to act; the actual control parameters of each motor are obtained, the driving voltage values of the motors are generated according to the control parameter instructions and the actual control parameters, a single motor control board controls a plurality of motors simultaneously, the space of joints occupied by the motor control board is saved, the control efficiency of the robot is improved, and the size of the joints without the motor control board is reduced.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Based on the above technical problem, the present embodiment proposes the following solutions:
fig. 1 is a schematic structural diagram of a robot according to an embodiment of the present invention. Referring to fig. 1, a robot according to an embodiment of the present invention includes a plurality of structural links and at least two functional organs, such as a hip, a knee, and an ankle, each of which includes at least one joint, such as a hip joint, a knee joint, and an ankle joint; the adjacent structure connecting rods are connected through joints, and each joint is correspondingly provided with a motor. The control system of the robot may be a motor control board 10, the motor control board 10 may be disposed on one joint, for example, a hip joint, and the motor control board 10 may control the motion of a plurality of motors 30. The robot may further include a main control board 20, the main control board 20 being communicatively connected to the motor control board 10. Fig. 1 exemplarily shows a case where a single leg of the robot includes 3 motors 30, each motor 30 corresponds to one joint, for example, a hip joint, a knee joint, and an ankle joint, and three joints of the same leg are controlled by a single motor control board 10. A single leg may be provided that includes more joints, such as a hip joint, a knee joint, an ankle joint, and multiple joints of the foot, as desired. The plurality of joints of the same leg may be controlled by one motor control board according to the requirement, and is not limited in any way.
Fig. 2 is a flowchart of a control method of a robot according to an embodiment of the present invention. Referring to fig. 2, a method for controlling a robot according to an embodiment of the present invention includes:
s101, receiving a control parameter instruction; the control parameter instruction is triggered when the robot is controlled to act; the control parameter commands include torque commands, speed commands, and angular position commands for each of the motors.
Specifically, the control parameter command is triggered when the robot is controlled to act. The control parameter command may be a control command sent by the main control board. The control parameter commands include torque commands, speed commands and angular position commands for each motor controlled by the motor control board.
And S102, acquiring actual control parameters of each motor.
Specifically, the actual control parameters of each motor controlled by the motor control board may include actual torque, speed, and rotor position angle values of each motor. For example, taking the case that a single leg includes three motors, the motor control board obtains actual control parameters of the three motors.
And S103, generating a driving voltage value of each motor according to the control parameter command and the actual control parameter.
Specifically, the motor control panel generates driving voltage values of the three motors according to received control parameter instructions and acquired actual control parameters of the three motors, the driving voltage values are respectively used for driving the corresponding motors to drive joint movement, target movement of the robot is achieved, a single motor control panel controls the motors simultaneously, space of joints occupied by the motor control panel is saved, control efficiency of the robot is improved, and the size of the joints without the motor control panel is reduced.
The control method of the robot provided by the embodiment comprises the steps of receiving a control parameter instruction, wherein the control parameter instruction is triggered when the robot is controlled to act; the actual control parameters of each motor are obtained, the driving voltage values of the motors are generated according to the control parameter instructions and the actual control parameters, a single motor control board controls a plurality of motors simultaneously, the space of joints occupied by the motor control board is saved, the control efficiency of the robot is improved, and the size of the joints without the motor control board is reduced.
Optionally, fig. 3 is a flowchart of another robot control method according to an embodiment of the present invention.
Referring to fig. 3, a method for controlling a robot according to an embodiment of the present invention includes:
and S101, receiving a control parameter instruction.
S201, acquiring a three-phase current value of each motor.
Specifically, the three-phase current value of each motor is collected, and the three-phase current value needs to be collected in sequence in a preset time window. Optionally, acquiring the three-phase current value of each motor may include acquiring the three-phase current of each motor at the turn-on time of the pulse width modulation waveform according to the time of the timed interrupt and through a preset time window; a preset number of current analog quantities are input.
For example, the motor control board controls three motors. Reading the three-phase current of each of the three motors, and inputting the three-phase current into a motor control board through a preset number, such as 6 current analog quantities, to obtain a required current value; according to the time of the timed interruption, the pulse width modulation waveform is required to be acquired at the switching-on moment, the current fluctuation is small, the pulse width modulation waveform is acquired at a stable moment, three motors are required to be acquired, a time window is required to be accurately mastered, and the numerical value is stable.
And S202, acquiring a rotor position angle value of each motor.
Optionally, the obtaining of the rotor position angle value of each motor includes reading the actual rotor position of each motor through a chip selection signal by using a communication mode of angle detection, so as to obtain the rotor position angle value of each motor.
Exemplarily, the rotor position of each of the three motors is read, and then the rotor position is read into a motor control board through a communication mode of angle detection to obtain actual rotor position angle values of the three motors; the motor control panel is mainly provided with an external device, the rotor positions of the three motors are respectively read through chip selection signals, and the requirement on the time sequence of rotor position acquisition is high.
And S203, generating a driving voltage value of each motor according to the control parameter command, the three-phase current value of each motor and the rotor position angle value.
Optionally, fig. 4 is a flowchart of a control method of another robot according to an embodiment of the present invention.
Referring to fig. 4, a control method of a robot according to an embodiment of the present invention includes:
and S101, receiving a control parameter instruction.
And S102, acquiring actual control parameters of each motor.
S301, converting the torque command, the speed command and the angle position command into current command values corresponding to current values of a d axis and a q axis of each motor based on the proportion of a calibration table.
Specifically, through a certain calibration table proportion, the torque, speed and angle position commands of all the motors are converted into current command values of the three motors, and the current command values are output to variables needing to be controlled.
And S302, performing proportional-integral calculation according to the current instruction value and the actual control parameter, and outputting the driving voltage value of the square wave to each motor so as to control each motor respectively.
Specifically, the proportional-integral calculation is performed according to the current instruction value and the actual control parameter, and may be performed by using a control algorithm of at least one of a vector control algorithm, a position estimation-free algorithm, and a direct torque control algorithm of the permanent magnet synchronous motor, or may be performed by using another algorithm as needed, and the proportional-integral calculation is performed to output a driving voltage value of a square wave to each motor, so as to control each motor respectively.
Optionally, fig. 5 is a flowchart of a control method of another robot according to an embodiment of the present invention.
Referring to fig. 5, a method for controlling a robot according to an embodiment of the present invention includes:
and S101, receiving a control parameter instruction.
And S102, acquiring actual control parameters of each motor.
S301, converting the torque command, the speed command and the angle position command into current command values corresponding to current values of a d axis and a q axis of each motor based on the proportion of a calibration table.
S401, performing clarke transformation and park transformation on current parameters in the actual control parameters of each motor to obtain current actual values of a direct axis d axis and a quadrature axis q axis.
S402, according to the current instruction value and the current actual value, combining with an anti-integral saturation algorithm, and through judgment of speed and torque output, performing targeted calculation in a region close to saturation, and generating voltage values of a d axis and a q axis.
And S403, performing inverse park transformation on the voltage values of the d axis and the q axis to obtain the voltage values of the alpha axis and the beta axis in the static coordinate system.
And S404, performing a pulse width modulation algorithm of a space vector according to the voltage values of the alpha axis and the beta axis in the static coordinate system, thereby outputting the voltage value of a square wave to control each motor respectively.
Specifically, an algorithm for performing proportional integration on the current command value and the actual value includes an algorithm for improving anti-integral saturation, and when the voltage values of the output d-axis and q-axis reach an upper limit or a lower limit, a fixed value is subtracted from the upper limit or a fixed value is added to the lower limit, so that the output voltage value is prevented from reaching a maximum value and being incapable of exiting saturation. Through the judgment of speed and torque output, the targeted calculation is carried out in the region close to saturation, so that the time consumption of a motor control board is reduced; and calculating voltage values of output d-axis and q-axis. Performing inverse park transformation on the voltage values of the d axis and the q axis to obtain the voltage values of the alpha axis and the beta axis in a static coordinate system; and then a space vector pulse width modulation algorithm (SVPWM) is performed to output a voltage value of a square wave to control the three motors, respectively.
Optionally, the communication mode between the main control board and the single motor control board is not limited to the communication mode with CAN or CANFD, and may also adopt the communication modes commonly used in industry, such as RS 485, Ethercat or Ethernet, and the like, without any limitation here.
Optionally, the position detection and the three-phase power line bundle provided by the application are not limited to a magnetic encoder, but may also include a grating encoder, a rotary transformer, a linear hall encoder, and the like, and are not limited herein.
Optionally, the joint motor that this application provided is not only limited to permanent magnet synchronous motor, can also include asynchronous machine, step motor and servo steering wheel etc..
Optionally, before receiving the control parameter instruction, initialization is further included. The method specifically comprises initializing a motor control board and external equipment thereof, peripheral equipment used by three motors, 6 current analog quantity inputs, 3 groups of PWM voltage value outputs, 3 peripheral equipment for rotor position angle detection, a communication mode CAN or CANFD and other necessary configuration programs.
Exemplarily, fig. 6 is a flowchart of a control method of another robot according to an embodiment of the present invention. Referring to fig. 6, the motor including three motors will be described as an example. The application provides a control method for controlling three motors by a single motor controller of a robot, which comprises the following steps:
and S710, starting.
And S720, initializing the peripheral.
S730, a CAN interruption subprogram enters a CAN interruption subprogram S731; the CAN interrupt subroutine ends, and S740 is entered.
S731, CAN interrupt subroutine starts.
And S732, receiving an upper board card instruction. Wherein, the upper plate card can be a main control panel.
And S733, analyzing the upper board card instruction.
S734, obtaining current value commands of a d axis and a q axis;
and S735, returning the collected current torque, speed and rotor position angle information of each motor to the upper plate.
And S736, ending the CAN interruption subprogram.
S740, a timer interruption subprogram, and the method enters a timer interruption subprogram S741; the timer interrupt subroutine ends, and the process proceeds to S750.
S741, the timer interrupt subroutine starts.
And S742, reading and analyzing three-phase current ADC values of the 3 motors.
And S743, reading and analyzing the rotor position angle values of the 3 motors.
And S744, performing clarke transformation and park transformation.
And S745, performing PI calculation on the d axis and the q axis of the current command value and the actual value of the 3 motors.
And S746, outputting voltage values of a d axis and a q axis of the 3 motors after PI calculation of the 3 motors.
S747, and the voltage values of the d axis and the q axis of the 3 motors are subjected to inverse park conversion.
And S748, performing pulse width modulation (SVPWM) algorithm on the space vectors of the 3 motors.
And S749, outputting PWM voltage values to hardware by the 3 motors.
S7410, the timer interrupt subroutine ends.
And S750, ending.
The three motors are controlled simultaneously by adopting a one-control-three mode based on a single control board, so that the design difficulty of a single joint is simplified, the weight, the cost and the volume of the joint are reduced, and the control efficiency is improved.
Fig. 7 is a schematic diagram of a control system of a robot according to an embodiment of the present invention. Referring to fig. 7, a control system 100 of a robot according to an embodiment of the present invention is used to execute a control method of a robot according to any of the embodiments. The control system 100 of the robot according to the embodiment of the present invention includes:
the instruction receiving module 61 is used for receiving a control parameter instruction; the control parameter instruction is triggered when the robot is controlled to act; the control parameter commands include torque commands, speed commands, and angular position commands for each of the motors.
And a parameter obtaining module 62, configured to obtain actual control parameters of each motor.
And the calculating module 63 is used for generating the driving voltage value of each motor according to the control parameter instruction and the actual control parameter.
Fig. 8 is a schematic diagram of a terminal according to an embodiment of the present invention. On the basis of the above embodiments, referring to fig. 8, an embodiment of the present invention provides a terminal 200, including the control system 100 of the robot according to any of the above embodiments, where the control system 100 of the robot is configured to execute the control method of the robot according to any of the above embodiments. The terminal 200 provided by the embodiment of the invention comprises intelligent equipment such as a robot.
Fig. 9 is a schematic diagram of another terminal according to an embodiment of the present invention. On the basis of the above-mentioned embodiment, referring to fig. 9, an embodiment of the present invention provides a readable storage medium, on which a software program is stored, and when instructions in the readable storage medium 81 are executed by the processor 82 of the control system of the robot, the control system of the robot is enabled to execute the control method of the robot proposed in any of the above-mentioned embodiments. The method comprises the following steps: receiving a control parameter instruction; the control parameter instruction is triggered when the robot is controlled to act; the control parameter commands comprise torque commands, speed commands and angle position commands of all the motors; acquiring actual control parameters of each motor; and generating the driving voltage value of each motor according to the control parameter instruction and the actual control parameter.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the above operations of the control method of the robot, and may also perform related operations in the control method of the robot provided by any embodiments of the present invention, and has corresponding functions and advantages.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute the robot control method according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.