電機驅動SimpleFOC的調試界面SimpleFOCStudio的安裝制作
電機驅動SimpleFOC的調試界面軟件SimpleFOCStudio是個開源的Python工具,目前不支持最新版本的Python 3.11, 需要低版本的3.9才能順利安裝,為方便不熟悉Python的小伙伴使用,特制作了一個安裝包,直接解壓或者安裝即可使用。
下載地址:
https://gitee.com/thomasyuangq/simple-focstudio-installer

安裝包使用Pyinstaller制作:
pyinstaller -w simpleFOCStudio.py --add-data “.\src\gui\resources\.;.\src\gui\resources”
需要使用–add-data 參數(shù)將軟件的工具條圖標添加到安裝包中。
EXE版本的安裝程序用inno setup工具打包。

?
手工安裝方法:
下載Python 3.9版本
運行:
pip install -r "requirements.txt"
python simpleFOCStudio.py
使用SimpleFOCStudio,需要在代碼中加入下面這些指令:
#include <SimpleFOC.h>
....
// include commander interface
Commander command = Commander(Serial);
void doMotor(char* cmd) { command.motor(&motor, cmd); }
void setup(){
? ....
? // add the motor to the commander interface
? // The letter (here 'M') you will provide to the SimpleFOCStudio
? command.add('M',doMotor,'motor');
? // tell the motor to use the monitoring
? motor.useMonitoring(Serial);
? motor.monitor_downsample = 0; // disable monitor at first - optional
? ...
}
void loop(){
? ....
? ....
? // real-time monitoring calls
? motor.monitor();
? // real-time commander calls
? command.run();
}
軟件界面如下:
