Motor rotor position determination system, method, device, equipment, medium and product
Through the system of the photoelectric encoder, general timer module GTM and control unit, the problem of waste and low efficiency of motor rotor position determination in the prior art is solved, and efficient and accurate motor rotor position calculation is achieved.
Patent Information
- Application Number
- CN202411599324.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
The existing methods of determining the position of the motor rotor using photoelectric encoders have problems of serious resource waste and low processing efficiency.
Using a system including an optoelectronic encoder, a universal timer module GTM and a control unit, the optoelectronic encoder is connected to the motor through a coupling, and the GTM receives a pull-down level signal and a quadrature encoded signal to determine the current value of the count register, and the control unit is based on The value of the count register calculates the current position of the motor rotor.
The hardware components receive and process signals in real time, determine the value of the count register, and realize accurate calculation of the motor rotor position, improving resource utilization and processing efficiency.
Smart Images

Figure CN119471361A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of motor rotor position determination, and in particular, to a motor rotor position determination system, method, device, equipment, medium and product. Background Art
[0002] In recent years, photoelectric encoders have gradually developed into a series of industrial products with mature technology, diverse specifications and excellent performance. These products have been widely used and recognized in many high-tech fields such as CNC machine tools, robot radar systems, photoelectric theodolites, high-precision closed-loop speed control systems and servo systems. Photoelectric encoders, as a sensor specially used to accurately detect the speed, position and angle of mechanical movement, cleverly integrate optics, mechanics and electronic technologies, showing their unique advantages: high resolution ensures the accuracy of measurement, high precision improves the reliability of data, and small size makes it easy to install and integrate. In addition, its stable and reliable performance and outstanding cost performance make photoelectric encoders very popular in the market.
[0003] However, it is worth noting that the current method of using photoelectric encoders to determine the position of the motor rotor is generally implemented by software. Although this method can meet the basic functional requirements to a certain extent, it inevitably exposes the problems of serious waste of resources and low processing efficiency. Summary of the invention
[0004] The present invention provides a motor rotor position determination system, method, device, equipment, medium and product to solve the problems of serious resource waste and low processing efficiency when the motor rotor position is determined by using a photoelectric encoder.
[0005] According to one aspect of the present invention, a motor rotor position determination system is provided, comprising a photoelectric encoder, a general timer module GTM and a control unit, wherein the photoelectric encoder is connected to the motor via a coupling, the photoelectric encoder rotates in the same direction as the motor, the photoelectric encoder is in communication connection with the GTM, and the GTM is in communication connection with the control unit;
[0006] The GTM is used to receive a first logic value of a pull-down level signal and a second logic value of an orthogonal encoding signal sent by the photoelectric encoder, and determine a current value of a counting register based on the first logic value and the second logic value, wherein the orthogonal encoding signal includes an A-phase signal and a B-phase signal;
[0007] The control unit is used to calculate the current position of the motor rotor of the motor according to the current value of the count register read.
[0008] According to another aspect of the present invention, a method for determining a motor rotor position is provided, which is applied to a control unit in a motor rotor position determination system according to any embodiment of the present invention, and the method comprises:
[0009] Read the current value of the count register;
[0010] The current position of the motor rotor of the motor is calculated according to the current value of the counting register.
[0011] According to another aspect of the present invention, a motor rotor position determination device is provided, which is configured in a control unit in a motor rotor position determination system according to any embodiment of the present invention, and the device comprises:
[0012] A reading module is used to read the current value of the counting register;
[0013] A calculation module is used to calculate the current position of the motor rotor of the motor according to the current value of the counting register.
[0014] According to another aspect of the present invention, a control unit is provided, which is configured in the motor rotor position determination system according to any embodiment of the present invention, and the control unit includes:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for determining the motor rotor position described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining the motor rotor position described in any embodiment of the present invention when executed.
[0019] According to another aspect of the present invention, a computer program product is provided. The computer program product comprises a computer program. When the computer program is executed by a processor, the method for determining the position of a motor rotor according to any one of the embodiments of the present invention is implemented.
[0020] A motor rotor position determination system provided by an embodiment of the present invention comprises a photoelectric encoder, a general timer module GTM and a control unit, wherein the photoelectric encoder is connected to the motor through a coupling, the photoelectric encoder rotates in the same direction as the motor, the photoelectric encoder is connected to the GTM for communication, and the GTM is connected to the control unit for communication; the GTM is used to receive a first logic value of a pull-down level signal and a second logic value of an orthogonal coding signal sent by the photoelectric encoder, and determine the current value of a counting register based on the first logic value and the second logic value, wherein the orthogonal coding signal includes an A phase signal and a B phase signal; the control unit is used to calculate the current position of the motor rotor of the motor according to the current value of the reading counting register. Through the above technical solution, the photoelectric encoder is connected to the motor and rotates in the same direction to generate an orthogonal coding signal (A phase signal and B phase signal), and then the hardware component GTM receives and processes the pull-down level signal and the orthogonal coding signal in real time to determine the current value of the counting register, and the control unit reads the current value of the counting register to calculate the current position of the motor rotor, thereby realizing the determination of the value of the counting register in a hardware manner, thereby effectively improving the resource utilization and efficiency of the determination of the motor rotor position.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a structural schematic diagram of a motor rotor position determination system provided by Embodiment 1 of the present invention;
[0024] Figure 2 is a schematic diagram of TIM channel allocation provided by an embodiment of the present invention;
[0025] Figure 3 is a flow chart of a method for determining the position of a motor rotor provided in Embodiment 2 of the present invention;
[0026] Figure 4 is a schematic structural diagram of a motor rotor position determination device provided in Embodiment 3 of the present invention;
[0027] Figure 5It is a structural schematic diagram of a control unit provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 1 is a schematic diagram of a motor rotor position determination system provided by Embodiment 1 of the present invention. This embodiment is applicable to the case of determining the motor rotor position. Figure 1 As shown, the system includes:
[0032] Photoelectric encoder 100, general timer module GTM110 and control unit 120. The photoelectric encoder 100 is connected to the motor 130 through a coupling, the photoelectric encoder 100 and the motor 130 rotate in the same direction (not shown in the figure), the photoelectric encoder 100 is connected to the GTM110 for communication, and the GTM110 is connected to the control unit 120 for communication; the GTM110 is used to receive the first logic value of the pull-down level signal and the second logic value of the orthogonal encoding signal sent by the photoelectric encoder 100, and determine the current value of the counting register based on the first logic value and the second logic value, wherein the orthogonal encoding signal includes an A-phase signal and a B-phase signal; the control unit 120 is used to calculate the current position of the motor rotor of the motor 130 according to the current value of the counting register read.
[0033] Among them, the motor can be understood as an electromagnetic device that realizes the conversion or transmission of electric energy according to the law of electromagnetic induction. In this embodiment, the motor is a DC motor. The motor includes a motor controller with adjustable speed and a motor body. Among them, the motor controller is an electronic control unit for controlling the operation of the motor; the motor body can be understood as the main mechanical part, including magnetic steel, windings, mechanical housing and motor rotor, etc. The coupling is a device that connects the motor rotor and other mechanical equipment to ensure that the motor rotor can rotate synchronously with other equipment and transmit power and torque. The working process of the motor: the motor controller generates a control signal, which is transmitted to the motor body to change the internal magnetic field of the motor, thereby driving the motor rotor to rotate. The rotation is transmitted to the connected mechanical equipment through the coupling to realize power transmission and coordinated work. The photoelectric encoder can be understood as a sensor that combines mechanical, optical and electronic complexes, which can convert the speed information of the real physical meaning into a digital signal, and then send the digital signal to the single-chip microcomputer for decoding processing. In this example, the specification of the photoelectric encoder is 2048P / R.
[0034] In this embodiment, the General Timer Module (GTM) is a highly programmable and configurable hardware module. The GTM can capture the changes of digital input signals in real time and use them together with digitized analog signals for calculation to achieve accurate multi-input data acquisition and multi-output signal generation. In this embodiment, the GTM is integrated in the single-chip microcomputer, and the embedded software is programmed to configure and control the GTM to achieve the initialization and counting functions of the GTM. The control unit set is the core component in the single-chip microcomputer, responsible for instruction decoding, timing control and operation coordination, to ensure that the various components of the single-chip microcomputer work together. The pull-down level signal can be understood as a signal that is always at a low level, and the first logic value of the signal is "0". This signal is usually used to indicate a certain state or as a default input for certain functions. The A-phase signal and the B-phase signal are square wave signals with a phase difference of 90 degrees, which are used to determine the rotation direction and rotation angle of the photoelectric encoder. The counting register is integrated in the GTM to realize the function of the counter. The second logic can be "0" or "1", where "0" represents a low level and "1" represents a high level.
[0035] In this embodiment, if Figure 1 As shown, one end of the photoelectric encoder is connected to the motor through a coupling, and the other end is connected to the GTM for communication, and the GTM is connected to the control unit for communication.
[0036] The specific working process is as follows:
[0037] The photoelectric encoder rotates coaxially with the motor, generates an orthogonal encoding signal including an A-phase signal and a B-phase signal, and sends the orthogonal encoding signal to the GTM; while receiving the orthogonal encoding signal, the GTM also receives a pull-down level signal, and determines and updates the current value of the counting register based on the first logic value of the pull-down level signal and the second logic value of the orthogonal encoding signal; then, the control unit reads the current value of the counting register and obtains the current position of the motor rotor through calculation.
[0038] A motor rotor position determination system provided by an embodiment of the present invention comprises a photoelectric encoder, a general timer module GTM and a control unit, wherein the photoelectric encoder is connected to the motor through a coupling, the photoelectric encoder rotates in the same direction as the motor, the photoelectric encoder is connected to the GTM for communication, and the GTM is connected to the control unit for communication; the GTM is used to receive a first logic value of a pull-down level signal and a second logic value of an orthogonal coding signal sent by the photoelectric encoder, and determine the current value of a counting register based on the first logic value and the second logic value, wherein the orthogonal coding signal includes an A phase signal and a B phase signal; the control unit is used to calculate the current position of the motor rotor of the motor according to the current value of the reading counting register. Through the above technical solution, the photoelectric encoder is connected to the motor and rotates in the same direction to generate an orthogonal coding signal (A phase signal and B phase signal), and then the hardware component GTM receives and processes a pull-down level signal and an orthogonal coding signal in real time to determine the current value of the counting register, and the control unit reads the current value of the counting register to calculate the current position of the motor rotor, thereby realizing the determination of the value of the counting register in a hardware manner, thereby effectively improving the resource utilization and efficiency of the determination of the motor rotor position.
[0039] Optionally, the motor rotor position determination system also includes a bracket for fixing the motor and the photoelectric encoder.
[0040] In some embodiments, the GTM includes a timer input module and a sensor mode evaluation module, wherein the timer input module is communicatively connected to the photoelectric encoder through a preset channel, and the timer input module is communicatively connected to the sensor mode evaluation module; the timer input module is used to receive the first logic value and the second logic value, and pre-process the first logic value to obtain a first target logic value, pre-process the second logic value to obtain a second target logic value, and output the first target logic value and the second target logic value to the sensor mode evaluation module; the sensor mode evaluation module is used to determine the current value of the counting register based on the first target logic value and the second target logic value.
[0041] In this embodiment, the Timer Input Module (TIM) is a key component in the GTM, and its main function is to receive and process external input signals, which can be various types of time or event-related signals. The Sensor Pattern Evaluation (SPE) module is a module in the GTM for evaluating and processing sensor signals. In the GTM, the SPE module works in conjunction with the TIM, etc. to achieve accurate capture, processing and evaluation of sensor signals.
[0042] Among them, the preset channel can be understood as a channel in a preset TIM. The preset channel is connected to the pull-down level signal, the A phase signal and the B phase signal through a physical interface or a logical interface to receive and / or transmit these signals. It is worth noting that according to the hardware requirements inside the SPE module, it is necessary to select three channels of TIM[x]_0, TIM[x]_1 and TIM[x]_2 in the TIM to receive the first logical value of the pull-down level signal, the second logical value of the A phase signal and the second logical value of the B phase signal. Due to certain differences in the internal GTMs of different single-chip microcomputers, the value range of x is determined by the number of TIMs in the GTM. Exemplarily, in this embodiment, the three channels of TIM[0]_0, TIM[0]_1 and TIM[0]_2 are specifically selected. In addition, the value range of x is not only affected by the display of the number of TIMs, but also by the configuration of the SPE module register. Under certain configurations, TIM[x]_[2:0] or TIM[x]_[5:3] can be selected.
[0043] This embodiment does not limit the order in which the preset channel receives the pull-down level signal, the A phase signal, and the B phase signal. For example, TIM[x]_0, TIM[x]_1, and TIM[x]_2 may receive the first logic value of the pull-down level signal, the second logic value of the A phase signal, and the second logic value of the B phase signal, respectively, or TIM[x]_0, TIM[x]_2, and TIM[x]_1 may receive the first logic value of the pull-down level signal, the second logic value of the A phase signal, and the second logic value of the B phase signal, respectively. Through the above method, a total of 3*2=6 permutations and combinations can be calculated. This flexibly configurable selection scheme enables users to flexibly adjust TIM channel selection according to different constraints of actual project conditions.
[0044] It is worth noting that in this embodiment, TIM[0]_0 can receive the second logic value of the A-phase signal, TIM[0]_1 can receive the second logic value of the B-phase signal, and TIM[0]_0 can receive the first logic value "0" of the pull-down level signal; then, communication connection with the SPE module is established through a preset channel.
[0045] Specific workflow:
[0046] The TIM first receives the first logic value and the second logic value from the relevant signal source. These logic values represent different signal states, such as high and low levels. After receiving these logic values, the TIM will pre-process these logic values: filter, de-jitter or level conversion of the first logic value to obtain a stable and accurate first target logic value; filter, de-jitter or level conversion of the second logic value to obtain a stable and accurate second target logic value; and then the TIM will output these two target logic values to the SPE module.
[0047] After receiving the first target logic value and the second target logic value, the SPE module will analyze and evaluate the two logic values using the preset logic judgment rule, and determine the current value of the counting register based on the analysis and evaluation results, and then write it into the counting register. In this embodiment, the preset logic judgment rule is set based on the hardware characteristics of the SPE module, and the specific hardware elements of the design are not limited in this embodiment.
[0048] Through the above technical solution, the input signal is preprocessed to remove noise and jitter in the signal, ensuring that the signal input to the SPE module is stable and reliable; furthermore, the SPE module determines the current value of the counting register based on the preprocessed signal, effectively improving the efficiency of the counting register and providing a solid foundation for the subsequent accurate calculation of the motor rotor position.
[0049] In some embodiments, the sensor mode evaluation module is used to receive the first target logic value and the second target logic value through a first register, and determine the current value of the second register based on the first target logic value, the second target logic value and a preset configuration table, wherein the first register and the second register are deployed in the sensor mode evaluation module, and the preset configuration table includes a correspondence between a preset logic value of a pull-down level signal, a preset logic value of an orthogonal coding signal and a value of the second register; the sensor mode evaluation module is used to determine the current value of the counting register based on the current value of the second register and the value of the second register at a previous moment.
[0050] In this embodiment, a first register and a second register are deployed in the SPE module, and the first register is different from the second register, wherein the first register is used to receive the signal output by the TIM, and supports three input modes: TIM[x]_0, TIM[x]_1, and TIM[x]_2. Exemplarily, in this embodiment, the first register is defined as the Input Pattern register, and its specific register name is SPE[i]_PAT.IP[t]_PAT, wherein SPE[i] represents the i-th special processing unit (or module), PAT represents the part related to the pattern, and IP[t] indicates that the register stores the data of the t-th input pattern. In order to more clearly describe the function of the register, the following index correspondence is set: TIM[0]_0 corresponds to PATTERN0, TIM[0]_1 corresponds to PATTERN1, and TIM[0]_2 corresponds to PATTERN2. Such a configuration allows the system to adjust its behavior according to different input modes to adapt to different application scenarios. The second register is used to find the corresponding value in the preset configuration table according to the signal input by the first register to track the motor rotor position. The counting register increases and decreases with the second register. In this embodiment, the counting register is the SPE_REV_CNT register.
[0051] Among them, the preset configuration table can be understood as a lookup table, which is pre-configured in a specific register, such as the SPE[i]_OUT_PAT[p] register. Table 1 is a preset configuration table in an embodiment of the present invention. As shown in Table 1, the preset configuration table includes a preset logic value of a pull-down level signal, a preset logic value of an orthogonal encoding signal, and a value of a second register. Among them, the preset logic value is a preset logic value. These values are used to characterize the correspondence between the relevant signal and the logic state of the second register. It is worth noting that the specification of the photoelectric encoder is 2048P / R, and using quadruple frequency counting (i.e., collecting the rising and falling edges of the A / B phase), a total of 2048*4=8192 PATTERN combinations can be obtained.
[0052] Table 1. Preset configuration table
[0053]
[0054] Specifically, the sensor mode evaluation module first receives the first target logic value and the second target logic value through the first register, uses these logic values as indexes, searches for the corresponding preset logic value from the preset configuration table, and then determines the value of the second register in the table and sets it as the current value of the second register. Then, based on the difference between the current value of the second register and its value at the previous moment, it is determined whether the second register is increased or decreased, so as to update the counting register, thereby tracking the position change of the motor rotor. In this way, the position change of the motor rotor can be accurately monitored and responded to, and precise motor control can be achieved. No software algorithm is required in the entire process of determining the counting register, which effectively improves the efficiency of the system.
[0055] In some embodiments, the sensor mode evaluation module is used to increase the value of the counting register at a previous moment by a preset value to obtain the current value of the counting register when the current value of the second register is greater than the value of the second register at a previous moment, and to reduce the value of the counting register at a previous moment by the preset value to obtain the current value of the counting register when the current value of the second register is less than the value of the second register at a previous moment.
[0056] In this embodiment, the preset value may be a pre-set value. Generally, the preset value is 1 to realize the self-increment and self-decrement of the counting register.
[0057] Specifically, let's use "the increase in the second register indicates that the motor rotor is rotating in the positive direction" as an example: the sensor mode evaluation module updates the counting register by monitoring the change in the value of the second register. When the current value of the second register is greater than its value at the previous moment, it indicates that the motor rotor has changed in the positive direction. At this time, a preset value will be added to the value of the counting register at the previous moment to reflect this increase; on the contrary, if the current value of the second register is less than its value at the previous moment, it indicates that a negative change has occurred, and the same preset value as the value of the counting register at the previous moment will be reduced to record this decrease. Such a mechanism ensures that the counting register can accurately reflect the cumulative changes in the value of the second register, thereby achieving accurate tracking of the system status.
[0058] For example, the control motor starts to rotate. The value of the SPE_PAT_PTR register may increase or decrease according to the direction of rotation. The value of the SPE_REV_CNT register will increase or decrease by +1 / -1 count as the value of the SPE_PAT_PTR register increases or decreases. For example, the forward rotation (i.e., the value of the SPE_PAT_PTR register increases, and the SPE_REV_CNT+1 count) is used for explanation:
[0059] When the motor rotates, it drives the photoelectric encoder to rotate in the same direction. The GTM module receives the pull-down level signal and the A-phase signal and B-phase signal transmitted by the photoelectric encoder. According to the received signal, it searches from the preset configuration table to determine the current value of SPE_PAT_PTR, and then updates the value of the SPE_REV_CNT register according to the current value of SPE_PAT_PTR and the value at the last moment.
[0060] It is worth noting that since the specification of the photoelectric encoder is 2048P / R, by using quadruple frequency counting (i.e. collecting the rising and falling edges of the A / B phases), a total of 2048*4=8192 PATTERN combinations can be obtained, and the accuracy of the mechanical angle can reach 360 / 8192≈0.044°. Then, according to the changes in the PATTERN combination, the value of the SPE_REV_CNT register can be increased from 0 to 8191.
[0061] In some embodiments, the GTM is further used to receive the logic value of the Z-phase signal sent by the photoelectric encoder, and clear the counting register based on the logic value of the Z-phase signal.
[0062] In this embodiment, the Z-phase signal can be understood as a pulse signal sent by the photoelectric encoder to identify a specific reference position (usually the zero point) of its rotating shaft. In this embodiment, the Z-phase signal is received by TIM0_3 in the TIM as the zero point signal. For example, Figure 2 is a schematic diagram of TIM channel allocation provided by an embodiment of the present invention, such as Figure 2 As shown, it includes a photoelectric encoder 20 and TIM21, wherein TIM0_0 in TIM21 is used to receive the logic value of the A phase signal, TIM0_1 is used to receive the logic value of the B phase signal, TIM0_2 is used to receive the logic value "0" of the low level phase signal, and TIM0_3 is used to receive the logic value of the Z phase signal.
[0063] Specifically, in the motor control system, the photoelectric encoder generates a Z signal after completing one rotation (such as the serial number from 1 to 8192 in the table), indicating that the motor rotor has returned to the zero position. When the GTM receives the Z signal, it triggers an interrupt or DMA request, clears the SPE_REV_CNT register to reset the circle count, and prepares to start a new round of counting. This mechanism ensures accurate tracking and counting of the motor rotation cycle.
[0064] Optionally, a register may be set as required to record the number of rotations, that is, the number of zero crossings.
[0065] Optionally, before the motor rotor rotates, the motor rotor position determination system is also included to be installed and initialized, and the initialization includes: first, the system is powered on and initialized, and the motor is rotated to absolute zero to determine its initial position; then, the single-chip microcomputer is initialized, including initializing the GTM module, setting the preset configuration table of the SPE module, and configuring the TIM module as the signal source, setting the working mode of the TIM module to edge detection, and selecting dual-edge detection, so as to capture the rising edge and falling edge of the encoder signal through dual-edge detection, so as to achieve high-precision position tracking, thereby providing accurate rotor position information for motor control.
[0066] Embodiment 2
[0067] Figure 3 1 is a flow chart of a method for determining the position of a motor rotor provided in Embodiment 2 of the present invention. The method is applied to a control unit in a motor rotor position determination system in any of the above embodiments to calculate the position of the motor rotor. Figure 3 As shown, the method includes:
[0068] S210, read the current value of the counting register.
[0069] In this embodiment, the current value of the counting register reflects the current position of the motor rotor.
[0070] S220. Calculate the current position of the motor rotor of the motor according to the current value of the counting register.
[0071] Specifically, the ratio of the current value of the counting register to the preset total count is determined, and the ratio is multiplied by the total angle of the motor rotor rotating one circle to obtain the current position of the motor rotor, wherein the preset total count is obtained by performing a preset number of frequency multiplication counts on the orthogonal encoding signal of the photoelectric encoder. In this embodiment, the photoelectric encoder specification is 2048P / R, and the preset number of four-fold frequency counting (i.e., collecting the rising and falling edges of the AB phase) is used, and the total preset count is 2048*4=8192, and the accuracy of the mechanical angle can reach 360 / 8192≈0.044°.
[0072] Exemplarily, the current value read from the SPE_REV_CNT register is 365, that is, the current position is (365 / 8192)*360°≈16.04° in the positive rotation relative to the zero point; the value read from the SPE_REV_CNT register is 4096, that is, the current position is (4096 / 8192)*360°=180° in the positive rotation relative to the zero point.
[0073] The motor rotor position determination method provided in the second embodiment of the present invention calculates the current position of the motor rotor of the motor according to the current value of the count register by reading the current value of the count register. The current position of the motor rotor is calculated in real time and accurately, which greatly improves the accuracy of position calculation, and realizes continuous and real-time monitoring of the motor rotor position, effectively enhancing the response speed and stability of the motor control system.
[0074] Embodiment 3
[0075] Figure 4 is a schematic diagram of the structure of a motor rotor position determination device provided in Embodiment 3 of the present invention. The device can be configured in a control unit in a motor rotor position determination system as described in any of the above embodiments. Figure 4 As shown, the device comprises:
[0076] A reading module 31 is used to read the current value of the counting register;
[0077] The calculation module 32 is used to calculate the current position of the motor rotor of the motor according to the current value of the counting register.
[0078] The technical solution provided in the third embodiment of the present invention calculates the current position of the motor rotor in real time and accurately, greatly improves the accuracy of position calculation, and realizes continuous and real-time monitoring of the motor rotor position, effectively enhancing the response speed and stability of the motor control system.
[0079] The motor rotor position determination device provided in the embodiment of the present invention can execute the motor rotor position determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0080] Embodiment 4
[0081] Figure 5 : is a structural schematic diagram of a control unit provided in Embodiment 4 of the present invention. The control unit is configured in a motor rotor position determination system, and the control unit may be an electronic device intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0082] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0083] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0084] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for determining the position of a motor rotor.
[0085] In some embodiments, the motor rotor position determination method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the motor rotor position determination method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the motor rotor position determination method in any other appropriate manner (e.g., by means of firmware).
[0086] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0087] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0088] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0089] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0090] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0091] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0092] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0093] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
[0094] An embodiment of the present invention further provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements the method for determining the motor rotor position as provided in any embodiment of the present application.
[0095] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0096] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A motor rotor position determination system, characterized in that: It includes a photoelectric encoder, a universal timer module GTM and a control unit, wherein the photoelectric encoder is connected to the motor through a coupling, the photoelectric encoder rotates in the same direction as the motor, the photoelectric encoder is connected to the GTM for communication, and the GTM is connected to the control unit for communication; The GTM is used to receive a first logic value of a pull-down level signal and a second logic value of an orthogonal encoding signal sent by the photoelectric encoder, and determine a current value of a counting register based on the first logic value and the second logic value, wherein the orthogonal encoding signal includes an A-phase signal and a B-phase signal; The control unit is used to calculate the current position of the motor rotor of the motor according to the current value of the count register read.
2. The system according to claim 1, characterized in that The GTM includes a timer input module and a sensor mode evaluation module, wherein the timer input module is communicatively connected to the photoelectric encoder through a preset channel, and the timer input module is communicatively connected to the sensor mode evaluation module; The timer input module is used to receive the first logic value and the second logic value, pre-process the first logic value to obtain a first target logic value, pre-process the second logic value to obtain a second target logic value, and output the first target logic value and the second target logic value to the sensor mode evaluation module; The sensor mode evaluation module is used to determine a current value of the counting register based on the first target logic value and the second target logic value.
3. The system according to claim 2, characterized in that The sensor mode evaluation module is used to receive the first target logic value and the second target logic value through a first register, and determine a current value of the second register based on the first target logic value, the second target logic value and a preset configuration table, wherein the first register and the second register are deployed in the sensor mode evaluation module, and the preset configuration table includes a corresponding relationship between a preset logic value of a pull-down level signal, a preset logic value of an orthogonal coding signal and a value of the second register; The sensor mode evaluation module is used to determine the current value of the counting register based on the current value of the second register and the value of the second register at a previous moment.
4. The system according to claim 3, characterized in that The sensor mode evaluation module is used to increase the value of the counting register at a previous moment by a preset value to obtain the current value of the counting register when the current value of the second register is greater than the value of the second register at a previous moment, and to reduce the value of the counting register at a previous moment by the preset value to obtain the current value of the counting register when the current value of the second register is less than the value of the second register at a previous moment.
5. The system according to claim 1, characterized in that The GTM is further configured to receive the logic value of the Z-phase signal sent by the photoelectric encoder, and clear the counting register based on the logic value of the Z-phase signal.
6. A method for determining the position of a motor rotor, characterized in that: A control unit applied to a motor rotor position determination system according to any one of claims 1 to 5, the method comprising: Read the current value of the count register; The current position of the motor rotor of the motor is calculated according to the current value of the counting register.
7. A device for determining the position of a motor rotor, characterized in that: A control unit configured in a motor rotor position determination system according to any one of claims 1 to 5, the device comprising: A reading module is used to read the current value of the counting register; A calculation module is used to calculate the current position of the motor rotor of the motor according to the current value of the counting register.
8. A control unit, characterized in that: In the motor rotor position determination system as claimed in any one of claims 1 to 5, the control unit comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for determining the motor rotor position according to claim 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for determining the motor rotor position as claimed in claim 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the method for determining the rotor position of an electric machine according to claim 6 .