Graphical user interface for the SimpleFOClibrary. This application allows to tune and configure any BLDC/Stepper SimpleFOClibrary controlled device, using serial port communications and the Commander interface.
SimpleFOCConnector
interface that can be used as a gateway form python to the SimpleFOClibrary device.
Don't worry, SimpleFOCStudio is easy to install even if you have never used the terminal before! 😃 There are just couple of steps to take:
conda create -n simplefoc python=3.6.0
conda activate simplefoc
cd some_path_on_disk/SimpleFOCStudio
pip install -r "requirements.txt"
Once you have done all the steps above you do not need to repeat them any more. All you need to do the next time is open your terminal in the SimpleFOCStudio directory and run the command:
python simpleFOCStudio.py
Or if using Anaconda:
conda activate simplefoc
python simpleFOCStudio.py
SimpleFOCStudio has several useful features:
Once you have your application running add a device by clicking the motor button in the toolbar. You can choose either the TreeView or the FormView.
M
M
, Arduino code : command.add('M',doMotor,"my motor")
A
, Arduino code : command.add('A',doMotor,"my motor")
SimpleFOCStudio helps you to easier transfer your carefully tuned parameters to the Arduino code. Once you are happy with the performance of your system you can automatically generate the arduino code of the parameters you have tuned. To generate the code :
The generated code you can just copy/paste in your setup()
function, just before calling the motor.init()
You can create your own custom commands if you extend the Commnader interface in your sketch. This can be used for example to do things like change register settings for SPI devicesor any oyher functionality. Each custom command has a name and a value as you can see at the below image.
Once you have added each custom command in order to execute it you just need to select it and once selected press the space key (⎵) or right arrow key (→).
SimpleFOCStudio also has integrated serial terminal for easier debugging and monitoring.
Basically there are two things you need to do:
motor.monitor()
in the loopHere is a mockup of the code:
#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();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。