I have created a GIU to configure and manage SimpleFOC devices.
Currently it only allows configuring parameters and displaying variables in real time. I plan to add more functionality as the project for which I am going to use SimpleFOC progresses.It si developed using Python.
I leave a link here in case it could be useful to someone else
WOW! Just this week we were talking about the steps to do something like this. Iām impressed with your work, thanks for sharing! Hopefully Iāll give it a try soon
@Owen_Williams was starting to experiment on a similar tool based on node/vue. Iām sure he would be very interested in checking out your work.
One question: Do you have to do something in particular on the arduino side of things? Like use motor.monitor() or something like that?
At the Arduino side I have the " Motor commands" sketch with a lsmall modification to limit the amount of data that is sent via serial port since is not needed more than 25 samples per second in order to obtain an animated plot.
The node / value approximation is the one used by the Moteus configuration application.
My intention is to use SimpleFOC to develop my own board and using STM32 as MCU and instead of communicating using the serial port create an interface based on CAN bus, which makes it easier to have several devices connected.
If my project goes as planed my intentios is to evolve the application towards something similar to what Moteus controller: an interface based on a tree view whith all detected devices and nodes/leafs to configure each device.
Iāll upload the example to the OSC examples soon.
Your GUI looks way nicer, but I like the flexibility in pD to add some ācodeā just by connecting some more boxes. Thatās what I did at the top of the screenshot there: after getting the basic set-point setting and display working, I added some controls to set the speed in RPM, m/s or move a certain distance in m (based on input wheel radius)ā¦
Itās working quite well. Note that most of the numbers displayed are actually also inputs, where you can type a new value or āscrollā the value with the mouse. The red things are āStopā buttons.
Do not hesitate to ask if you have any questions or find any problem using the application ā¦ it is an initial version and it may have some bug.
I know your project. When I started the project, the first thing I did was look for projects similar to what I wanted to achieve that already existed in order to learn from them and see what functionalities each offered. This is the list I made I made. Some of them are full opensorce, some partially and some are poorly documented
What I pretend to do is a āmixā between O-Tres, Dragor and Betzdrive. Use a STM32 as MCU, SimpleFOC for the software, and CAN to make the external control interface as well as adding an IMU which I think may be interesting for later uses of the controller. ā¦ I am just starting.
In fact I saw the part of the OSC example but I donāt have much knowledge of that language and I decided to take the idea and make a GUI in Python that I know a little bit more OSC look very interesting ā¦ if i am not wrong you could use your SimpleFOC device move a lasers in a amuses related application
In fact, my idea is to evolve this tool to a node / vaule tool, since it is friendlier when you have multiple nodes and it is more flexible when you want to make modifications on the parameters to configure in each node.
I pretend to develop a PCB to make a simpl FOC based controller with CAN interface and to be able to connect each controller to the computer to configure and sending motion commands.
This is an idea of what I intend to achieve where module (1) is the network explorer and node configurator, module (2) is a command line interface module (3) is the display area of variable graphs.
Instead of adding a tab for each SimpleFOC node it will be possible to add tabs to create other tools that take advantage of the existing configuration functionality, so anyone can create its own tool meeting their requeieriments. It is a modular and extensible tool.
@JorgeMaker - Iāve a few problems installing your tool on Ubuntu 20.04 and python 3.7.5.
Initially:
pip install -r requirements.txt
ERROR: Command errored out with exit status 1:
command: /home/williao/.pyenv/versions/3.7.5/bin/python3.7 /home/williao/.pyenv/versions/3.7.5/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpq63va3bm
This was fixed with:
pip install --upgrade pip setuptools
I then ran:
williao@williao-G3-3579:~/dev/python/SimpleFOCStudio$ python simpleFOCStudio.py
Traceback (most recent call last):
File "simpleFOCStudio.py", line 8, in <module>
from gui.mainWindow import UserInteractionMainWindow
ModuleNotFoundError: No module named 'gui'
So I tried: export PYTHONPATH=$PWD/src
which then gave:
williao@williao-G3-3579:~/dev/python/SimpleFOCStudio$ python simpleFOCStudio.py
Traceback (most recent call last):
File "simpleFOCStudio.py", line 8, in <module>
from gui.mainWindow import UserInteractionMainWindow
File "/home/williao/dev/python/SimpleFOCStudio/src/gui/mainWindow.py", line 5, in <module>
from gui.devicesTabbedWidget import DevicesTabbedWidget
File "/home/williao/dev/python/SimpleFOCStudio/src/gui/devicesTabbedWidget.py", line 5, in <module>
from gui.deviceConfigTool import DeviceConfigurationWidget
File "/home/williao/dev/python/SimpleFOCStudio/src/gui/deviceConfigTool.py", line 6, in <module>
from gui.generalSettingsWidget import GeneralSettingsGroupBox
File "/home/williao/dev/python/SimpleFOCStudio/src/gui/generalSettingsWidget.py", line 4, in <module>
from sharedcomponets import ConfigQLineEdit
ModuleNotFoundError: No module named 'sharedcomponets'
I again changed the PYTHONPATH again export PYTHONPATH=$PWD/src:$PYTHONPATH/src/gui
But that didnāt work. I suspect Iām on the wrong path (pun intended!). Any suggestions?
Iām not sure, it seems like Python has some trouble trying to find the different files. I didnāt realize that since I had never run the application from the command line interface, always using PyCham. ā¦ let me do my research to see how to fix the problem.
PD: As workarround you add run it from PyCharm or any other Ide adding gui folder as āfolder with aourcesā
Hi, I have done a workaround that solved the problem by moving all the files to the same folder. It is not the most elegant solution but it should work after running: python simpleFocStudio.py
It runs a bit hot on my i7 at faster baud rates but, to be fair, so does platformio serial monitor (which is also python).
The only thing I could set was target. All other āsetsā ended up with a response of Target: 0 which suggests the value sent was changed to 0 somehow.
In theory using buttons you can set each parameter and using command line interface you can send any command as if you where typing on the serial console. i just run a test to verify it and it seems to work for me
Nice to hear the you like it The limitation on the number os decimals comes from SimpleFOC library I do not trim the nunber of decimals neither when sending or receiving , I just take the string and sent it via serial port to the device. I guess that the limitation comes from here:
It could be easy solved adding a new monitoring function with a an extra parameter, something like this:
void FOCMotor::useMonitoring(Print &print, int numerOfDecimals);
ā¦ but this is out of the scope of my application.
Hey @JorgeMaker,
This is a great tool, I did not have time to thank you yet.
We have already looked into developing a tool like this and you have made our life a lot easier now!
I will resolve this issue of decimal point for the next release, its noted in my todos. Basically print function receives the number of decimal points already.
monitoring_port->print(value, 4); // for 4 decimal places
I would actually like to advise you not to use the monitoring function motor.monitor() but to use the motor commands using commands V1, V2 and V3. It is async but then you can decide your own sampling rate and more time for the motor to do its focing
But downsampling works well as well!
Also for the next release Iāll introduce the āverboseā option to the motor commands so that we can avoid the textual outputs.
Finally, based on your interest on node/value interface for simplefoc I have some ideas and I think it would be interesting to discuss more thoroughly in the new thread. Let me create it and explain my vision for the simplefoc and I would love to hear what you think.