[0019] The embodiments of the present invention will be described in detail below with reference to the drawings.
[0020] figure 1 It is a flowchart showing a calibration method of a robot joint according to an embodiment of the present invention. The method for controlling smart home appliances according to the embodiments of the present invention can be applied to various electronic devices with automatic control functions, such as industrial computers, programmable controllers, and single-chip computers.
[0021] The position feedback sensor of the robot joint according to the present invention may include various sensors that can feedback position information. For example, the position feedback sensor may include a variable resistor. The variable resistor is mounted on the motor output shaft of the joint directly or through gears. During the movement of the robot, the variable resistor feedbacks the position information of the joint. For another example, the position feedback sensor may include a variable resistor and an encoder. The encoder is installed on the non-output shaft of the joint's motor, and the variable resistor is installed on the joint's motor output shaft directly or through gears. The key initial position is fed back by the variable resistor, and the position information of the joint is fed back by the encoder combined with the initial position during the movement of the robot.
[0022] There is a certain functional relationship between the position of the joint (for example, the absolute angle) and the analog to digital converter (ADC) value of the variable resistor mounted on the motor output shaft of the joint. The method for calibrating a robot joint according to an embodiment of the present invention can calibrate the functional relationship that reflects the functional relationship by calibrating the relevant parameters of the variable resistor. Preferably, the functional relationship is a linear function. In other words, the method for calibrating a robot joint according to an embodiment of the present invention is used to calibrate the slope and intercept of the linear function. The following will refer to figure 1 To describe the calibration process of each joint.
[0023] Reference figure 1 In step S10, the joint to be calibrated is controlled to move in the first direction. The first direction is a predetermined direction among all movable directions of the joint.
[0024] In step S20, when the joint to be calibrated reaches the movement limit of the first direction, the first ADC value of the variable resistor is acquired. The motion limit in the first direction refers to the maximum position that the joint can reach when moving in the first direction. The first ADC value refers to the ADC value of the variable resistor installed on the output shaft of the motor of the joint to be calibrated when the joint to be calibrated reaches the movement limit of the first direction.
[0025] In step S30, the joint to be calibrated is controlled to move in the second direction of movement. The second direction is opposite to the first direction of movement. For example, the first direction is to the left and the second direction is to the right.
[0026] In step S40, when the joint to be calibrated reaches the movement limit of the second direction, the second ADC value of the variable resistor is acquired. The movement limit in the second direction refers to the maximum position that the joint can reach when moving in the second direction. The second ADC value refers to the ADC value of the variable resistor installed on the output shaft of the motor of the joint to be calibrated when the joint to be calibrated reaches the movement limit in the second direction.
[0027] In the process of controlling the movement of the joint to be calibrated in the first direction or the second direction, the current position of the joint can be estimated, and the movement speed of the joint can be controlled according to the estimated current position to increase the calibration speed and make The joints start and stop smoothly and reliably.
[0028] Specifically, the third ADC value of the variable resistor (the current ADC value of the variable resistor) can be obtained in real time, and the current position of the joint can be estimated according to the empirical function relationship of the variable resistor and the third ADC value, The motion speed of the joint is determined according to the estimated current position, and the joint is controlled to move at the determined motion speed. Here, the empirical function relationship expression of the variable resistor refers to the function relationship expression between the absolute angle of the joint and the ADC value of the variable resistor determined based on experience (for example, experimental data).
[0029] Here, different movement speeds can be set for different positions of joint movement. Preferably, in order to reduce the amount of calculation, a predetermined position closer to the motion limit can be set in advance, the motion speed of the joint is determined as the first speed before the current position reaches the predetermined position, and the motion speed of the joint is determined after the current position reaches the predetermined position Is the second speed, wherein the first speed is greater than the second speed. For example, before the current position reaches the predetermined position, use small steps to approach the limit of motion, and reduce the predetermined speed when the limit of motion is approached (after the current position reaches the predetermined position), so that the calibration speed can be well controlled to ensure start and stop Stable and reliable.
[0030] In the process of controlling the joint to be calibrated to move in the first direction or the second direction, various methods can be used to determine whether the joint reaches the motion limit. Here, it can be judged whether the joint has reached the limit of motion in each servo cycle.
[0031] For example, the current theoretical position of the joint to be calibrated can be determined according to the aforementioned determined motion speed, and the following error between the current theoretical position and the estimated current position can be determined. When the following error is greater than the error threshold, the The joint reaches the limit of motion in the first direction or the limit of motion in the second direction. The current theoretical position is the position that the joint should reach when it moves according to the aforementioned determined movement speed. Here, in each servo cycle, the current theoretical position can be determined according to the motion speed determined in each servo cycle, the cycle duration, and the current position estimated in the previous servo cycle. The following error refers to the difference between the current theoretical position and the estimated current position. When the following error is greater than the error threshold, it means that the position of the joint no longer changes, that is, the joint has reached the limit of motion. The error threshold can be set in advance.
[0032] For another example, the current of the motor of the joint to be calibrated may be obtained, and when the current exceeds the current threshold, it is determined that the joint to be calibrated reaches the motion limit in the first direction or the motion limit in the second direction. The current threshold can be set in advance and set to be greater than the current of the motor when the joint moves normally. When the current obtained exceeds the current threshold, it indicates that the joint has reached the limit of motion.
[0033] In step S50, the absolute angle of the joint to be calibrated is determined according to the first ADC value, the second ADC value, the first absolute angle value of the movement limit in the first direction, and the second absolute angle value of the movement limit in the second direction. The functional relationship between the ADC values of the variable resistors. The first absolute angle value is the absolute angle value of the movement limit of the joint in the first direction, the second absolute angle value is the absolute angle value of the joint movement limit in the second direction, the first absolute angle value and the second absolute angle value It is a known quantity and can be stored in advance.
[0034] Preferably, in order to reduce the amount of calculation, the functional relationship is a linear function. The linear function can be represented by the following formula (1):
[0035] y=k*x+b (1)
[0036] Among them, y represents the absolute angle of the joint to be calibrated, x represents the ADC value of the variable resistor, K is the slope of the linear function, and b is the intercept of the linear function. Substituting the first ADC value, the second ADC value, the first absolute angle value of the movement limit in the first direction, and the second absolute angle value of the movement limit in the second direction into the linear function can obtain the slope k And the intercept b.
[0037] Preferably, in order to improve the accuracy and reliability of the calibration, for accuracy: Steps S10 to S40 can be repeated to obtain multiple first ADC values and multiple second ADC values, and calculate the first ADC value of multiple first ADC values. An average value and a second average value of multiple second ADC values, based on the first average value, the second average value, the first absolute angle value of the movement limit in the first direction, and the second average value of the movement limit in the second direction The absolute angle value determines the above functional relationship. For reliability: Set a deviation value for the ADC value obtained from multiple calibrations. If the two deviations exceed a certain threshold, then at least one calibration is considered to have interference effects. At this time, an error can be reported to stop the calibration. Please eliminate the calibration interference factors , And restart calibration.
[0038] In step S60, a functional relationship between the absolute angle of the joint to be calibrated and the ADC value of the variable resistor is set in the robot control system according to the determined functional relationship. That is, the functional relationship between the absolute angle of the joint to be calibrated in the robot control system and the ADC value of the variable resistor is set to the functional relationship determined in step S50. In the case where the function relational expression is a linear function, the slope and intercept of the linear function are respectively set to the slope and intercept determined in step S50 in the robot control system.
[0039] In addition, in the actual assembly, there may be some installation faults, for example, the variable resistor is biased, the joint is assembled too tightly, etc. These faults can be diagnosed during the calibration process. In order to facilitate accurate diagnosis of the above installation failure, the initial position of the joint to be calibrated may be adjusted within a predetermined angle range, for example, near the zero point of the joint.
[0040] For example, the fault diagnosis is performed according to the first ADC value and the first ADC experience value, and/or the fault diagnosis is performed according to the second ADC value and the second ADC experience value. The first ADC experience value refers to the ADC experience value of the variable resistor when the joint to be calibrated reaches the movement limit in the first direction, and the second ADC experience value refers to when the joint to be calibrated reaches the second direction The first ADC experience value and the second ADC experience value can be set in advance. Specifically, when the difference between the first ADC value and the first ADC experience value is greater than the first difference threshold, and/or when the difference between the second ADC value and the second ADC experience value is greater than the first When the difference threshold value, it prompts that the variable resistor is installed offset, or the variable resistor is abnormal, or there is a problem with the installation of the joint to be calibrated. The first threshold difference can be set in advance.
[0041] For another example, when the position feedback sensor of the robot joint also includes an encoder, fault diagnosis can also be carried out through the following steps: when the joint to be calibrated reaches the movement limit of the first direction, the first reading of the encoder is also obtained, and when the When the calibrated joint reaches the movement limit in the second direction, the second reading of the encoder is also obtained, and the difference between the first reading and the second reading is converted into the first angle difference. When the first angle difference and the second angle When the difference between the differences is greater than the second difference threshold, it indicates that the encoder is abnormal, or there is a problem with the installation of the joint to be calibrated. The second angle difference is the difference between the first absolute angle value and the second absolute angle value. The difference between the first reading and the second reading is converted into the first angle difference according to the conversion relationship between the reading of the encoder and the relative angle.
[0042] An embodiment according to the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores program instructions that when executed by the processor cause the processor to execute the method for calibrating the robot joint as described above. The computer-readable recording medium is any data storage device that can store data read by a computer system. Examples of computer-readable recording media include read-only memory, random access memory, read-only optical disks, magnetic tapes, floppy disks, optical data storage devices, and carrier waves (such as data transmission through the Internet via a wired or wireless transmission path). The computer-readable recording medium can also be distributed in computer systems connected to a network, so that the computer-readable codes are stored and executed in a distributed manner. In addition, the functional programs, codes, and code segments that complete the present invention can be easily interpreted by ordinary programmers in the field related to the present invention within the scope of the present invention.
[0043] According to an embodiment of the present invention, a computing device is also provided. The computing device includes a memory 201 and a processor 301. The memory 201 is used to store program instructions. The program instructions are executed by the processor 301 so that the processor 301 executes the method for calibrating the robot joint as described above.
[0044] According to the method for calibrating a robot joint according to an embodiment of the present invention, the position feedback sensor can be automatically calibrated to feed back relevant parameters of the position information of the joint, the calibration efficiency is high, and the calibration process is safe and reliable, thereby improving the accuracy of robot motion. In addition, the robot joint calibration method according to the embodiment of the present invention can also automatically diagnose some installation faults in actual assembly, so as to facilitate the installation personnel to perform fault verification.
[0045] Although the present invention has been specifically shown and described with reference to its exemplary embodiments, those skilled in the art should understand that the forms and details can be made without departing from the spirit and scope of the present invention as defined by the claims. Various changes on.