Motor controller
By employing Hyperbus bus and FPGA module virtual storage devices in the motor controller, the problems of complex structure and high cost in the prior art are solved, and the data throughput and transmission rate are improved, thus meeting the real-time requirements of the motor controller.
Patent Information
- Application Number
- CN202411030523.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
AI Technical Summary
In existing motor controllers, the main control module and storage devices are connected via a parallel bus, resulting in a complex structure, high manufacturing cost, and low communication data throughput, making it difficult to meet high-speed communication requirements.
The Hyperbus bus is used instead of the parallel bus, and the storage devices are virtualized through the FPGA module, which reduces the number of pins, improves data throughput and transmission rate, and eliminates the need for additional dedicated peripherals.
It reduces the structural complexity and manufacturing cost of the motor controller, improves data transmission efficiency, meets the real-time requirements of the current loop and speed loop, and enhances the motor control efficiency.
Smart Images

Figure CN118971726A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of industrial control technology, and in particular, to a motor controller. Background Art
[0002] Motor controllers are programmable electronic devices used to control the motion and position of mechanical systems to achieve mechanical automation and control. Motor controllers, when used in conjunction with motion control software, can regulate motors to achieve position movement of robots, CNC machine tools, and other automated equipment, or precisely control them to perform various tasks.
[0003] In existing solutions, the main control module MCU in the motor controller is often connected to the storage device through a parallel bus. At the same time, the parallel bus needs to be configured with special peripherals (such as dedicated storage chips) to be used, which makes the structure of the motor controller complex and the manufacturing cost high. Summary of the invention
[0004] The embodiment of the present application provides a motor controller, which uses the Hyperbus bus to replace the parallel port bus, and does not require additional configuration of dedicated peripherals for the bus. A storage device that can successfully communicate with a main control module can be virtualized through FPGA, thereby saving resource investment in the motor controller and reducing costs and increasing efficiency.
[0005] A first aspect of an embodiment of the present application provides a motor controller, comprising: a main control module and an FPGA module;
[0006] The interface hardware of the main control module is connected to the interface module of the FPGA module via a Hyperbus bus;
[0007] The main control module is used to configure the Hyperbus protocol parameters supported by the interface hardware; the interface module follows the Hyperbus protocol parameters to enable the FPGA module and the main control module to communicate.
[0008] Optionally, various devices inside the FPGA module are connected using parallel data lines.
[0009] Optionally, the difference in differential clock delay between at least some devices in the FPGA module is smaller than a preset differential clock period.
[0010] Optionally, the Hyperbus protocol parameters include at least one parameter of differential clock frequency, sampling mode, fixed delay clock number, fixed delay multiple, burst mode, and burst length.
[0011] Optionally, the Hyperbus protocol parameter includes at least one of the following parameter values:
[0012] The differential clock frequency is 50MHz, the sampling mode is double-edge sampling, the fixed delay clock number is 4, the fixed delay multiple is 2, the burst mode is linear burst, and the burst length is 128 bytes.
[0013] Optionally, the main control module is used to parse and generate control instructions according to an external input control signal;
[0014] The FPGA module is used to receive and process the control instructions through the Hyperbus bus to obtain corresponding drive signals, and transmit the drive signals to the connected motor drive unit to drive the motor to work through the motor drive unit.
[0015] Optionally, the FPGA module is used to:
[0016] Generate chip select signal according to internal logic circuit and received operation instruction;
[0017] A storage device connected to the Hyperbus is selected by pulling down the chip select signal, and the following read operation and / or write operation is triggered: the target data corresponding to the operation instruction is read from the storage device to the Hyperbus, and / or the data on the Hyperbus is written to the storage device;
[0018] Until the counting is completed, the FPGA module ends the read operation and / or write operation by pulling up the chip select signal.
[0019] Optionally, the FPGA module is associated with a storage device;
[0020] The storage device is used to receive a read protection signal and / or a write protection signal transmitted by the main control module via the Hyperbus bus and the interface module; the read protection signal and / or the write protection signal are used to limit that unauthorized read operations and / or write operations cannot read and / or write data in the storage device.
[0021] Optionally, the interface module is a simple slave interface module that complies with factory design specifications of a Hyperbus bus interface.
[0022] Optionally, when the interface module is a complete slave interface module different from a simple slave interface module, the Hyperbus is used for:
[0023] The Hyperbus protocol parameters are transmitted to the interface module, so that the FPGA module changes the factory design specification of the simple slave interface module based on the Hyperbus protocol parameters to obtain the complete slave interface module;
[0024] The complete slave interface module is superior to the simple slave interface module in at least the aspect of transmission rate and / or the type of data allowed to be transmitted.
[0025] It can be seen from the above technical solutions that the embodiments of the present application have at least the following advantages:
[0026] The embodiment of the present application uses the Hyperbus bus instead of the parallel bus, which can reduce the number of pins configured by the main control module due to bus requirements. At the same time, it can improve the data throughput and transmission rate, meet the requirements for the real-time performance of the current loop and speed loop on the motor controller, and speed up the efficiency of motor control. In addition, by using the FPGA module, a storage device that can successfully communicate with the main control module can be virtualized, without the need to configure additional dedicated peripherals for the bus, reducing the structural complexity and manufacturing cost of the motor controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0028] It should be noted that, although the steps in the process diagrams (if any) involved in the embodiments are drawn in sequence as indicated by the arrows, unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0029] Figure 1 A schematic diagram of the structure of a motor controller according to an embodiment of the present application;
[0030] Figure 2 Another structural schematic diagram of the motor controller according to the embodiment of the present application;
[0031] Figure 3 A schematic diagram of a read and / or write operation flow of a motor controller according to an embodiment of the present application;
[0032] Figure 4 Another structural diagram of the motor controller according to the embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0034] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims and drawings of the present application 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 interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that 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.
[0035] In the following description, similar expressions such as "a specific implementation" or "a specific example" are involved, which describe a subset of all possible embodiments, but it can be understood that "a specific implementation" or "a specific example" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. In the following description, the term multiple refers to at least two. In some specific examples, the numerical value mentioned in this application reaches the threshold value (if any), which may include the case where the former is greater than the latter of the threshold value; if similar expressions such as "any" or "at least one" are mentioned, it can specifically refer to any one of the listed examples or any combination of these examples.
[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0037] The present application will be described in further detail below.
[0038] See also Figure 1 An embodiment of the present application provides a motor controller, including: a main control module and an FPGA module; the interface hardware of the main control module is connected to the interface module of the FPGA module through a Hyperbus bus; wherein the main control module is used to configure the Hyperbus bus protocol parameters supported by the interface hardware; the interface module follows the Hyperbus bus protocol parameters to enable the FPGA module and the main control module to communicate.
[0039] Specifically, the motor controller can be a motion controller or a drive-control integrated machine that integrates a motion controller and a driver. The interface hardware can be xSPI hardware or OctoSPI or other ports that support the Hyperbus bus protocol. Taking xSPI hardware as an example, the communication architecture between the main control module (or MCU) and the FPGA module of the embodiment of the present application is: xSPI hardware - Hyperbus bus - Hyperbus interface module in FPGA.
[0040] In the existing scheme, the MCU and the storage device in the motor controller are often connected through the parallel bus, which results in a large number of pins required inside the motor controller, and a low data throughput during communication (such as less than 200Mbps), which is difficult to meet the high-speed communication requirements. In view of this, the embodiment of the present application proposes to use the Hyperbus bus instead of the parallel bus, and virtualize the FPGA module into a HyperRAM storage device of the HyperBus bus to communicate with the MCU, so as to reduce the number of pins configured by the main control module due to bus requirements. At the same time, it helps to improve the data throughput and transmission rate, meet the requirements for the real-time improvement of the current loop and speed loop on the motor controller, and speed up the control efficiency of the motor.
[0041] Taking HyperRAM memory devices as an example, the following explains why FPGA can be selected to replace the HyperRAM memory devices in the existing motor controller. FPGA is not a HyperRAM memory device, but the inventors have found that FPGA can just implement a slave that supports the Hyperbus bus, that is, the interface module of the embodiment of the present application, and FPGA can be virtualized into a HyperRAM device. It can be understood that FPGA can be virtualized into a HyperRAM memory device that supports the Hyperbus bus, so there is no need to configure additional dedicated peripherals for the bus to implement the motor controller, for example, there is no need for a dedicated memory chip with a specific Hyperbus interface design, thereby reducing the structural complexity and manufacturing cost of the motor controller; in addition, the use of FPGA can also implement other functional modules, which is economical and practical.
[0042] Based on the above example descriptions, some specific possible implementation examples will be provided below. In actual applications, the implementation contents between these examples can be combined or implemented separately as needed according to the corresponding functional principles and application logic. If implemented in combination, the execution order between the combined examples can be determined according to their respective processing logics, which can be determined by the actual scenario.
[0043] based on Figure 1 In some specific examples, the devices inside the FPGA module are connected by parallel data lines. Figure 2As shown, in order to meet the needs of high-speed data processing, parallel data lines can be used to connect the registers, RAM memory, input / output (I / O) modules and interface modules in the FPGA module, which can be understood as parallel wiring or source synchronization design on the FPGA side. Because compared to serial transmission, parallel data lines allow the FPGA to process multiple data bits at the same time, which allows parallel transmission to complete the parallel transmission of a large amount of data in a shorter time, thereby significantly improving the data transmission throughput, reducing the time required for data transmission, and improving the data response speed. In addition, parallel wiring helps to reduce the coupling effect between data lines, facilitates the rapid location and troubleshooting of faulty data lines, and improves the operation and maintenance efficiency of the motor controller.
[0044] Of course, the FPGA module can also be connected to peripheral devices such as encoders and / or analog quantities, which can be set specifically as needed and are not limited in the embodiments of the present application.
[0045] based on Figure 1 In some specific examples, the differential clock delay difference between at least some devices in the FPGA module is less than the preset differential clock period. The device here can be one or more of a register, a RAM memory, an I / O module, and an interface module. The preset differential clock period can be a quarter of the differential clock period, which can be set as needed and is not limited in the embodiments of the present application. Here, setting the differential clock delay difference between devices can ensure that the data between each device is transmitted synchronously under the same time reference, avoiding timing conflicts and error events caused by clock deviations.
[0046] based on Figure 1 In some specific examples, the parameters of the Hyperbus protocol supported by the interface hardware can be configured in detail on the MCU side. The Hyperbus protocol parameters may include at least one of differential clock frequency, sampling mode, fixed delay clock number, fixed delay multiple, burst mode, and burst length.
[0047] Generally, a higher clock frequency means that more data can be transmitted per unit time, thereby improving data transmission efficiency; a reasonable sampling mode design can ensure that data can be accurately sampled and transmitted during high-speed data transmission; a fixed delay clock number and a fixed delay multiple can be used to adjust the time delay and synchronization during data transmission to ensure that data is received and processed within the correct time window; the burst mode allows the master device to efficiently read or write continuous data blocks from the slave device (such as memory); the burst length refers to the number of data transmissions contained in a burst transmission. Configuring an appropriate burst length can reduce the time overhead and delay in the transmission process while ensuring data transmission efficiency.
[0048] In an embodiment of the present application, the above-mentioned differential clock frequency can be 10MHz, 25MHz, 50MHz or 166MHz, the sampling mode can be double-edge sampling or single-edge sampling, the fixed delay clock number can be 4, 5 or 6, the fixed delay multiple can be any value from 1 to 3, the burst mode can be linear burst or wrap-around burst, the burst length can be 16byte, 64byte, 128byte or 256byte, etc., which can be selected according to needs and are not limited here.
[0049] In some specific examples, the Hyperbus bus protocol parameters of the embodiments of the present application include at least one of the following parameter values: differential clock frequency is 50MHz, sampling mode is double-edge sampling, fixed delay clock number is 4, fixed delay multiple is 2, burst mode is linear burst, and burst length is 128 bytes. Double-edge sampling is a technology that samples both before and after the edge of the clock signal, which is more suitable for scenarios with more complex timing or high precision requirements than single-edge sampling.
[0050] In some specific examples, the main control module can be used to generate control instructions based on the analysis of external input control signals; the FPGA module is used to receive and process control instructions through the Hyperbus bus to obtain corresponding drive signals, and transmit the drive signals to the connected motor drive unit to drive the motor to work through the motor drive unit.
[0051] like Figure 2 As shown, the MCU can parse and generate control instructions based on the external input control signal (such as running the motor at a certain speed), and the control instruction can be transmitted to the FPGA module through the Hyperbus bus to obtain the corresponding drive signal; this drive signal can be transmitted by the FPGA module to the connected motor drive unit (or servo drive), thereby driving the motor to run at a certain speed. This servo drive can be directly or indirectly connected to the FPGA module, and this motor can be used to control the position movement of automation equipment such as robots or CNC machine tools, or accurately control them to perform various tasks. The specific decision can be based on the actual scenario and is not limited here.
[0052] based on Figure 1In some specific examples, the read and write functions of the Hyperbus bus can be implemented in the interface module on the FPGA side. For example, the FPGA module is used to: generate a chip select signal according to the internal logic circuit and the received operation instruction; select the storage device connected to the Hyperbus bus by pulling down the chip select signal, and trigger the following read operation and / or write operation: read the target data corresponding to the operation instruction from the storage device to the Hyperbus bus, and / or write the data on the Hyperbus bus to the storage device; until the counting is completed, the FPGA module ends the read operation and / or write operation by pulling up the chip select signal.
[0053] The operation instruction received by the FPGA module may come from the MCU end, and the operation instruction may include at least one of address information, read data instruction and / or write data instruction, and data to be read and / or written. The address information may be used to indicate the device to be read and / or written. Figure 3 As shown, pulling down the chip select (CS, Chip Select) signal can, on the one hand, indicate setting the level of the CS signal to a low level state. In SPI communication, this usually means that the slave device connected to the CS signal (such as a storage device such as a register or memory) is selected or activated, and is ready to communicate with the master device (such as an MCU), that is, data transmission; on the other hand, it can indicate triggering the following read operation and / or write operation: the FPGA module reads the target data corresponding to the operation instruction from the storage device to the Hyperbus bus, and / or the FPGA module writes the data on the Hyperbus bus to the storage device (i.e., updates the storage device).
[0054] Among them, after reading the data to the interface module (or port), a selection signal can be output. The selection signal can be used to indicate when the FPGA places the read data on the bus, which can be understood as when to send data so that the MCU can read it. In addition, the end time of the read operation and / or write operation can be regulated by delay counting. For example, until the count is completed, the FPGA module ends the read operation and / or write operation by pulling up the chip select signal. Compared with pulling down the chip select signal, pulling up the chip select signal can be regarded as releasing the slave device connected to the CS signal to end the read operation and / or write operation on the slave device and stop the current data transmission process occurring through the Hyperbus bus.
[0055] In some specific examples, a protection signal can be selected to control the permissions of the data in the storage device. Specifically, the FPGA module can be associated with a storage device, such as a register and / or a memory; the storage device is used to receive a read protection signal and / or a write protection signal transmitted by the main control module via the Hyperbus bus and the interface module; the read protection signal and / or the write protection signal are used to limit that unauthorized read operations and / or write operations cannot read and / or write data in the storage device. The storage device here can be classified as a component inside or outside the FPGA module.
[0056] It can be seen that the use of the above-mentioned read protection signal and / or write protection signal can be used to control access rights and / or update rights to the storage device, such as disabling read / write, to prevent unauthorized read operations and / or write operations, thereby protecting the security and integrity of the data.
[0057] As a possible implementation method, since the MCU side can pre-set the above Hyperbus bus protocol parameters, in order to relieve the FPGA side from the configuration pressure of parameters, the FPGA side does not need to configure the protocol parameters by itself, but directly adopts the Hyperbus bus protocol parameters that are pre-set by the MCU side; this is because the necessary parameters are generally preset or hard-coded inside the FPGA, so that the interface module in this case has followed the factory design specifications (or standard specifications) of the Hyperbus bus interface, and meets the Hyperbus bus protocol requirements and specific application scenarios, such as supporting the use of the Hyperbus bus to connect and communicate with the MCU. For the sake of distinction, the interface module in this case can be called a Hyperbus simple slave interface module.
[0058] In addition, to further relieve the FPGA side of the pressure on parameter configuration, in some examples, the FPGA side does not need to control registers, and the MCU side controls the registers instead, thereby reducing the processing pressure on the FPGA.
[0059] As another possible implementation, the FPGA side can configure the protocol parameters by itself, that is, open more parameter setting permissions or ranges for the FPGA side, so that the FPGA module is more universal. For example, it is not only applicable to the set of Hyperbus bus protocol parameters pre-set by the MCU side, but also can be adapted to more sets of Hyperbus bus protocol parameters. Therefore, the interface module in this case can be called a complete slave interface module different from the simple slave interface module. For details, see Figure 4To realize a complete slave interface module, the Hyperbus bus can be used to: transmit the Hyperbus bus protocol parameters set on the MCU side to the interface module, so that the FPGA module changes the factory design specifications of the simple slave interface module based on the Hyperbus bus protocol parameters, that is, the FPGA module can set the Hyperbus bus protocol parameters separately to obtain a complete slave interface module.
[0060] Compared with the simple slave interface module, there is an additional transmission process when designing the simple slave interface module, that is, the Hyperbus bus protocol parameters set by the MCU are transmitted to the interface module through the Hyperbus bus. Compared with the simple slave interface module, the above-mentioned complete slave interface module can include all the functions of the simple slave interface module, or at least more in terms of transmission rate and / or data types allowed to be transmitted. Therefore, it can be seen that the complete slave interface module is more suitable for scenarios with higher performance requirements and complex functional requirements, such as high-speed data transmission with other devices on the Hyperbus bus, high-performance computing, etc.
[0061] It should be noted that designing and adopting a complete slave interface module requires more FPGA resources to implement, which is not conducive to reducing costs. Therefore, in actual situations, it can be decided based on specific needs whether to virtualize the FPGA into a complete slave interface module or a simple slave interface module.
[0062] In summary, the motor controller of the embodiment of the present application uses the Hyperbus bus to replace the traditional parallel bus, which saves pin resources and can increase the data throughput of communication; additional interface hardware such as xSPI hardware is used, and the interface hardware can save more resources for the MCU. Specifically, the pre-fetching function and cache function of the interface hardware can save the MCU time and other time expenses. In addition, on the FPGA side, FPGA resources can be used to virtualize a variety of slaves of the Hyperbus bus, such as developing a complete slave interface module or a simple slave interface module to meet personalized scenario requirements.
[0063] Compared to Figure 1 The examples shown illustrate that the above-mentioned additional or detailed example contents or possible implementation methods do not necessarily have to be executed during the specific implementation. If more than two examples or possible implementation methods are added, these examples or possible implementation methods can be implemented in combination or separately. If implemented in combination, the execution order between the combined examples can be determined according to their respective processing logic, which can be determined according to the actual scenario.
[0064] In the description of the embodiments of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" (if any) should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.
[0065] The above embodiments are only used to illustrate the technical solution of the present application, but not to limit it.
Claims
1. A motor controller, characterized in that: include: Main control module and FPGA module; The interface hardware of the main control module is connected to the interface module of the FPGA module via a Hyperbus bus; The main control module is used to configure the Hyperbus protocol parameters supported by the interface hardware; the interface module follows the Hyperbus protocol parameters to enable the FPGA module and the main control module to communicate.
2. The motor controller according to claim 1, characterized in that: The devices inside the FPGA module are connected by parallel data lines.
3. The motor controller according to claim 1 or 2, characterized in that: The difference in differential clock delay between at least some devices in the FPGA module is smaller than a preset differential clock period.
4. The motor controller according to claim 1 or 2, characterized in that: The Hyperbus protocol parameters include at least one parameter of differential clock frequency, sampling mode, fixed delay clock number, fixed delay multiple, burst mode, and burst length.
5. The motor controller according to claim 1 or 2, characterized in that: The Hyperbus protocol parameter includes at least one of the following parameter values: The differential clock frequency is 50MHz, the sampling mode is double-edge sampling, the fixed delay clock number is 4, the fixed delay multiple is 2, the burst mode is linear burst, and the burst length is 128 bytes.
6. The motor controller according to claim 1 or 2, characterized in that: The main control module is used to parse and generate control instructions according to the external input control signal; The FPGA module is used to receive and process the control instructions through the Hyperbus bus to obtain corresponding drive signals, and transmit the drive signals to the connected motor drive unit to drive the motor to work through the motor drive unit.
7. The motor controller according to claim 1 or 2, characterized in that: The FPGA module is used for: Generate chip select signal according to internal logic circuit and received operation instruction; A storage device connected to the Hyperbus is selected by pulling down the chip select signal, and the following read operation and / or write operation is triggered: the target data corresponding to the operation instruction is read from the storage device to the Hyperbus, and / or the data on the Hyperbus is written to the storage device; Until the counting is completed, the FPGA module ends the read operation and / or write operation by pulling up the chip select signal.
8. The motor controller according to claim 1 or 2, characterized in that: The FPGA module is associated with a storage device; The storage device is used to receive a read protection signal and / or a write protection signal transmitted by the main control module via the Hyperbus bus and the interface module; the read protection signal and / or the write protection signal are used to limit that unauthorized read operations and / or write operations cannot read and / or write data in the storage device.
9. The motor controller according to claim 1 or 2, characterized in that: The interface module is a simple slave interface module that complies with the factory design specifications of the Hyperbus bus interface.
10. The motor controller according to claim 1 or 2, characterized in that: When the interface module is a complete slave interface module different from the simple slave interface module, the Hyperbus is used for: The Hyperbus protocol parameters are transmitted to the interface module, so that the FPGA module changes the factory design specification of the simple slave interface module based on the Hyperbus protocol parameters to obtain the complete slave interface module; The complete slave interface module is superior to the simple slave interface module in at least the aspect of transmission rate and / or the type of data allowed to be transmitted.
