›› 2017, Vol. 30 ›› Issue (4): 148-.

• 论文 • 上一篇    下一篇

基于Matlab与STM32的电机控制代码自动生成

徐 捷,丁学明   

  1. (上海理工大学 光电与计算机工程学院,上海 200093)
  • 出版日期:2017-04-15 发布日期:2017-04-11
  • 作者简介:徐捷(1992-),男,硕士研究生。研究方向:电机控制等。丁学明(1971-),男,副教授,硕士生导师。研究方向:机控制等。

Embedded Coder Generation of Motor Controller Based on Matlab and STM32

XU Jie,DING Xueming   

  1. (School of OpticalElectrical and Computer Engineering, University of Shanghai for Science and Technology, Shanghai 200093, China)
  • Online:2017-04-15 Published:2017-04-11

摘要:

基于Matlab与STM32的代码自动生成方法与无刷直流电机控制系统相结合,使得控制系统的设计与实现更为方便快捷。通过对无刷直流电机控制系统进行Matlab仿真模型设计,再利用针对STM32微型控制器的Simulink库STM32 MAT/Target与相关软件工具,实现可读、可移植的C代码工程文件的自动生成,并在STM32F103上实际运行,其运行状态与仿真结果基本一致。该方法既通过Matlab的仿真对控制系统进行精确的设计,又利用其自动生成代码的特点便于控制算法的实现,两者相互结合,在保证准确性的同时加快了从设计到实现的整个过程。

关键词: STM32, Matlab, 无刷直流电机, 自动生成代码

Abstract:

Embedded coder generation based on Matlab and STM32 is combined with the BLCD control system, which makes the design and implementation of the control system more convenient and more efficient. First, a BLCD motor control system is designed and simulated by Matlab. Then, readable C code project documents are generated automatically with Simulink library STM32 MAT/Target and other software tools. Actual operation is performed on STM32F103, and the operation states agree with the simulation results. Matlab simulation offers easy designs the control system and the automatic codes generation facilitates the implementation of the control algorithm. The combination of the two speeds up the process from design to implementation with good accuracy.

Key words: STM32, Matlab, BLDC, embedded coder generation

中图分类号: 

  • TN873