Motor control method, device and system

CN115549546BActive Publication Date: 2026-09-22WUHAN ZHONGKE IND RES INST OF MEDICAL SCI CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211308436.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-25
Publication Date
2026-09-22
Estimated Expiration
2042-10-25

AI Technical Summary

Technical Problem

[0004]在本实施例中提供了一种电机控制方法、装置及系统,以解决相关技术中存在的通过FPGA向电机控制芯片下发配置数据灵活性较差、配置效率低的问题

Benefits of technology

[0036]与相关技术相比,在本实施例中提供的电机控制方法,通过基于第一总线接收数据包,该数据包用于配置电机控制器的运行参数,实现了按照电机配置流程生成的配置数据包的整体接收,提高了数据接收效率;通过基于第二总线接收寄存器数据,该寄存器数据用于配置电机控制器的运行参数,实现了电机配置数据的逐条实时接收,在用户根据控制需求实时修改配置数据的情况下,及时获得更新后的配置数据;通过确定该数据包和该寄存器数据的发送顺序,根据数据包和寄存器数据的接收时间和数据配置需求确定发送顺序,避免了按照错误顺序配置导致配置失败的问题;通过基于发送顺序依次将数据包和寄存器数据发送至电机控制器,实现了配置数据的灵活、高效、有序的接收和下发,解决了通过FPGA向电机控制芯片下发配置数据灵活性较差、配置效率低的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115549546B_ABST
    Figure CN115549546B_ABST
Patent Text Reader

Abstract

The application relates to a motor control method, device and system, the method comprising: receiving a data packet based on a first bus, the data packet being used for configuring operation parameters of a motor controller; and receiving register data based on a second bus, the register data being used for configuring operation parameters of the motor controller; determining a sending sequence of the data packet and the register data; and sequentially sending the data packet and the register data to the motor controller based on the sending sequence, so that flexible, efficient and orderly receiving and issuing of configuration data are realized, and the problems of poor flexibility and low configuration efficiency of issuing configuration data from an FPGA to a motor control chip are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of motor control, and in particular to a motor control method, device and system. Background Technology

[0002] Electric motors are electromechanical conversion devices widely used in medical instruments and equipment, computer peripherals and storage, precision instruments, industrial control systems, robotics, and other fields. During motor operation, it is often necessary to control the motor's motion state to achieve accurate and efficient operation. Furthermore, the control methods must be flexible, diverse, and simple to reduce system operating costs and application complexity. Currently, there are various motor control methods, among which motor control using an FPGA combined with a motor control chip is an important approach. In this method, the host computer, FPGA, and motor control chip are connected sequentially. The host computer sends the entire data package used to control the motor to the FPGA's memory. Then, through the connection between the FPGA and the motor control chip, the configuration data in the data package is sent line by line to the motor control chip for motor control. If any data in the data package needs to be changed, the entire data package needs to be updated and resent, or the program needs to be recompiled to modify the configuration data. This application method has poor flexibility and low configuration efficiency.

[0003] There is currently no effective solution to the problems of poor flexibility and low configuration efficiency in sending configuration data from FPGA to motor control chip in related technologies. Summary of the Invention

[0004] This embodiment provides a motor control method, device, and system to solve the problems of poor flexibility and low configuration efficiency in the related technology of sending configuration data to the motor control chip through FPGA.

[0005] Firstly, this embodiment provides a motor control method, which includes:

[0006] Data packets are received via a first bus, the data packets being used to configure the operating parameters of the motor controller; and

[0007] Data is received from the registers via the second bus, and the register data is used to configure the operating parameters of the motor controller.

[0008] Determine the transmission order of the data packets and the register data;

[0009] The data packets and register data are sent to the motor controller in sequence according to the sending order.

[0010] In some embodiments, determining the transmission order of the data packet and the register data includes:

[0011] The transmission order is determined based on the first preset priority of the data packet and the second preset priority of the register data.

[0012] In some embodiments, after receiving data packets based on the first bus, the method further includes:

[0013] Store the data packet in the first cache;

[0014] Based on the first cache address corresponding to the data packet, the configuration data in the data packet is read sequentially, and the configuration data is arranged in a preset configuration order.

[0015] In some embodiments, after receiving register data based on the second bus, the method further includes:

[0016] The register data is stored sequentially into the second buffer according to the receiving time order;

[0017] Based on the received time sequence, the register data is read sequentially.

[0018] In some embodiments, the operating parameters of the motor controller include at least one of the following: the initialization parameters of the motor controller, the zero-finding configuration parameters of the motor corresponding to the motor, and the normal operation configuration parameters of the motor corresponding to the motor.

[0019] In some embodiments, after the data packets and register data are sequentially sent to the motor controller based on the sending order, the method further includes:

[0020] Determine whether the motor corresponding to the motor controller needs to be restarted;

[0021] In the event of a motor restart, the data packet and the register data are received again, and the data packet and the register data are resent to the motor controller.

[0022] In some embodiments, after the data packets and register data are sequentially sent to the motor controller based on the sending order, the method further includes:

[0023] Based on the real-time control requirements of the motor controller, update data packets and / or update register data are received, wherein the update data packets are obtained by modifying the data packets; and the update register data are obtained by modifying the register data.

[0024] The update data packet and / or the update register data are sent to the motor controller.

[0025] In some embodiments, the method further includes:

[0026] Receive status data sent by the motor controller;

[0027] Based on the state data, generate the corresponding data packet and register data;

[0028] Based on the first bus, the data packet is sent to the host computer; and / or

[0029] Based on the second bus, the register data is sent to the host computer.

[0030] Secondly, this embodiment provides a motor control device, which includes:

[0031] The first receiving module is used to receive data packets based on the first bus, the data packets being used to configure the operating parameters of the motor controller;

[0032] The second receiving module is used to receive register data based on the second bus, and the register data is used to configure the operating parameters of the motor controller;

[0033] The determining module is used to determine the transmission order of the data packet and the register data;

[0034] The sending module is used to send the data packet and the register data to the motor controller in sequence according to the sending order.

[0035] Thirdly, this embodiment provides a motor control system, characterized in that the motor control system includes a motor controller for controlling motor operation, a host computer for inputting and sending data packets and register data, and a processor for executing the motor control method as described in the first aspect, receiving the data packets based on a first bus, receiving the register data based on a second bus, and configuring the motor controller based on the data packets and the register data.

[0036] Compared with related technologies, the motor control method provided in this embodiment improves data reception efficiency by receiving data packets via a first bus, which are used to configure the operating parameters of the motor controller. This enables the overall reception of configuration data packets generated according to the motor configuration process. Furthermore, by receiving register data via a second bus, which is also used to configure the operating parameters of the motor controller, the method achieves real-time, line-by-line reception of motor configuration data. This ensures timely access to updated configuration data even when the user modifies the configuration data in real time according to control requirements. By determining the transmission order of the data packets and register data, based on their reception time and data configuration requirements, the method avoids configuration failures caused by incorrect order configuration. Finally, by sequentially sending the data packets and register data to the motor controller according to the transmission order, the method achieves flexible, efficient, and orderly reception and transmission of configuration data, solving the problems of poor flexibility and low efficiency in transmitting configuration data from the FPGA to the motor control chip.

[0037] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0038] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0039] Figure 1 This is a schematic diagram illustrating the application environment of some embodiments of the motor control method of this application;

[0040] Figure 2 This is a flowchart of a motor control method according to some embodiments of this application;

[0041] Figure 3 These are schematic diagrams of data packet structures from some embodiments of this application;

[0042] Figure 4 This is a schematic diagram of the motor configuration data format of some embodiments of this application;

[0043] Figure 5 This is a flowchart illustrating the caching and reading of data packets according to some embodiments of this application;

[0044] Figure 6 This is a flowchart illustrating the caching and reading of register data in some embodiments of this application;

[0045] Figure 7 This is a flowchart illustrating the reverse transmission of motor state data in some embodiments of this application;

[0046] Figure 8 This is a flowchart of a motor control method according to some preferred embodiments of this application;

[0047] Figure 9 This is a structural block diagram of a motor control device according to some embodiments of this application. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0049] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0050] The motor control method provided in this embodiment can be applied to, for example... Figure 1 The application environment shown. Figure 1This is a schematic diagram of the application environment of the motor control method in this embodiment. The host computer 11 is connected to the processor 13 via a first bus and a second bus; the processor 13 is connected to the motor controller 15. The first and second buses between the host computer 11 and the processor 13 can communicate based on high-speed bus interfaces such as PCIe bus interface and Aurora bus interface. When the bus interface is PCIe, the first bus can be an AXI4-MM bus, and the second bus can be an AXI4-Lite bus, or an AVALON bus can be used as both the first and second buses. The processor 13 and the motor controller 15 can communicate based on bus protocols such as I2C bus and SPI bus. The processor 13 can be a programmable logic device or SOC device such as an FPGA with functions such as instruction execution, storage, and bus transmission; the host computer 11 can be an interactive terminal with instruction editing input and data output display functions; and the motor controller 15 can be a motor control chip used to control the motor to run according to preset configuration data. It should be noted that, based on... Figure 1 Depending on the application environment and connection relationship, the motor controller 15 can also be replaced with other external devices that can be configured by the processor 13, such as communication / network devices, audio and video processing devices, etc. There is no limitation on the type of external device.

[0051] The motor control method provided in this embodiment can be executed in processor 13. Processor 13 may include one or more storage units for storing data, which are used to store the execution program corresponding to the motor control method provided in this embodiment. Processor 13 may also include a communication unit for bus transmission. This communication unit can communicate with the host computer 11 and the motor controller 15 through a first bus and a second bus. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the application environment of the motor control method provided in this embodiment. For example, the application environment may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0052] This embodiment provides a motor control method. Figure 2 This is a flowchart of the motor control method in this embodiment, as shown below. Figure 2 As shown, the process includes the following steps:

[0053] Step S201: Receive data packets based on the first bus. These data packets are used to configure the operating parameters of the motor controller.

[0054] According to the motor control process, the data packet format can be predefined. Based on this format, the host computer encapsulates all configuration data used to configure the motor controller's operating parameters, generating a data packet. The configuration data in this data packet is arranged in the order required for configuring the motor controller's operating parameters. Then, through the first bus, the host computer receives the data packet sent all at once, and the host computer sends the configuration data in the data packet to the motor controller one by one according to its own arrangement order, completing the configuration of the operating parameters.

[0055] In some embodiments, the operating parameters of the motor controller include at least one of the following: the initialization parameters of the motor controller, the zeroing configuration parameters of the motor corresponding to the motor, and the normal operation configuration parameters of the motor corresponding to the motor.

[0056] The order of the configuration data in the data packet can be determined based on the functions implemented by the configuration data. For example, Figure 3 These are schematic diagrams of data packet structures in some embodiments, such as... Figure 3 As shown, data packet 300 includes a data packet header 301, used to distinguish it from other data packets; it also includes data blocks that implement three different functions: control chip initialization data block 302, motor zero-finding configuration data block 303, and motor normal operation configuration 304. According to the motor configuration sequence, the motor control chip register initialization configuration is performed first, followed by motor zero-finding configuration, and finally motor normal operation configuration. The configuration data in each data block can be arranged in the order required to implement the function. The host computer arranges the configuration data according to this order, generates a data packet, and sends the data packet to the processor all at once. The processor buffers the data packet and sends it to the motor controller according to the order of the configuration data in the data packet, configuring it sequentially to avoid configuration errors. The data packet can be buffered in the processor's internal RAM or external SRAM, DDR, etc.

[0057] Step S202: Receive register data based on the second bus. This register data is used to configure the operating parameters of the motor controller.

[0058] Unlike data packets which contain all the configuration data needed to configure motor operating parameters, register data refers to configuration data for a single operating parameter. This data can be any one or more pieces of configuration data from the data packet. After receiving this configuration data via the second bus, it can be stored in a register. Figure 4 These are schematic diagrams of motor configuration data formats in some embodiments, such as... Figure 4As shown, the motor configuration data 400 includes an address segment 401 and a data segment 402. The address segment 401 is used to store the register address of the motor controller, and the data segment 402 is used to store the data value written to that register address.

[0059] When configuring motor operating parameters, in addition to one-time transmission of configuration data via data packets, the host computer and processor can also transmit configuration data line by line via register data. This configuration method is less efficient than the data packet method, but it is more flexible. For example, register data can be motor current and voltage parameters, or instructions for controlling the motor's direction of movement and starting / stopping it. In practical applications, users can control the motor's movement status in real time according to actual needs, such as stopping the motor or changing its direction of rotation. In this case, register data can be used to configure a specific operating parameter of the motor to change its movement status. Register data can be a single configuration data entry or multiple configuration data entries sent consecutively. When multiple configuration data entries are received, they can be buffered in the register according to the receiving order and sent to the motor controller in that order for sequential configuration, avoiding configuration errors.

[0060] The order of steps 201 and 202 can be reversed.

[0061] Step S203: Determine the transmission order of the data packet and the register data.

[0062] When the processor receives both data packets and register data within the same time period, or receives register data within the time period during which configuration data from data packets is sequentially sent to the motor controller, it needs to consider the order in which the two types of data are sent to the motor controller. This order can be determined based on the pre-defined priority of the configuration data, the order of reception time, or the order of different buffers. For example, it can be pre-set to prioritize sending RAM data, sending register data only after all RAM data has been sent. The rules governing this sending order are not specified here.

[0063] Step S204: Based on this sending order, data packets and register data are sent to the motor controller in sequence.

[0064] According to the sending order, read the data packets or register data stored in the buffer or register, send the configuration data to the motor controller one by one, and only after the motor controller has completed the corresponding configuration will the next configuration data be read and sent.

[0065] Through the steps S201 to S204 described above, by receiving data packets based on the first bus (used to configure the operating parameters of the motor controller), the overall reception of configuration data packets generated according to the motor configuration process is achieved, improving data reception efficiency. By receiving register data based on the second bus (used to configure the operating parameters of the motor controller), the real-time reception of motor configuration data is achieved, allowing timely acquisition of updated configuration data when the user modifies the configuration data in real time according to control requirements. By determining the sending order of the data packets and register data, the sending order is determined based on the reception time of the data packets and register data and the data configuration requirements, avoiding configuration failures caused by incorrect order configuration. By sending the data packets and register data to the motor controller sequentially based on the sending order, flexible, efficient, and orderly reception and distribution of configuration data is achieved, solving the problems of poor flexibility and low efficiency in distributing configuration data from the FPGA to the motor control chip.

[0066] In some embodiments, specific methods are involved in determining the order in which data packets and register data are sent. These methods include:

[0067] The transmission order is determined based on the first preset priority of the data packets and the second preset priority of the register data.

[0068] When both the buffer and register data contain data to be sent, the transmission order of configuration data within the data packets and register data can be determined by priority settings. Priority settings can be implemented through the arbitration module in the processor. Priority rules can be pre-defined in the arbitration module; for example, the priority of data packets, data blocks, or configuration data can be set based on the importance of the implemented functions or the required order of motor configuration. Within the same data packet, the priority of configuration data can be set according to its arrangement.

[0069] The motor control method in this embodiment avoids configuration failure caused by incorrect configuration order by determining the sending order of data packets and register data based on priority.

[0070] In some embodiments, a data packet to be sent can be treated as a whole, with its priority set to a first preset priority, and the priority of the first configuration data in the register data set set to a second preset priority. Here, the first configuration data refers to the first register data arranged in the receiving order. The first preset priority and the second preset priority are compared, and the one with the higher priority is sent to the motor controller first. After the transmission is completed, if there are still data packets and register data to be sent, their priorities are compared again to determine the transmission order.

[0071] In other embodiments, a data block in the data packet to be sent can be treated as a whole, and this data block corresponds to a functional module of the motor configuration, such as... Figure 3 The control chip initialization data block 302, motor zeroing configuration data block 303, or motor normal operation configuration 304 are configured. The priority of a data block to be sent can be set to the first preset priority, and the priority of the first configuration data in the register can be set to the second preset priority. The sending order is determined based on the priority comparison between the two.

[0072] In other embodiments, each piece of configuration data can be assigned a corresponding priority. The transmission order of each piece of configuration data is determined based on its priority within the data packet or register data. In this case, there is a risk that configuration data within the same data block may be interrupted by register data during transmission. This can be avoided by the following steps:

[0073] Step S11: Determine whether at least one piece of configuration data in the data block has been sent.

[0074] If both the buffer and registers containing the data packet contain data to be sent, the arbitration module can determine whether at least one piece of configuration data in the current data block has been sent, based on the data block format. For example, it can determine whether the data to be sent is the first piece of configuration data in the data block based on the order of the configuration data in the data block. If not, it means that configuration data in the data block has already been sent.

[0075] Step S12: If at least one piece of configuration data has been sent, set the priority of the unsent configuration data in the data block to the highest priority.

[0076] Through the above steps S11 to S12, if at least one piece of configuration data in a data block has been sent, the priority of the unsent configuration data in that data block is set to the highest priority and sent first, thus avoiding the interruption of the transmission of configuration data in the same data block by register data and avoiding the problem of incorrect configuration of motor control chip.

[0077] In some embodiments, the specific process of buffering and reading data packets after receiving them via the first bus is described. Figure 5 This is a flowchart of the data packet caching and reading process in this embodiment, as follows: Figure 5 As shown, the process includes the following steps:

[0078] Step S501: Store the data packet in the first buffer.

[0079] The first cache can be the processor's RAM, or off-chip SRAM / DDR, etc. Taking RAM as an example, data packets received through the first bus are stored in the first cache, and the corresponding first cache address is obtained.

[0080] Step S502: Based on the first cache address corresponding to the data packet, read the configuration data in the data packet in sequence. The configuration data is arranged in a preset configuration order.

[0081] Based on the first cache address, the configuration data is read sequentially according to the order of the configuration data in the data packet, and the configuration data is sent to the motor controller in that order.

[0082] Through the above steps S501 to S502, the storage location and reading method of the data packet are determined by storing the data packet in the first buffer; the configuration data in the data packet is read sequentially based on the first buffer address corresponding to the data packet, thus determining the reading and sending order of the configuration data in the same data packet and avoiding configuration errors of the motor controller.

[0083] In some embodiments, the specific process involves buffering and reading the register data after receiving it via the second bus. Figure 6 This is a flowchart of the register data caching and reading process in this embodiment, as follows: Figure 6 As shown, the process includes the following steps:

[0084] Step S601: Store the register data into the second buffer in the order of reception time.

[0085] The second cache can be the processor's FIFO register, which follows a first-in-first-out rule and is read sequentially according to the time order in which data is received and stored in the register.

[0086] Step S602: Read the register data sequentially based on the receiving time order.

[0087] Based on the receiving time, the order of the register data is determined, and the configuration data is read sequentially according to this order, and then sent to the motor controller in this order.

[0088] Through the above steps S601 to S602, the storage location of the register data is determined by storing the register data in the second buffer; the order of reading and sending the register data is determined by reading the register data sequentially based on the receiving time order, thus avoiding configuration errors of the motor controller.

[0089] In some embodiments, the register data may further include address mapping data. Address mapping data refers to the register data's address segment not being used to specify a register in the motor controller and perform some operation, but rather to map to an address space in the processor's RAM. After receiving the address mapping data via the second bus, the corresponding first cache address in RAM is determined based on the value stored in the address segment of the address mapping data. The corresponding configuration data is then retrieved based on this first cache address and sent to the motor controller. For example, assuming there are 1024 available addresses in the register data's address segment, some addresses can be pre-specified for address mapping. For instance, address 0000_A008 can be pre-specified to read the motor zeroing configuration data block from the data packet stored in the processor's RAM, and the configuration data in this block can be sequentially sent to the motor driver. When the register data is read and the address segment is found to be 0000_A008, the corresponding first cache address, i.e., the storage address of the motor zeroing configuration data, is found, and the configuration data is then sequentially read and sent to the motor controller.

[0090] The motor control method in this embodiment provides a flexible way of motor control by finding the corresponding first cache address in the cache through address mapping of register data, finding the corresponding configuration data according to the first cache address and sending it down in sequence. It completes the configuration of the running parameters corresponding to the data block function with only one register data, thus improving the efficiency and flexibility of motor configuration.

[0091] In some embodiments, a motor control process is involved in the case of motor restart, which includes the following steps:

[0092] Step S21: Determine whether the motor corresponding to the motor controller needs to be restarted.

[0093] Restart refers to the restart of a motor or the entire motor control system after a power outage, including restarts that occur unexpectedly or during normal processes. In the event of a power outage restart, it is necessary to re-initialize the motor controller and reconfigure the motor, including zeroing. The decision to restart the motor can be determined based on the status signals of the motor controller.

[0094] Step S22: If the motor restarts, receive the data packet and register data again, and resend the data packet and register data to the motor controller.

[0095] The motor control method in this embodiment improves the completeness of the motor control process by determining whether the motor has restarted and, if the motor has restarted, re-receiving and sending data packets and register data to the motor controller.

[0096] In some embodiments, a process for updating and reconfiguring motor operating parameters is also involved. After data packets and register data are sent to the motor controller sequentially based on the transmission order, the process includes the following steps:

[0097] Step S31: Based on the real-time control requirements of the motor controller, receive update data packets and / or update register data, wherein the update data packets are obtained by modifying the data packets; and the update register data are obtained by modifying the register data.

[0098] In practical applications, operators can edit and issue updated configuration data via a host computer at any time according to real-time control requirements. Depending on the content of the control requirement, the data can be issued via data packets, registers, or a combination of both. For example, all configuration data for the entire motor configuration process can be issued via data packets, and then a specific data block within the data packet can be selected for configuration via register data. The configuration data in data packets and registers can be obtained by modifying existing configuration data in the original data packets and registers. For example, modifying the motor rotation direction or the motor's operating current value in the original configuration data.

[0099] Step S32: Send the update data packet and / or the update register data to the motor controller.

[0100] The system receives update data packets sent by the host computer via the first bus, and update register data sent by the host computer via the second bus. The update data packets and / or update register data are then sent to the motor controller according to the motor control method described in the above embodiment to complete the data reconfiguration.

[0101] Through the above steps S31 to S32, based on the real-time control requirements of the motor controller, update data packets and / or update register data are received and sent to the motor controller, thereby meeting the user's real-time control requirements for the motor and improving the efficiency and timeliness of motor configuration.

[0102] In some embodiments, the specific process of acquiring motor status data and transmitting it to a host computer for display is also involved. Figure 7 This is a flowchart of the reverse transmission of motor status data in this embodiment, as follows: Figure 7 As shown, the process includes the following steps:

[0103] Step S701: Receive status data sent by the motor controller.

[0104] Status data can include the voltage or current values ​​of the motor controller, the position and direction of motor rotation, etc. The register addresses of the motor controller can be pre-specified, and the status data can be stored in the corresponding registers. When status data needs to be read, a read signal is sent to the motor controller, and the system receives the status data uploaded by the motor controller line by line.

[0105] Step S702: Based on the status data, generate the corresponding data packet and register data.

[0106] The received status data is sent to the first and second caches respectively, or individually to either cache. The sending order is not restricted. The first cache can be the processor's RAM, or off-chip SRAM, DDR, or other storage resources. The second cache can be the processor's FIFO register. In the first cache, multiple status data entries are encapsulated into data packets according to a predefined data packet format; in the second cache, the status data is stored sequentially according to the time order of receipt, generating register data.

[0107] Step S703: Send the data packet to the host computer based on the first bus.

[0108] Based on the communication unit in the processor used for bus transmission, the data packet consisting of this status data can be sent to the host computer at once through the first bus. The host computer displays the status data in the corresponding area for the operator to use as reference data for motor control.

[0109] Step S704: Based on the second bus, send the register data to the host computer.

[0110] Based on the communication unit, register data is sent to the host computer via the second bus. The host computer updates the status data and displays it according to the register data.

[0111] Steps S703 and S704 can be interchanged.

[0112] Through the above steps S701 to S704, the real-time operating status of the motor controller is obtained by receiving the status data sent by the motor controller; based on the status data, corresponding data packets and register data are generated, and the status data is converted into data packets and register data according to the data format corresponding to the first bus and the second bus for subsequent transmission; based on the first bus and the second bus, the data packets and register data are sent to the host computer respectively to complete the transmission and display of status data, providing an operational reference for the operator.

[0113] The present embodiment will now be described and illustrated through preferred embodiments.

[0114] Figure 8This is a flowchart of the motor control method according to a preferred embodiment. In this preferred embodiment, the motor is a stepper motor, the processor is an FPGA, and the motor controller is a stepper motor control chip. The first bus is an AXI4-MM bus, and the second bus is an AXI4-Lite bus. The first cache is the FPGA's RAM, and the second cache is the FPGA's FIFO register. Figure 8 As shown, the process includes the following steps:

[0115] Step S801: Power on and initialize the motor control system;

[0116] Step S802: Receive data packets based on the AXI4-MM bus. These data packets are used to complete the entire control process of the motor.

[0117] Step S803: Parse the data packet according to the AXI4-MM bus protocol and store the data packet in RAM. The data packet in RAM can be updated in real time and reconfigured.

[0118] Step S804: Based on the RAM address corresponding to the data packet, read the configuration data in the data packet sequentially. The configuration data is arranged in a preset configuration order. After a configuration data is completed on the stepper motor control chip, the next configuration data is read.

[0119] Step S805: Receive register data based on the AXI4-Lite bus. This register data is used to configure the operating parameters of the motor controller.

[0120] Step S806: Parse the register data according to the AXI4-Lite bus protocol and store it into the FIFO register in the order of reception time. The register data in the FIFO can be updated in real time and reconfigured.

[0121] Step S807: Based on the first-in-first-out rule, read the register data sequentially. After one set of configuration data completes the configuration of the stepper motor control chip, the next set of configuration data is read.

[0122] The order of steps S802-S804 and steps S805-S807 can be interchanged.

[0123] Step S808: When there is data to be sent in both RAM and FIFO, arbitration is performed according to the first preset priority of data packets and the second preset priority of register data to determine the sending order of data packets and register data.

[0124] Step S809: Based on the sending order, data packets and register data are sent to the stepper motor control chip in sequence to complete the configuration;

[0125] Step S810: Receive status data sent by the stepper motor control chip;

[0126] Step S811: Based on the status data, generate the corresponding status data packet and status register data;

[0127] Step S812: Send the status data packet to the host computer based on the AXI4-MM bus;

[0128] Step S813: Send the status register data to the host computer based on the AXI4-Lite bus;

[0129] The order of steps S812 and S813 can be reversed.

[0130] Step S814: Determine whether the motor corresponding to the stepper motor control chip has restarted; if the motor has restarted, repeat steps S801 to S813.

[0131] Through steps S801 to S814, configuration data packets and register data are received via the AXI4-MM bus and AXI4-Lite bus respectively, and real-time updates and repeated configurations are performed, enriching the parameter configuration methods and improving the flexibility and efficiency of parameter configuration. By determining the sending order based on the priority of the data packets and register data, the problem of configuration failure caused by configuring in the wrong order is avoided. By sending the data packets and register data to the motor controller sequentially based on the sending order, flexible, efficient, and orderly reception and distribution of configuration data are achieved, solving the problems of poor flexibility and low efficiency in distributing configuration data from the FPGA to the motor control chip. By encapsulating the status data of the stepper motor control chip into data packets and register data and sending them to the host computer, the transmission and display of motor status data are realized, providing operational reference for operators.

[0132] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0133] In some embodiments, this application also provides a motor control device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that implement a predetermined function.

[0134] In some embodiments, Figure 9 This is a structural block diagram of the motor control device in this embodiment, as shown below. Figure 9 As shown, the motor control device includes:

[0135] The first receiving module 91 is used to receive data packets based on the first bus, which are used to configure the operating parameters of the motor controller;

[0136] The second receiving module 92 is used to receive register data based on the second bus, which is used to configure the operating parameters of the motor controller;

[0137] Module 93 is used to determine the transmission order of data packets and register data;

[0138] The sending module 94 is used to send data packets and register data to the motor controller in sequence based on the sending order.

[0139] The motor control device provided in this embodiment receives data packets via a first receiving module 91 based on a first bus. These data packets are used to configure the operating parameters of the motor controller, achieving overall reception of configuration data packets generated according to the motor configuration process and improving data reception efficiency. It also receives register data via a second receiving module 92 based on a second bus. This register data is used to configure the operating parameters of the motor controller, enabling real-time reception of each motor configuration data item. This allows for timely acquisition of updated configuration data when the user modifies the configuration data in real time according to control requirements. A determining module 93 determines the sending order of the data packets and register data based on the reception time and data configuration requirements, avoiding configuration failures caused by incorrect order configuration. Finally, a sending module 94 sequentially sends the data packets and register data to the motor controller based on the sending order, achieving flexible, efficient, and orderly reception and distribution of configuration data. This solves the problems of poor flexibility and low efficiency in distributing configuration data from the FPGA to the motor control chip.

[0140] In some embodiments, the determining module includes a determining submodule, which is used to determine the transmission order based on a first preset priority of the data packet and a second preset priority of the register data.

[0141] The motor control device provided in this embodiment determines the sending order of data packets and register data based on priority by determining the submodule, thus avoiding the problem of configuration failure caused by incorrect configuration order.

[0142] In some embodiments, the motor control device further includes a first storage module and a first reading module. The first storage module is used to store data packets into a first cache. The first reading module is used to read configuration data in the data packets sequentially based on the first cache address corresponding to the data packets. The configuration data is arranged in a preset configuration order.

[0143] The motor control device provided in this embodiment stores data packets into a first cache through a first storage module to determine the storage location and reading method of the data packets; and reads the configuration data in the data packets sequentially based on the first cache address corresponding to the data packets through a first reading module, thereby determining the reading and sending order of the configuration data in the same data packet and avoiding configuration errors of the motor controller.

[0144] In some embodiments, the motor control device further includes a second storage module and a second reading module. The second storage module is used to store register data into a second buffer sequentially according to the receiving time order; the second reading module is used to read register data sequentially based on the receiving time order.

[0145] The motor control device provided in this embodiment stores register data into a second buffer through a second storage module to determine the storage location of the register data; and reads the register data sequentially based on the receiving time order through a second reading module to determine the reading and sending order of the register data, thereby avoiding configuration errors of the motor controller.

[0146] In some embodiments, the motor control device further includes a restart determination module and a restart transmission module. The restart determination module is used to determine whether the motor corresponding to the motor controller has restarted. The restart transmission module is used to receive data packets and register data again and resend the data packets and register data to the motor controller when the motor restarts.

[0147] The motor control device provided in this embodiment determines whether the motor has restarted by using a restart determination module; and re-receives and sends data packets and register data to the motor controller by using a restart transmission module when the motor has restarted, thus providing a way to reconfigure operating parameters when the motor has restarted and improving the completeness of the motor control process.

[0148] In some embodiments, the motor control device further includes an update receiving module and an update sending module. The update receiving module is used to receive update data packets and / or update register data based on the real-time control requirements of the motor controller. The update data packets are obtained by modifying the data packets, and the update register data are obtained by modifying the register data. The update sending module is used to send the update data packets and / or update register data to the motor controller.

[0149] The motor control device provided in this embodiment, through an update receiving module and an update sending module, receives update data packets and / or update register data and sends them to the motor controller based on the real-time control requirements of the motor controller, thereby meeting the user's real-time control requirements for the motor and improving the efficiency and timeliness of motor configuration.

[0150] In some embodiments, the motor control device further includes a third receiving module, a generating module, a first sending module, and a second sending module; the third receiving module is used to receive status data sent by the motor controller; the generating module is used to generate corresponding data packets and register data based on the status data; the first sending module is used to send the data packets to the host computer based on the first bus; and the second sending module is used to send the register data to the host computer based on the second bus.

[0151] The motor control device provided in this embodiment receives status data sent by the motor controller through a third receiving module to obtain the real-time operating status of the motor controller; based on the status data, a generation module generates corresponding data packets and register data, converting the status data into data packets and register data according to the data formats corresponding to the first bus and the second bus for subsequent transmission; through a first sending module and a second sending module, the data packets and register data are sent to the host computer based on the first bus and the second bus respectively, completing the transmission and display of status data and providing operational reference for operators.

[0152] In some embodiments, this application also provides a motor control system, which includes a motor controller for controlling the operation of a motor, a host computer for inputting and sending data packets and register data, and a processor for executing the motor control method provided in the above embodiments, receiving data packets based on a first bus, receiving register data based on a second bus, and configuring the motor controller based on the data packets and register data.

[0153] The motor control system provided in this embodiment allows users to edit and input configuration data of motor operating parameters via a host computer. Based on control requirements, the system selects the method for sending configuration data, sending data packets via a first bus and / or register data via a second bus. This achieves a hybrid approach of receiving configuration data packets as a whole and receiving them in real-time, improving the flexibility and efficiency of data configuration. Furthermore, it enhances the convenience and real-time performance of data configuration when users modify configuration data in real-time according to control needs. The processor receives data packets and register data and determines the sending order, avoiding configuration failures caused by incorrect order configuration. Finally, the motor controller receives configuration data from the data packets and register data and performs corresponding configurations, further improving the efficiency and flexibility of motor control.

[0154] Furthermore, in conjunction with the motor control methods provided in the above embodiments, this embodiment can also provide a storage medium for implementation. The storage medium stores a computer program; when executed by a processor, the computer program implements any of the motor control methods described in the above embodiments.

[0155] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0156] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0157] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0158] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0159] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A motor control method, characterized in that, The method includes: Data packets are received via the first bus. These data packets are used to configure all operating parameters of the motor controller, and the configuration data in the data packets is arranged in the order required for configuring the operating parameters of the motor controller. Data is received from the register via the second bus, and the register data is used to configure a certain operating parameter of the motor controller. Determine the transmission order of the data packets and the register data; The data packets and register data are sent to the motor controller in sequence according to the sending order.

2. The method according to claim 1, characterized in that, Determining the transmission order of the data packet and the register data includes: The transmission order is determined based on the first preset priority of the data packet and the second preset priority of the register data.

3. The method according to claim 2, characterized in that, After receiving the data packet based on the first bus, the method further includes: Store the data packet in the first cache; Based on the first cache address corresponding to the data packet, the configuration data in the data packet is read sequentially, and the configuration data is arranged in a preset configuration order.

4. The method according to claim 2, characterized in that, After receiving register data based on the second bus, the method further includes: The register data is stored sequentially into the second buffer according to the receiving time order; Based on the received time sequence, the register data is read sequentially.

5. The method according to claim 1, characterized in that, The operating parameters of the motor controller include at least one of the following: the initialization parameters of the motor controller, the zero-finding configuration parameters of the motor corresponding to the motor controller, and the normal operation configuration parameters of the motor corresponding to the motor controller.

6. The method according to claim 1, characterized in that, After the data packet and the register data are sent to the motor controller sequentially based on the sending order, the method further includes: Determine whether the motor corresponding to the motor controller needs to be restarted; In the event of a motor restart, the data packet and the register data are received again, and the data packet and the register data are resent to the motor controller.

7. The method according to claim 1, characterized in that, After the data packet and the register data are sent to the motor controller sequentially based on the sending order, the method further includes: Based on the real-time control requirements of the motor controller, update data packets and / or update register data are received, wherein the update data packets are obtained by modifying the data packets; and the update register data are obtained by modifying the register data. The update data packet and / or the update register data are sent to the motor controller.

8. The method according to claim 1, characterized in that, The method further includes: Receive status data sent by the motor controller; Based on the state data, generate the corresponding data packet and register data; Based on the first bus, the data packet is sent to the host computer; and / or Based on the second bus, the register data is sent to the host computer.

9. A motor control device, characterized in that, The device includes: The first receiving module is used to receive data packets based on the first bus. The data packets are used to configure all operating parameters of the motor controller. The configuration data in the data packets are arranged in the order required by the motor controller to configure the operating parameters. The second receiving module is used to receive register data based on the second bus, and the register data is used to configure a certain operating parameter of the motor controller; The determining module is used to determine the transmission order of the data packet and the register data; The sending module is used to send the data packet and the register data to the motor controller in sequence according to the sending order.

10. A motor control system, characterized in that, The motor control system includes a motor controller for controlling motor operation, a host computer for inputting and sending data packets and register data, and a processor for executing the motor control method as described in any one of claims 1 to 7, receiving the data packets based on a first bus, receiving the register data based on a second bus, and configuring the motor controller based on the data packets and the register data.

Citation Information

Patent Citations

  • Control system and control method of multiple paths of motors, and self-service financial equipment

    CN107493041A

  • Shared MAC realizing method based on multi-core processor and FPGA and method

    CN109412897A

  • Universal synchronous transceiving bus steering engine

    CN209707953U