Motor control algorithms are the core technology of products such as balance bikes,sweeping robots,robotic arms,etc.,which relate to all aspects from life to national defense.Common motor control methods are implemented using a general-purpose microprocessor to run the software form.This approach has two drawbacks: first,motor performance is limited by the speed of the microprocessor,which is generally slow in execution;second,because it is a general-purpose microprocessor,power consumption is usually high.This paper solves this problem by customizing the microprocessor and hardwareizing the control algorithm.The main work of this paper is as follows.(1)Combining the instruction set architecture of RISC-V,MSP430 and other chips,we propose our own 16-bit instruction set architecture and implement this 16-bit processor on FPGA development board using Verilog HDL.This paper also adds GPIO,serial port,general-purpose SPI and timer peripherals,and reserves interfaces for other peripherals on the bus.(2)In this paper,each module of the FOC motor control algorithm is implemented in hardware using Verilog HDL language and each module is tested separately and the test data is compared with the FOC algorithm module implemented in Python.(3)The bus interface in the MCU implemented in this paper is added to the FOC algorithm,and the FOC algorithm module is integrated with the 16-bit processor in the same system,and the system is co-simulated with Simulink to verify the effectiveness of the system.This work is verified by combining the DE10-Standard FPGA development board and the SPIFlash chip board.Experiments show that in the same FPGA device,the 16-bit processor implemented in this paper takes up about 11.4% of the logic resources of the open source RISC-V chip Hummingbird E203 and uses about 11.1% of the registers of Hummingbird E203,which means lower power consumption.In terms of implementing the control FOC algorithm module,only 8 instructions are required to perform FOC operations,reducing the number of instructions required for complex operations and enabling the FOC algorithm to run at a higher frequency. |