一、前期准备
(1)Windows系统的计算机; (2)EPOS Studio (本次测试版本为3.6):下载地址EPOS Studio 3.6 (3)MATLAB(本次测试版本为2018a); (4)C++ 编译器:下载地址MATLAB Support for MinGW-w64 C/C++ Compiler,下载后的文件为mingw.mlpkginstall,将文件拖动到MATLAB命令行窗口即可安装。
二、下载源程序
从Github下载程序,链接Original Version for EPOS 2 (Unmodified)
创建文件夹 Epos2Windows
将EPOS Studio的安装目录下的文件复制到文件夹 Epos2Windows:从“D:\Program Files (x86)\maxon motor ag\EPOS IDX\EPOS2\04 Programming\Windows DLL\Microsoft Visual C++\Example VC++” 里选择这7个文件复制:
Definitions.hEposCmd.dllEposCmd.libEposCmd64.dllEposCmd64.libvxlapi.dllvxlapi64.dll三、MATLAB调试
在MATLAB里打开程序:
打开文件夹 Epos2Windows里的Definitions.h,将地39行到61行的extern "C"都删掉。原因可参考https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab
打开Clean.m运行; 打开Make.m运行。
【附录】参考资料链接 (1)https://github.com/IordanisKostelidis/EPOS4MATLAB (2)https://github.com/IordanisKostelidis/EPOS4MATLAB/releases/tag/1 (3)https://www.mathworks.com/matlabcentral/fileexchange/53735-commanding-maxon-motors-epos2-motor-controller-from-matlab (4)https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c-compiler