Motor zero-position calibration method and motor device, electronic device, storage medium

By detecting the online status and current value of the motor, the zero-position calibration information is automatically updated, which solves the problem of long zero-position calibration time and realizes rapid self-testing and efficient calibration.

CN115425903BActive Publication Date: 2026-03-10ECOFLOW INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, the zero-position calibration of motors takes a long time, and the calibration time is easily increased due to improper operation or equipment upgrades.

Method used

By detecting whether the motor is online after power-on, the zero-position calibration information is obtained. If there is a mismatch, temporary zero-position information is determined and the motor is controlled to rotate. The calibration conditions are judged by the motor current value, the rotation is stopped and the zero-position calibration information is updated.

Benefits of technology

It enables rapid self-testing and automatic calibration of the motor every time it starts, reducing calibration time, lowering the probability of errors, and improving production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115425903B_ABST
    Figure CN115425903B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, electronic device, and storage medium for zero-position calibration of a motor. The method includes: detecting whether the motor is online after power-on; acquiring zero-position calibration information of the motor when it is online; determining temporary zero-position information when the zero-position calibration information does not match preset calibration information, and controlling the motor to rotate in a preset direction according to the temporary zero-position information; acquiring the motor current value during rotation, and determining whether the motor has reached the calibration conditions based on the motor current value; controlling the motor to stop rotating when the motor reaches the calibration conditions, updating the zero-position calibration information according to the position information when the motor stops rotating, and completing the zero-position calibration of the motor. The technical solution of this application embodiment can automatically perform zero-position calibration after power-on, reducing the time spent on zero-position calibration.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electromechanical control, in particular to a motor zero calibration method, a motor device, an electronic device and a computer readable storage medium. BACKGROUND

[0002] In various engineering fields, motor closed-loop control is widely used, but for motors that need to control position, the device needs to recalibrate the motor zero when it is powered on and off. Currently, there are manual calibration and automatic calibration for zero calibration. Whether it is manual calibration or automatic calibration, recalibration after power-on will affect the device startup time, and due to improper user operation or device updates, etc., the zero calibration will be performed again, resulting in a long time spent on zero calibration in the prior art. SUMMARY

[0003] To solve the above technical problems, the embodiments of the present application provide a motor zero calibration method, a motor device, an electronic device and a computer readable storage medium, which aim to solve the technical problem of long time spent on motor zero calibration in the prior art.

[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0005] According to one aspect of an embodiment of the present application, a motor zero calibration method is provided, comprising:

[0006] After detecting that the motor is powered on, detecting whether the motor is online;

[0007] When the motor is online, obtaining zero calibration information of the motor;

[0008] When the zero calibration information does not match the preset calibration information, determining temporary zero information, and controlling the motor to rotate in a preset direction according to the temporary zero information;

[0009] Obtaining a motor current value of the motor during rotation, and determining whether the motor reaches a calibration condition according to the motor current value;

[0010] When the motor reaches the calibration condition, controlling the motor to stop rotating, updating the zero calibration information according to the position information when the motor stops rotating, and completing the zero calibration of the motor.

[0011] In an exemplary embodiment of the present application, the obtaining of the motor current value of the motor during rotation and the determination of whether the motor reaches the calibration condition according to the motor current value comprise:

[0012] acquire a motor current value of the motor in real time during rotation of the motor;

[0013] If the motor current value exceeds a preset current threshold, it is determined that the motor reaches a calibration condition.

[0014] In an exemplary embodiment of the present application, the acquisition of the motor current value of the motor during rotation of the motor and the determination of whether the motor reaches a calibration condition according to the motor current value comprises:

[0015] acquire a motor current value of the motor in real time during rotation of the motor;

[0016] If it is detected that the motor current value is zero, it is determined that the motor reaches a calibration condition.

[0017] In an exemplary embodiment of the present application, after the acquisition of the zero calibration information of the motor when the motor is online, the method further comprises:

[0018] When the zero calibration information matches preset calibration information, it is determined that the zero calibration of the motor has been completed.

[0019] In an exemplary embodiment of the present application, the zero calibration information comprises calibration identification, encoder zero calibration value and motor position calibration value.

[0020] The updating of the zero calibration information according to the position information when the motor stops rotating comprises:

[0021] acquire first encoder information and first motor position information when the motor is in a stopped state;

[0022] update the encoder zero calibration value as the first encoder information, update the motor position calibration value as the first motor position information, and update the calibration identification as a preset first identification.

[0023] In an exemplary embodiment of the present application, after the updating of the zero calibration information according to the position information when the motor stops rotating, the method further comprises:

[0024] detect whether the updated zero calibration information matches the preset calibration information;

[0025] If it is detected that the zero calibration information does not match the preset calibration information, perform a first prompt operation.

[0026] In an example embodiment of the present application, the zero calibration information includes an encoder zero calibration value, the preset calibration information includes an effective calibration range of the encoder, the determining the temporary zero information, and controlling the motor to rotate in a preset direction according to the temporary zero information, includes:

[0027] determining a temporary calibration value within the effective calibration range of the encoder as the temporary zero information;

[0028] sending a running instruction to the motor according to the temporary zero information to control the motor to rotate in a preset direction.

[0029] According to an aspect of an embodiment of the present application, there is provided a motor zero calibration device, comprising:

[0030] a first detection module configured to detect whether the motor is online after detecting that the motor is powered on;

[0031] a first acquisition module configured to acquire zero calibration information of the motor when the motor is online;

[0032] a determination module configured to determine temporary zero information when the zero calibration information does not match preset calibration information, and control the motor to rotate in a preset direction according to the temporary zero information;

[0033] a second acquisition module configured to acquire a motor current value of the motor during rotation, and determine whether the motor reaches a calibration condition according to the motor current value;

[0034] an update module configured to control the motor to stop rotating when the motor reaches the calibration condition, update the zero calibration information according to position information when the motor stops rotating, and complete zero calibration of the motor.

[0035] According to an aspect of an embodiment of the present application, there is provided a motor device, comprising a motor, a processor, and a memory, the memory being configured to store one or more programs, the one or more programs being executed by the one or more processors to implement the motor zero calibration method as described above.

[0036] According to an aspect of an embodiment of the present application, there is provided an electronic device, comprising a motor, one or more processors, and a storage device configured to store one or more programs, the one or more programs being executed by the one or more processors to cause the electronic device to implement the motor zero calibration method as described above.

[0037] According to an aspect of the embodiments of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores computer readable instructions. When the computer readable instructions are executed by a processor of a computer, the computer executes the motor zero calibration method as described above.

[0038] According to an aspect of the embodiments of the present application, a computer program product or computer program is provided, and the computer program product or computer program includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the motor zero calibration method provided in the various optional embodiments described above.

[0039] In the technical solution provided by the embodiments of the present application, when the motor is powered on and online, whether the motor is in the calibrated state is determined by whether the zero calibration information matches the preset calibration information. When the zero calibration information does not match the preset calibration information, it is determined that the motor is in the uncalibrated state. When the motor is uncalibrated, whether the motor reaches the calibration condition is determined in real time by the motor current value when the motor rotates. When the motor reaches the calibration condition, the rotation of the motor is stopped, and the zero calibration information is updated according to the position information when the motor stops rotating. In this way, the motor is automatically calibrated, and it is convenient to determine the calibration state when the motor is powered on next time. The technical solution provided by the present application can perform self-checking of zero calibration every time the motor is started. When it is found that the motor is not in the zero calibration state, a quick response is made to reduce the calibration time.

[0040] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present application. BRIEF DESCRIPTION OF DRAWINGS

[0041] The accompanying drawings, which are incorporated into and form part of the specification, illustrate one embodiment consistent with the present application and, together with the description, serve to explain the principles of the application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:

[0042] Figure 1 is a flowchart of a motor zero calibration method in an embodiment of the present application;

[0043] Figure 2 is a flowchart of a motor zero calibration method in an embodiment of the present application;

[0044] Figure 3 is a flowchart of step S130 in an embodiment of the present application;

[0045] Figure 4 is a flowchart of step S140 in one embodiment to which the present application pertains;

[0046] Figure 5 is a flowchart of step S140 in another embodiment to which the present application pertains;

[0047] Figure 6 is a flowchart of step S150 in one embodiment to which the present application pertains;

[0048] Figure 7 is a flowchart of a motor zero calibration method in one embodiment to which the present application pertains;

[0049] Figure 8 is a flowchart of a motor zero calibration method in one embodiment to which the present application pertains;

[0050] Figure 9 is a block diagram of a motor zero calibration device in one embodiment to which the present application pertains;

[0051] Figure 10 shows a structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0052] The exemplary embodiments will be described in detail herein below with reference to the drawings. In the following description, the same numbers refer to the same or similar elements throughout the drawings. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they only represent examples of apparatuses and methods consistent with some aspects of the present application, as detailed in the appended claims.

[0053] The block diagrams shown in the drawings are merely functional entities, and do not necessarily have to correspond to physically independent entities. That is, the functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0054] The flowcharts shown in the drawings are merely exemplary illustrations, and do not necessarily include all contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be further divided, and some operations / steps can be combined or partially combined, so that the actual execution order can be changed according to actual situations.

[0055] It should be further noted that "multiple" in the present application refers to two or more than two. The association relationship of "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. The character " / " generally represents an "or" relationship between the front and rear associated objects.

[0056] The motor zero calibration method provided by the embodiments of the present application can be run on various devices installed with a motor. The motor is a motor with a position requirement and installed with an absolute encoder. The absolute encoder is a sensor that directly outputs digital and can give a complete digital output corresponding to each angular position. The absolute encoder can read a fixed digital code corresponding to the position at any position of the rotating shaft. Therefore, during the rotation of the motor, the absolute encoder rotates together and can record the position of the motor rotation.

[0057] Figure 1 is a flowchart of a motor zero calibration method according to an example embodiment. As shown in Figure 1 the motor zero calibration method can include steps S110 to S150.

[0058] Step S110, after detecting the power-on of the motor, detecting whether the motor is online.

[0059] In the embodiments of the present application, the motor is installed on a device. The motor is a motor with a position requirement and installed with an absolute encoder. The motor can use the absolute encoder. When the motor is powered off, the motor can maintain power supply to the absolute encoder through the internal power supply. Therefore, even if the user rotates the motor in the case of power-off of the motor, the absolute encoder in the motor can record the corresponding coordinate position and convert the coordinate position to the corresponding digital output. The user can know the current position information of the motor by checking the digital. After the motor is powered on, the control board of the motor is started. The control board can execute the motor zero calibration program.

[0060] It can be understood that the control board is also arranged on the device for corresponding control of the motor. The control board is provided with a controller. The controller can be a microprocessor MCU or a central processing unit CPU or other processor with data processing function. The present application does not limit this.

[0061] At this time, the control board can first detect whether the motor is online. For example, the control board can confirm whether the motor is online through a heartbeat packet. The heartbeat packet includes the state information of the motor. The state information is used to indicate whether the motor is drivable. If the motor is drivable, it means that the current motor is online.

[0062] Step S120, when the motor is online, the zero calibration information of the motor is acquired.

[0063] In the embodiment of the present application, the zero calibration information of the motor is stored in the memory of the motor, and the zero calibration information can represent whether the motor has been calibrated. When the motor is online, the control board can quickly acquire the zero calibration information of the motor from the flash memory.

[0064] It can be understood that the memory can include a non-volatile memory and other types of memories, which are not limited in the present application.

[0065] If the motor is not online, it means that the motor may have a fault at this time, and cannot be normally connected after power-on. At this time, the control board sends a fault prompt information, for example, the warning light of the control device flashes to prompt the user that the motor has a fault.

[0066] Step S130, when the zero calibration information does not match the preset calibration information, the temporary zero information is determined, and the motor is controlled to rotate in a preset direction according to the temporary zero information.

[0067] In the embodiment of the present application, after the control board acquires the zero calibration information of the motor, it can detect whether the zero calibration information matches the preset calibration information.

[0068] When the zero calibration information does not match the preset calibration information, the control board can determine the temporary zero information according to the preset calibration information. The temporary zero information can be any value that matches the preset calibration information. For example, the control board can directly use the preset calibration information as the temporary zero information. If the preset calibration information is a range of values, a value in the range of values is determined as the temporary zero information. By setting the temporary zero information, the motor uses the temporary zero information as the calibration state at the current time, so that the system can continue to run according to the temporary zero information, and the motor rotates in a preset direction, so that the motor gradually reaches the calibration condition during the rotation.

[0069] Step S140, the motor current value during the rotation of the motor is acquired, and whether the motor reaches the calibration condition is determined according to the motor current value.

[0070] In the embodiment of the present application, the control board determines whether the motor reaches the calibration condition by obtaining the motor current value in the motor rotation process, and stops the motor rotation after the calibration condition is reached. For the equipment with the motor, a hard limit or over-limit power-off protection measure is usually provided in the equipment, or the hard limit or over-limit power-off protection is realized by external tools. The hard limit or over-limit power-off corresponds to a limit position, which is the stop position of the motor, i.e. the zero position, and corresponds to the calibration condition of the motor. When the motor reaches the limit position corresponding to the hard limit protection measure or the over-limit power-off protection measure, the motor current value changes accordingly. For example, when the motor reaches the maximum position of the hard limit, a larger current is needed to provide more power, so when the maximum position is reached, the current reaches the maximum. For another example, when the motor reaches the maximum position of the over-limit power-off, the equipment will start the power-off protection, and at this time, the motor current is zero. Therefore, whether the motor reaches the calibration condition can be directly detected by the motor current value, and the motor stops rotating when the motor reaches the calibration condition.

[0071] In other embodiments, if the equipment does not have a hard limit, over-limit power-off protection measure, etc., whether the motor reaches the calibration condition should be determined according to the specific structure of the equipment. If the equipment is a device with clear control requirements for the position, the motor reaches the boundary position of the effective motion interval, which is the calibration condition. Exemplarily, whether the effective motion interval is reached can be monitored by an internal sensor or an external sensor.

[0072] Step S150, when the motor reaches the calibration condition, the motor is controlled to stop rotating, and the zero calibration information is updated according to the position information when the motor stops rotating, and the zero calibration of the motor is completed.

[0073] In the embodiment of the present application, when the motor reaches the calibration condition, the control board controls the motor to stop rotating, and updates the zero calibration information stored in the memory according to the position information when the motor stops rotating, and completes the zero calibration of the motor. Next time the motor is powered on, the control board can obtain the latest zero calibration information from the memory to perform the zero calibration of the motor.

[0074] It can be understood that if the motor current is zero when the motor reaches the calibration condition, the motor stops automatically at this time.

[0075] The technical scheme provided in the application can perform self-checking of zero position calibration each time the motor starts, can quickly react when it is found that the motor is not in a zero position calibration state, controls the motor to rotate, quickly detects whether the motor reaches a calibration condition through a motor current value, and reduces calibration time. After zero position calibration is completed, the original motor position in calibration is determined through zero position calibration information and preset calibration information each time the motor starts, so that recalibration is not needed. When system error is found and recalibration is needed, the zero position calibration method can also be automatically performed, the complexity of calibration is reduced, the error probability is reduced, one-key calibration and one-key reading after clamping test are realized, and production efficiency is improved.

[0076] In an embodiment of the application, referring to Figure 2 After the zero position calibration information of the motor is obtained in step S120 when the motor is online, the motor zero position calibration method further includes step S210.

[0077] In step S210, when the zero position calibration information matches the preset calibration information, it is determined that the zero position calibration of the motor has been completed.

[0078] In the embodiment of the application, the control board matches the obtained zero position calibration information with the preset calibration information. When the zero position calibration information has multiple pieces, the multiple pieces of zero position calibration information respectively have corresponding preset calibration information. When it is determined whether the zero position calibration information matches the preset calibration information, the multiple pieces of zero position calibration information are respectively matched with the corresponding preset calibration information. For example, when the zero position calibration information includes calibration identification, encoder zero position calibration value, and motor position calibration value, the corresponding preset calibration information includes preset identification, encoder effective calibration range, and motor position effective calibration range. Then, the calibration identification is matched with the preset identification, it is determined whether the encoder zero position calibration value is in the encoder effective calibration range, and it is determined whether the motor position calibration value is in the motor position effective calibration range. When the calibration identification matches the preset identification, the encoder zero position calibration value is in the encoder effective calibration range, and the motor position calibration value is in the motor position effective calibration range, it is indicated that the zero position calibration information matches the preset calibration information.

[0079] Further, the calibration identification is stored in a specific address of the memory, and the corresponding preset identification can take data content that does not often appear, such as taking 0xCD as the preset identification, to avoid confusion with other data. In the available storage space of the memory, except for the code segment, the stack segment, and the like, an independent address space in the memory is reserved for storing the related zero position calibration information. When the code is reprogrammed, only the code segment is erased and rewritten; and when the motor is re-powered on and off, only the content corresponding to the memory address required for temporary operation is cleared.

[0080] When the zero position calibration information includes the calibration identifier, the encoder zero position calibration value and the motor position calibration value, when judging whether the zero position calibration information matches the preset calibration information, the calibration identifier can be first judged whether it matches the preset identifier, when the calibration identifier does not match the preset identifier, it can be determined that the zero position calibration information does not match the preset calibration information, and it is not necessary to compare the encoder zero position calibration value and the motor position calibration value. If the calibration identifier matches the preset identifier, the encoder zero position calibration value and the motor position calibration value are obtained from the memory to match, and the time for matching the zero position calibration information and the preset calibration information is reduced.

[0081] In the embodiment of the application, when the zero position calibration information matches the preset calibration information, it indicates that the motor has been calibrated. When the zero position calibration information includes multiple, each zero position calibration information matches the corresponding preset calibration information, and it indicates that the motor has been calibrated.

[0082] In the embodiment of the application, by matching the zero position calibration information and the preset calibration information, the motor can quickly respond after each start, and after it is determined that the zero position calibration information matches the preset calibration information, it is considered that the motor has completed calibration, and it is not necessary to recalibrate after each start, and the calibration time is reduced.

[0083] In one embodiment of the application, please refer to Figure 3 The zero position calibration information includes the encoder zero position calibration value, the preset calibration information includes the effective calibration range of the encoder, the temporary zero position information is determined in step S130, and the motor is controlled to rotate in the preset direction according to the temporary zero position information, including step S310 and step S320.

[0084] Step S310, a temporary calibration value is determined as the temporary zero position information in the effective calibration range of the encoder.

[0085] In the embodiment of the application, if it is found that the zero position calibration information does not match the preset calibration information, a value is randomly taken from the effective calibration range of the encoder as the temporary zero position information, so as to ensure that the device can continue to operate.

[0086] In other embodiments, if the zero position calibration information does not match the preset calibration information, the value of the current encoder is obtained, and it is checked whether the value exceeds the effective calibration range of the encoder, if not, the value of the current encoder is taken as the temporary zero position information.

[0087] Step S320, according to the temporary zero position information, a running instruction is sent to the motor to control the motor to rotate in the preset direction.

[0088] In the embodiment of the present application, if the motor has a bounded designated boundary in the clockwise direction or the counterclockwise direction, and whether the motor reaches the bounded designated boundary in the corresponding direction can be confirmed through the internal sensor or the external sensor, the control board issues the driving level signal of the motor or the driver according to the temporary zero position information, so that the motor continuously rotates in the preset direction, but the motor should not reach the bounded designated boundary in the corresponding direction during the rotation.

[0089] Specifically, when the motor has a bounded designated boundary in the clockwise direction or the counterclockwise direction, a hard stop, an over-position power-off and other protection measures are correspondingly set. Under the hard stop protection measure, a corresponding hard stop mechanism is arranged on the device, which can limit the motor in the translation range or the rotation range, so as to protect the motor or the load, prevent the motor from running out of boundary due to incorrect instructions, control errors, instruction runaway and other reasons, and prevent damage to itself or other products. When the motor moves to the limit position of the hard stop, the hard stop mechanism switch is triggered, and then an alarm is correspondingly given to prompt the user to check in time, and then power off is performed to protect the entire device. After the hard stop mechanism switch is turned on, the cancel key cannot be used to cancel, and if cancellation is required, the hard stop function needs to be turned off in the execution switch. Under the over-position power-off protection measure, the motor on the device is provided with a corresponding limit position. When the motor reaches the limit position during movement, the power-off protection is triggered, so that the motor stops moving after power-off, preventing damage to itself or other products.

[0090] In an embodiment of the present application, please refer to Figure 4 In step S140, the motor current value of the motor during rotation is obtained, and whether the motor reaches the calibration condition is determined according to the motor current value, including step S410 and step S420.

[0091] In step S410, the motor current value of the motor during rotation is obtained in real time.

[0092] In the embodiment of the present application, the control board obtains the motor current value of the motor during rotation in real time, and compares the obtained motor current value with the preset current threshold.

[0093] In step S420, if the motor current value exceeds the preset current threshold, it is determined that the motor reaches the calibration condition.

[0094] In the embodiment of the present application, the hard stop needs to provide a larger current to make the motor have greater power. If the motor current value is greater than the preset current threshold, it indicates that the motor has reached the calibration condition, and the motor can be controlled to stop rotating.

[0095] In an embodiment of the present application, please refer to Figure 5In step S140, the motor current value in the rotating process of the motor is acquired, and whether the motor reaches the calibration condition is determined according to the motor current value, including step S510 and step S520.

[0096] In step S510, the motor current value in the rotating process of the motor is acquired in real time.

[0097] In the embodiment of the application, the motor current value in the rotating process of the motor is acquired in real time, and whether the acquired motor current value is zero is detected in real time.

[0098] In step S520, if it is detected that the motor current value is zero, it is determined that the motor reaches the calibration condition.

[0099] In the embodiment of the application, after the control program is initialized, the automatic calibration process is automatically entered, that is, the motor zero position calibration method provided in the embodiment of the application is executed, and the controller continuously sends the running instruction to the motor. After the running instruction is sent, if the motor current value is zero, it is indicated that the motor has reached the limit and triggered the power-off protection.

[0100] In one embodiment of the application, please refer to Figure 6 The zero position calibration information includes the calibration identifier, the encoder zero position calibration value and the motor position calibration value. In step S150, the zero position calibration information is updated according to the position information when the motor stops rotating, including step S610 and step S620.

[0101] In step S610, the first encoder information and the first motor position information when the motor is in the stop state are acquired.

[0102] In the embodiment of the application, when it is determined that the motor reaches the calibration condition according to the motor current value, it is indicated that the zero position calibration of the motor is completed, the motor is controlled to stop rotating, and the first encoder information and the first motor position information when the motor is in the stop state are acquired.

[0103] In step S620, the encoder zero position calibration value is updated to the first encoder information, the motor position calibration value is updated to the first motor position information, and the calibration identifier is updated to the preset first identifier.

[0104] In the embodiment of the present application, the encoder zero position calibration value is updated as the first encoder information, and the motor position calibration value is updated as the first motor position information. Meanwhile, the calibration identifier is updated as a preset identifier, which can be set as 0Xcd. When the calibration identifier is the preset identifier, it indicates that the motor has been calibrated. In other embodiments, the preset identifier can also be set as other values. When updating the calibration identifier, the calibration identifier can be the preset identifier. In this case, the calibration identifier is not updated when it is determined that the calibration identifier is the preset identifier. Through the embodiment of the present application, the motor will automatically obtain the corresponding zero position calibration information from the memory to execute the motor zero position calibration method when the motor is started next time.

[0105] In an embodiment of the present application, referring to Figure 7 After step S150, the motor zero position calibration method further includes step S710 and step S720.

[0106] In step S710, it is detected whether the updated zero position calibration information matches the preset calibration information.

[0107] In the embodiment of the present application, after the zero position calibration information stored in the flash memory is updated according to the position information when the motor stops rotating, it is detected again whether the updated zero position calibration information matches the preset calibration information. Similarly, when the zero position calibration information has multiple values, the multiple zero position calibration information respectively matches the corresponding preset calibration information.

[0108] In step S720, if it is detected that the zero position calibration information does not match the preset calibration information, a first prompt operation is performed.

[0109] In the embodiment of the present application, if it is detected that the zero position calibration information does not match the preset calibration information, for example, the zero position calibration information is the encoder zero position calibration value, and the preset calibration information is the effective encoder calibration range. The zero position calibration information does not match the preset calibration information, that is, the encoder zero position calibration value is not in the effective encoder calibration range. It indicates that after the entire automatic calibration process, the zero position calibration information after automatic calibration still does not meet the requirements of the zero position calibration, which means that the motor cannot complete the automatic zero position calibration at this time. If the motor cannot complete the automatic zero position calibration, the first prompt operation is performed. For example, preset prompt information is generated to prompt the user to perform manual calibration. The preset prompt information can use indicator lights, signal lights, buzzers, etc. It can be understood that the device will also force the user to use manual calibration when it is in the factory stage and cannot perform automatic zero position calibration.

[0110] Specifically, the manual calibration process is as follows: different resistance values are used to distinguish hardware versions, including the version of the control board and the version of the peripheral device, and software versions are distinguished by definitions in the software, to complete the checking of the hardware and software versions of the equipment; it is checked whether the test fixture of the equipment is installed, and whether the test fixture is connected to the computer of the equipment; when the checking is completed, the power of the test fixture is turned on, the fixture box is closed, and it is checked whether the test fixture limiting clamp is assembled correctly; if the test fixture limiting clamp is assembled correctly, it is checked whether the equipment can operate within the specified range, and if the equipment can operate within the specified range, the motor is adjusted to the zero position of the extreme or special fixed device, that is, the manual calibration process is completed.

[0111] If the motor cannot operate within the specified range, the equipment is started, the corresponding production software of the equipment is connected, and it is checked whether the calibration completion flag is 1. If it is 0, the drive enable of the equipment is turned on, the motor is driven to run in the calibration direction until it reaches the calibration completion position, and the start parameter of the calibration program is set to 1. If the calibration completion flag is 1, it indicates that the motor has been calibrated, and it is checked whether the calibration return values are correct. The calibration conversion value is related to the operation mode of the specific corresponding motor. If the operation mode of the motor is rotation, the calibration conversion value is related to the angle. If the operation mode of the motor is transmission, the calibration conversion value is related to the linear distance.

[0112] The production software is disconnected, the equipment is restarted, the equipment is connected to the corresponding production software again, the information in the calibration process is loaded, it is checked whether the calibration completion flag is 1 and whether the calibrated content is correct, and at the same time, the motor is driven for closed-loop control to check whether the running accuracy and the real-time feedback position, current, speed, direction and other information are correct. If all are correct, the manual calibration is completed. If there is incorrect information, the power is turned off, the equipment is removed from the fixture, the current calibration error is tested and recorded, the equipment is placed on the fixture again, the power is turned on, the information in the calibration process is loaded again, the specified calibration value is set to the actual measured value, the calibration effect is checked again, that is, whether the calibration completion flag is 1 and whether the calibrated content is correct, and at the same time, the motor is driven for closed-loop control to check whether the running accuracy and the real-time feedback position, current, speed, direction and other information are correct.

[0113] In an example embodiment of the present application, please refer to Figure 8 , Figure 8 is a motor zero calibration method according to an example embodiment, comprising steps S810 to S890.

[0114] Step S810, after detecting that the motor is powered on, it is detected whether the motor is online, and if the motor is online, the zero calibration information of the motor is obtained.

[0115] In the embodiment of the present application, the zero position calibration information includes multiple. After the motor is powered on, the control board of the motor starts to execute the motor zero position calibration program. After the motor is determined to be online, multiple zero position calibration information of the motor is acquired. The multiple zero position calibration information has been described above and will not be described here.

[0116] In step S820, it is detected whether the multiple zero position calibration information matches the corresponding preset calibration information.

[0117] In the embodiment of the present application, the multiple zero position calibration information is matched with the corresponding preset calibration information respectively. When the matching is performed, the multiple zero position calibration information can be matched in a certain order, that is, after the matching of one zero position calibration information is completed, the matching of the next zero position calibration information is performed. Meanwhile, the multiple zero position calibration information can be matched simultaneously. When the multiple zero position calibration information is matched in a certain order, if one zero position calibration information does not match the corresponding preset calibration information, the matching of the following zero position calibration information does not need to be performed, and the subsequent step is directly executed. When the multiple zero position calibration information matches the corresponding preset calibration information, step S890 is entered to complete the zero position calibration.

[0118] In step S830, if any zero position calibration information does not match the corresponding preset calibration information, temporary zero position information is determined, and the motor is controlled to rotate in a preset direction according to the temporary zero position information.

[0119] In the embodiment of the present application, when any zero position calibration information does not match the corresponding preset calibration information, the temporary zero position information is determined, so that the system can continue to operate according to the temporary zero position information, and the motor is controlled to rotate in a preset direction, so that the motor gradually reaches the calibration condition in the rotating process.

[0120] In step S840, the motor current value in the rotating process of the motor is acquired in real time, and it is detected whether the motor current value exceeds a preset current threshold value or whether the motor current value is zero.

[0121] In the embodiment of the present application, the motor current value in the rotating process of the motor is acquired in real time, and the acquired motor current value is compared with the preset current threshold value or it is detected whether the motor current value is zero.

[0122] In step S850, if the motor current value exceeds the preset current threshold value or the motor current value is zero, it is determined that the motor reaches the calibration condition.

[0123] In the embodiment of the present application, when any one of the conditions that the motor current value exceeds the preset current threshold value or the motor current value is zero is met, it is determined that the motor reaches the calibration condition.

[0124] In step S860, the motor is controlled to stop rotating, and the zero position calibration information is updated according to the position information when the motor stops rotating.

[0125] In the embodiment of the present application, when the motor reaches the calibration condition, the motor is controlled to stop rotating, and the zero position calibration information stored in the memory is updated according to the position information when the motor stops rotating, so that the motor can obtain the latest zero position calibration information from the memory for motor zero position calibration next time the motor is powered on.

[0126] In step S870, it is detected whether the updated zero position calibration information matches the preset calibration information.

[0127] In the embodiment of the present application, in order to further improve the accuracy of zero position calibration, when it is determined that the motor reaches the calibration condition according to the motor current value, it is further detected whether the updated zero position calibration information matches the preset calibration information, and when the two match, the zero position calibration is completed in step S890.

[0128] In step S880, if it is detected that the zero position calibration information does not match the preset calibration information, a first prompt operation is performed.

[0129] In the embodiment of the present application, when the zero position calibration information does not match the preset calibration information, manual calibration is needed, and the first prompt operation is performed to prompt the user to perform manual calibration.

[0130] In the embodiment of the present application, whether the motor is in the zero position calibration state when the motor is powered on is determined by whether the zero position calibration information matches the corresponding preset calibration information, when the zero position calibration information does not match the preset calibration information, it is determined that the motor is not in the zero position calibration state, whether the motor reaches the calibration condition is determined in real time by the motor current value when the motor rotates, when the motor reaches the calibration condition, the rotation of the motor is stopped, and the zero position calibration information is updated according to the position information when the motor stops rotating, so as to facilitate detection of whether the motor is calibrated next time the motor is powered on. The technical solution provided by the present application can perform self-checking of zero position calibration every time the motor is started, quickly respond when it is found that the motor is not in the zero position calibration state, and reduce the calibration time. Meanwhile, in the embodiment, after it is determined that the motor reaches the calibration condition according to the motor current value, the updated zero position calibration information is further matched with the preset calibration information, so as to improve the accuracy of zero position calibration, and when the updated zero position calibration information does not match the preset calibration information, the user is reminded to perform manual calibration in a timely manner through the preset prompt information.

[0131] In one example embodiment of the present application, please refer to Figure 9 , Figure 9 is a block diagram of a motor zero position calibration device according to an example embodiment, which comprises:

[0132] The first detection module 910 is configured to detect whether the motor is online after detecting that the motor is powered on.

[0133] The first obtaining module 920 is configured to obtain zero position calibration information of the motor when the motor is online.

[0134] The determining module 930 is configured to determine temporary zero position information when the zero position calibration information does not match the preset calibration information, and control the motor to rotate in a preset direction according to the temporary zero position information.

[0135] The second obtaining module 940 is configured to obtain a motor current value of the motor in the rotating process, and determine whether the motor reaches a calibration condition according to the motor current value.

[0136] The updating module 950 is configured to control the motor to stop rotating when the motor reaches the calibration condition, update the zero position calibration information according to position information when the motor stops rotating, and complete the zero position calibration of the motor.

[0137] In an example embodiment of the present application, the second obtaining module 940 comprises:

[0138] The first obtaining submodule is configured to obtain the motor current value of the motor in the rotating process in real time.

[0139] The first determining submodule is configured to determine that the motor reaches the calibration condition if the motor current value exceeds a preset current threshold.

[0140] In an example embodiment of the present application, the second obtaining module 940 comprises:

[0141] The second obtaining submodule is configured to obtain the motor current value of the motor in the rotating process in real time.

[0142] The second determining submodule is configured to determine that the motor reaches the calibration condition if the motor current value is detected to be zero.

[0143] In an example embodiment of the present application, the determining module 930 is further configured to determine that the zero position calibration of the motor is completed when the zero position calibration information matches the preset calibration information.

[0144] In an example embodiment of the present application, the zero position calibration information comprises calibration identification, encoder zero position calibration value and motor position calibration value; and the updating module 950 comprises:

[0145] The obtaining submodule is configured to obtain first encoder information and first motor position information when the motor is in a stopped state.

[0146] The updating submodule is configured to update the encoder zero position calibration value as the first encoder information, update the motor position calibration value as the first motor position information, and update the calibration identification as a preset first identification.

[0147] In an example embodiment of the present application, the motor zero position calibration device further comprises:

[0148] a second detection module, configured to detect whether the updated zero position calibration information matches the preset calibration information;

[0149] a generation module, configured to perform a first prompting operation if it is detected that the zero position calibration information does not match the preset calibration information.

[0150] In an example embodiment of the present application, the zero position calibration information includes an encoder zero position calibration value, the preset calibration information includes an effective calibration range of the encoder, and the determination module 930 includes:

[0151] a determination sub-module, configured to determine a temporary calibration value as temporary zero position information within the effective calibration range of the encoder;

[0152] a sending sub-module, configured to send a running instruction to the motor according to the temporary zero position information to control the motor to rotate in a preset direction.

[0153] It should be noted that the apparatus provided by the above-described embodiments and the method provided by the above-described embodiments belong to the same concept, and the specific manner in which each module and sub-module performs operations has been described in detail in the method embodiments, which will not be described here.

[0154] Embodiments of the present application also provide an electronic device, including one or more processors; a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the motor zero position calibration method provided in each of the above-described embodiments.

[0155] Embodiments of the present application also provide an electronic device, including one or more processors; a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the motor zero position calibration method provided in each of the above-described embodiments.

[0156] It can be understood that, in some embodiments, the electronic device can be a self-moving device on which a motor is installed. The self-moving device can be a device containing a self-moving auxiliary function. The self-moving auxiliary function can be implemented by a vehicle terminal, and the corresponding self-moving device can be a vehicle having the vehicle terminal. The self-moving device can also be a semi-self-moving device or a fully autonomous moving device. For example, the self-moving device can be a lawn mower, a sweeper, a robot with a navigation function, etc.

[0157] Figure 10 A structural schematic diagram of a computer system of an electronic device suitable for implementing embodiments of the present application is shown.

[0158] It should be noted that, Figure 10The computer system 1000 of the electronic device shown is merely one example, and should not bring any limitation to the functions and usage range of the embodiments of the present application.

[0159] As shown in Figure 10 the computer system 1000 includes a central processing unit (CPU) 1001 which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage section 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0160] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, a key switch, and the like; an output section 1007 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), an LED, and the like, and a speaker, and the like; a storage section 1008 including a hard disk, and the like; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as necessary. A removable media 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 1010 as necessary, so that a computer program read therefrom is installed into the storage section 1008 as necessary.

[0161] In particular, according to the embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product including a computer program carried on a computer-readable medium, the computer program containing a computer program for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 1009, and / or installed from the removable media 1011. When the computer program is executed by the central processing unit (CPU) 1001, various functions defined in the system of the present application are performed.

[0162] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by an instruction execution system, apparatus or device to use or combine with the program. In this application, the computer-readable signal medium can include a data signal that propagates in a baseband or as a carrier wave in a propagated data signal, in which the computer-readable computer program is carried. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium that can send, propagate or transmit a program for use by or in connection with an instruction execution system, apparatus or device. The computer program contained in the computer-readable medium can be transmitted in any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.

[0163] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0164] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.

[0165] Another aspect of the present application also provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method described above. The computer readable storage medium can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the electronic device.

[0166] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the method provided in each of the above embodiments.

[0167] The above is only a preferred exemplary embodiment of the present application, and is not intended to limit the implementation of the present application. Those skilled in the art can easily make corresponding modifications or variations according to the main concept and spirit of the present application, and the protection scope of the present application should be subject to the protection scope required by the claims.

Claims

1. A method of motor zero calibration, the method comprising: The method comprises the following steps: After detecting that the motor is powered on, it is detected whether the motor is online; When the motor is online, zero calibration information of the motor is acquired; The zero calibration information is stored in a storage of the motor; The zero calibration information is used to represent whether the motor has been calibrated; When the zero calibration information does not match preset calibration information, temporary zero information is determined, and the motor is controlled to rotate in a preset direction according to the temporary zero information; The motor current value in the rotating process of the motor is acquired, and whether the motor reaches a calibration condition is determined according to the motor current value; When the motor reaches the calibration condition, the motor is controlled to stop rotating, the zero calibration information is updated according to the position information when the motor stops rotating, and the zero calibration of the motor is completed.

2. The method of claim 1, wherein, The acquisition of the motor current value in the rotating process of the motor and the determination of whether the motor reaches the calibration condition according to the motor current value comprise the following steps: The motor current value in the rotating process of the motor is acquired in real time; If the motor current value exceeds a preset current threshold, it is determined that the motor reaches the calibration condition.

3. The method of claim 1, wherein, The acquisition of the motor current value in the rotating process of the motor and the determination of whether the motor reaches the calibration condition according to the motor current value comprise the following steps: The motor current value in the rotating process of the motor is acquired in real time; If it is detected that the motor current value is zero, it is determined that the motor reaches the calibration condition.

4. The method of claim 1, wherein, After the acquisition of the zero calibration information of the motor when the motor is online, the method further comprises the following steps: When the zero calibration information matches the preset calibration information, it is determined that the zero calibration of the motor has been completed.

5. The method of any one of claims 1 to 4, wherein, The zero calibration information comprises calibration identification, encoder zero calibration value and motor position calibration value; The updating of the zero calibration information according to the position information when the motor stops rotating comprises the following steps: First encoder information and first motor position information when the motor is in a stopped state are acquired; The encoder zero calibration value is updated as the first encoder information, the motor position calibration value is updated as the first motor position information, and the calibration identification is updated as a preset first identification.

6. The method of claim 5, wherein, After the motor is controlled to stop rotating when the motor reaches the calibration condition, the updating of the zero calibration information according to the position information when the motor stops rotating, the method further comprises the following steps: It is detected whether the updated zero calibration information matches the preset calibration information; If it is detected that the zero calibration information does not match the preset calibration information, a first prompt operation is performed.

7. The method of any one of claims 1 to 4, wherein, The zero calibration information comprises encoder zero calibration value, the preset calibration information comprises the effective calibration range of the encoder, and the determination of temporary zero information and the control of the motor to rotate in a preset direction according to the temporary zero information comprise the following steps: A temporary calibration value is determined as the temporary zero information within the effective calibration range of the encoder; According to the temporary zero information, a running instruction is sent to the motor to control the motor to rotate in a preset direction.

8. An electric machine arrangement, characterized in that An electronic device comprising a motor, a processor, and a memory storing one or more programs for execution by the one or more processors to implement the motor zero calibration method of any of claims 1-7.

9. An electronic device, comprising: comprising: a motor; one or more processors; a memory device for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the motor zero calibration method of any of claims 1-7.

10. A computer-readable storage medium, characterized in that, a computer-readable medium having stored thereon computer-readable instructions that, when executed by a processor of a computer, cause the computer to perform the motor zero calibration method of any of claims 1-7.

Citation Information

Patent Citations

  • Calibration method and device for rotation zero-point position of motor

    CN106533277A

  • Zero point positioning method, zero point positioning system, servo motor and storage medium

    CN110793553A