Patent ID: 11918175
Assignee: AMICRO SEMICONDUCTOR CO., LTD.
Field: Control (Instruments)
Classification: CPC A  G | IPC A  G

Claim 7:
8. A chip, configured to store a program, wherein the program is configured to control a robot to execute a control method, wherein the robot begins to linearly move on a carpet surface from an initial position, coordinates sensed by the robot are required to be converted into a global coordinate system, and the control method comprises:
S1, determining a preset direction in which the robot linearly moves on the carpet surface, wherein the preset direction is a positive direction of a preset coordinate axis of the global coordinate system, and recording an initial position coordinate and an initial moment of the robot simultaneously, and entering S2;
S2, performing, every first preset time, fusion calculation on data sensed by an optical flow sensor and data sensed by code disks, to obtain a current position coordinate of the robot, which corresponds to an actual advancing distance of drive wheels of the robot, and entering S3;
S3, calculating an amount of drift of a current direction of motion, relative to the preset direction, of the robot, according to a relative position relationship between the current position coordinate and the initial position coordinate of the robot, then accumulating the amount of drifts of current directions of motion relative to the preset direction to obtain a drift statistical value, and entering S4, wherein the amount of drift refers to a distance between a current position of the robot and a straight line where the preset direction lies in;
S4, determining whether a difference between a current moment and the initial moment is greater than a second preset time or not, when the difference between the current moment and the initial moment is greater than the second preset time, entering S5, otherwise, returning to S2;
S5, based on a time interval of data sensing at the first preset time, calculating a number of acquisitions of position coordinates within the second preset time, and using the drift statistical value to average the number of acquisitions to obtain a drift average value as an amount of carpet drift, wherein a positive and a negative of the drift average value is related to a coordinate axis direction from which the robot deviates in the global coordinate system, and the drift average value determines a magnitude of a current motion direction of the robot deviates from the preset direction; after that, entering S6; and
S6, according to a difference value corresponding to an absolute value of the drift average value, setting a corresponding proportional-integral-derivative (PID) proportionality coefficient to synchronously adjust a speed of left drive wheel of the robot and a speed of right drive wheel of the robot, so that the robot is corrected from the current motion direction to the preset direction to continue to linearly move,
wherein the amount of drift, the drift statistical value, and the number of acquisitions are all initialized to be zero at the initial moment; the first preset time refers to a time for each fusion calculation; the second preset time refers to a detection time to determine carpet drift occurred to the robot; and both the coordinates of the initial position and the current position of the robot are global coordinates,
the coordinates sensed by the robot is sensed by the optical flow sensor,
before S1, the speed of the left drive wheel of the robot is equal to that of the right drive wheel of the robot.