Built from SimpleFOCStudio By JorgeMaker.
Adapted from SimpleFOCStudio
Graphical user interface for the SimpleFOClibrary. This application allows to tune and configure any BLDC/Stepper SimpleFOClibrary controlled device, using serial port communications.
Adapted from SimpleFOCStudio
- Plug and play with the SimpleFOClibrary version 2.1
- Real-time tuning and configuration of the motors
- Real-time plotting and monitoring of motor variables
- Code generation for easier integration of the tuned parameters in your code
- Built with web based frontend
Instruction adapted from SimpleFOCStudio
- Install Python if you don't have it installed yet
- Install Anaconda
- Once you have your Anaconda running open your terminal (on windows anaconda prompt) and run:
conda env create --name simplefoc -f environment.yml
- Once this is done you will never have to run that command again, from now on you will just need:
conda activate simplefoc
- Clone this repository or download the zip file
- Enter the folder containing the repository using the terminal
- the command will be something like this:
cd some_path_on_disk/SimpleFOCWebUI
python -m 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 SimpleFOCWebUI directory and run the command:
python simpleFOCWebUI.py
Or if using Anaconda:
conda activate simplefoc
python simpleFOCWebUI.py
Like SimpleFOCStudio, you will need to run the corresponding serial interface.
Basically there are two things you need to do:
- Use the commander interface and add the motor to the commander
- Use the monitoring and add the
motor.monitor()
in the loop
Here 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();
}
- Compatibility with SimpleFOCStudio
- Custom Commands. (Besides serial terminal)
- Zero Sensor (Offset / Electrical) Doesn't work just yet.
- Recover nicely on unexpected device / backend disconnect.
- Fix random bugs. Sync any missing parameters which needs to be synced.
- More device introspection / controls. (ie. Did FOC init work?)
- Separated python scripting library
- Version with web serial so no need for python backend??
- Clean up code (Use Class, Not have random config formats everywhere.)
- Make it more usable on multiple devices at once.
- Make the UI responsive and support other viewport sizes such as phones.