Problems installing FOCStudio

Problem#1. “conda create -n simplefoc python=3.6.0” doesn’t work

This give me an error saying that python=3.6.0 isn’t available. So I changed the line to:
-“conda create -n simplefoc python=3.6”
Which worked.

Problem#2. pip install -r “requirements.txt”

ERROR: Could not find a version that satisfies the requirement PyQt5==5.15.9 (from versions: 5.7.1, 5.8,, 5.8.2, 5.9, 5.9.1, 5.9.2, 5.10, 5.10.1, 5.11.2, 5.11.3, 5.12, 5.12.1, 5.12.2, 5.12.3, 5.13.0, 5.13.1, 5.13.2, 5.14.0, 5.14.1, 5.14.2, 5.15.0, 5.15.1, 5.15.2, 5.15.3, 5.15.4, 5.15.5, 5.15.6)
ERROR: No matching distribution found for PyQt5==5.15.9

Can I change requirements.txt to use 5.15.6??? Why doesnt; my staiall have the right version in the first place?

Looks like pyqtgraph can’t find the right version either (it wants 0.13.1, but only up to 0.11.1 are availabel???). It seems something is very wrong somewhere. I have the latest version of Ananconda installed on my machine

I think the docs are out of date, try:

conda create -n simplefoc python=3.9.0

That worked for me.

1 Like

Just updated the documentation with your suggestions :slight_smile:

1 Like

Ok, now I have it installed (I think). Howver it doesn;'t seem to be working…

The instructions seem to imply I can just put in my motor and start using it:


Basically there are two things you need to do:

  1. Use the commander interface and add the motor to the commander
  2. Use the monitoring and add the motor.monitor() in the loop

Ive done this:

#include <SimpleFOC.h>

BLDCMotor motor = BLDCMotor(7, 17);

// 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
// tell the motor to use the monitoring
motor.monitor_downsample = 0; // disable monitor at first - optional

void loop(){

// real-time monitoring calls
// real-time commander calls;

I can now run the app, connect, but nothing seems to happen when I connect… Where am I supposed to configure the controller, sensors, etc???

BTW, I have a FOCShield, and an Uno. I’ve used this motor with SimpleFOC “programatically”, and ive been able to at least make it spin in open loop mode.

Captura de Pantalla 2023-12-02 a las 21.55.55

  • To connect to your device first configure the serial port by clicking on Configure button
  • Add your com port info and click OK
  • Then add the device command ID that you’ve added to the commander usually its M
    • Command M , Arduino code : command.add('M',doMotor,"my motor")

Did you put “M” in the GUI in order to select a commander interface?

:frowning: quote=“JorgeMaker, post:5, topic:4150”]
Did you put “M” in the GUI in order to select a commander interface?

Yes, I did. This did absolutely nothing, it seems to connect but nothing responds and I’m not sure how it would since I haven’t setup any driver, sensor, Am I supposed to do that in the code or are these things you configure in the GUI? Where???,

I feel like something obvious must be going right over my head here I’ve read the instructions over and over and found nothing, nor can I find any online resource on how to set this up.:frowning:

Hi @sgordon777

SimpleFOCStudio is nothing more than a GUI that sends commands in response to button clicks and that takes data from the monitor and paints graphics. Nothing else.

Both the commander interface and the monitor must work for SimpleFOCStudio to communicate with your application.

  • Have you tried connecting to the serial port with a console to see if your SimpleFOC instance is sending the monitor information?

  • Another thing you can try is to connect through the console using the serial port and send commands directly, typing them. Here you have an explanation about how to send commands (remember to add ''M" ) :

Once we are sure that your computer can send commands and receive responses using the serial port, as well as be able to view the data stream coming from the monitor functionality… we can continue investigating your problem with SimpleFOCStudio.

I wrongly interpreted the instructions to say that I should only have a “motor” object in my embedded code, and the driver, sensor and other objects would be handled by the PC app.

I just added the “doMotor” command to my normal app and it works fine, thanks. I do have some questions though now that I’m using that app:

Board: FOCShield v234,
Motor: small 12v 90KV gimbling motor 17 ohm phase resistance,
Sensor: AS5600 in I2c mode

1- In closed loop velocity mode I cannot get higher than ~70 rad/s (~600 RPM) regardless of settings(motor works great below 600 RPM and also works great in angle mode). I can do a little bit better in open loop mode, but only up to about 100 rad/s (~1K RPM). I can get this motor to ~3K RPM using my homespun ESC (using standard 6-step BLDC commutation) at same voltate. I’ve tried other motors, some that I can run at 20K RPM but never more than ~1KRPM with simpleFOC. Is this a limitation of the FOC algorithm itself? (I have a visualization of the attempt below)

2- I cannot figure out how to set “target” in the GUI? I know I could add a “Target” command and do it through the command interpreter, but since the Jog command sets the target without that it must be possible?

3- Jog buttons are not responsive. They work, I have to hit the button several times (sometimes 5 times) for something to happen

4- (more of question on the sheild maybe: When I shut of my main power supply USB power working it’s way into the motor, causing weak movements, is this something I should worry about?

5- Program Memory limitation on Arduino Uno (AT Mega328 chip). I cannot compile all features into a single ATMega328 program (I cannot get commander, sensor, motor, driver, and currentSense in a single app due to limited Flash memory of 32KB). Is there some way to save program memory as I’d like to try Current control.

(attempt to get velocity target past 70 rad/s)

ANSWER: You have to append “M” at the command line interface in order to inicate that you want to send such target value to your motor.

ANSWER: not sure what can be happening, maybe your microcontroller is missing messages due to a lack of processing capacity , just guessing.

Best Regards !!!