Skip to main content
BPara.1
Associate
May 7, 2022
Solved

How can I activate the built-in potentiometer on the STEVAL PTOOL 1v1 Board?

  • May 7, 2022
  • 5 replies
  • 2176 views

Hello.

I want to drive a BLDC motor with Steval ptool1v1 hardware.

I loaded the example file (6S_Steval_ptool_1v1_HS_WM) into the MCSDK-WB, from which I generated the code (via cubeMX and CubeIDE).

The motor doesn’t work despite all my attempts. Even though potentiometer speed control is included in the user manual as plug'n play(!), I see in the cube IDE it is not implemented. Moreover, I did not find an option in the MCSDK Workbench where this could be selected.

I tried to figure out in the code how to implement it afterwards, but I couldn't figure out the solution.

How could this be solved?

Thanks in advance.

Bela.

This topic has been closed for replies.
Best answer by Cristiana SCARAMEL

Hello @BPara.1​ ,

the potentiometer feature is included in the example 6S_Steval_ptool_1v1_HS_VM.

In fact, the firmware continuously acquire the PA3 pin (named “SPEED�? in the IOC file), every “POT_UPDATE�? milliseconds (defined in the main.c file, default value 200 ms).

Once you have loaded the example project in the MCSDK and saved it on your PC, please be sure to select the UPDATE button (not the GENERATE button). Otherwise the proper settings and configuration will be lost.

Let me know if these info help you

5 replies

Cristiana SCARAMEL
Technical Moderator
May 11, 2022

Hello @BPara.1​ ,

the potentiometer feature is included in the example 6S_Steval_ptool_1v1_HS_VM.

In fact, the firmware continuously acquire the PA3 pin (named “SPEED�? in the IOC file), every “POT_UPDATE�? milliseconds (defined in the main.c file, default value 200 ms).

Once you have loaded the example project in the MCSDK and saved it on your PC, please be sure to select the UPDATE button (not the GENERATE button). Otherwise the proper settings and configuration will be lost.

Let me know if these info help you

"If you feel a post has answered your question, please click ""Accept as Solution"""
PKVSK.2
Visitor II
December 13, 2022

Hello Cristiana,

Hope you are in good health.

Your example code process (stmx file from MCSDK installation loaded via workbench -> generating .ioc file in MX -> generating code in CubeIDE) does not provide me a SPEED pin on PA3 like you mention despite my multiple tries. Compilation is failing. I have tried to UPDATE instead of GENERATE and it does not change anything. I still do not have a pin assigned for SPEED control.

Due to the poor getting started documentation provided by ST, I believe I do not have the required information as to how to go about it.

Required to to help me regarding the same as I need to make my motor work asap.

Regards

ADAVE.1
ST Employee
December 14, 2022

Hello @Community member​ ,

Once you click the GENERATE button, the proper configuration is lost and you can't recover it by clicking UPDATE the next time.

The right process to have a working code is strictly following the instructions in the readme.txt file that should pop up when you open the example in the MCSDK Workbench.

I suggest you to delete the created folder and start again from scratch, reopening the example, saving it without renaming it and then click the UPDATE button.

You should then obtain an IOC file like in the picture.

Let me know if something is not clear or you still face any issue

0693W00000WL0qbQAD.jpg

PKVSK.2
Visitor II
December 28, 2022

Hello @ADAVE.1​ ,

I apologize for the late reply.

I want to give you a complete view of what I've been doing.

HARDWARE used:

STEVAL PTOOL1V1

Approximate motor parameters: 10PP 36V 1500RPM 15A with Hall Sensors

Potentiometer

ST-LINK-V2

External USB-UART converter to access MC-Pilot

There are two ways I'm able to load example code into the MC WB, out of which only one generates the SPEED pin.

1) One that works - is by selecting it from the menu like below:0693W00000Y7056QAB.pngThis one generates Speed Pin.

2) The other method is loading the .stmx file from the project folder in the MC-SDK installed directory (which doesn't generate SPEED Pin). So ignoring discussing about this.

Now using method 1, the example is designed for another motor. I am changing the motor parameters in the MC WB 'motor part' denoted by "M" before saving and generating code (pressing on UPDATE and not GENERATE) i.e, assigning Pole pairs, voltage, disabling the encoder, activating the Hall sensor option, etc.

Then I generate .ioc file form MC WB.

Then I do not make any changes in the .ioc file and continue to press on Generate code again in Cube MX.

Then IDE opens up and I am just disabling the Direction button by manually making Motor_Device1.direction = 1;

Now uploading code and moving the potentiometer does nothing to the motor. It doesn't even align and I need your help in starting up the motor. I understand MC_Core_Start(&Motor_Device1); will start the motor startup by aligning it first.

Another problem statement and bigger disadvantage is I cannot profile my motor with STEVALPTOOL 1V1. I have profiled the same motor with B-G431B-ESC1 but with assigning the MAX VOTLAGE to 24V which only ran the motor in 650RPM.

I then tried using B-G431B-ESC1 to control the motor with 24V just for fun.

Request you to reply to me so that I can get my motor running before NEW YEARS eve.

Regards,

Puneeth

PKVSK.2
Visitor II
December 28, 2022

Please also note that the changes made to the MOTOR tab in MC WB has not affected changes in the generated code. Hence, I changed the PP, Resistance, etc in the pmsm_motor_parameters.h file myself.

PKVSK.2
Visitor II
January 5, 2023

Hello @ADAVE.1​ , can you please help me run my motor using STEVAL PTOOL1V1?

I just want to run the example using the motor I have. For this purpose, I changed the motor parameters and PI values according to the profiling I did to my motor.

This will help me a lot because I would like to develop my application using ST motor control Hardware

ADAVE.1
ST Employee
January 9, 2023

Hi @Community member​ 

that's right, you cannot use the GUI of the workbench to change the config parameters. You have to do it either in the CubeMX before regenerating the code or in the proper generated code file