2022-05-07 12:37 AM
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.
Solved! Go to Solution.
2022-05-11 04:29 AM
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
2022-05-11 04:29 AM
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
2022-12-13 05:36 AM
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
2022-12-14 06:34 AM
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
2022-12-28 06:38 AM
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:This 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
2022-12-28 07:04 AM
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.
2023-01-05 01:27 AM
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
2023-01-09 01:49 AM
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
2023-01-09 01:58 AM
Hi @Community member
Glad to hear that you successfully generate/customize and download the code.
Now, can you better describe me what happens when you try to run the motor?
First of all, is the switch-on pin (TRIG_POW_ON) driven by you or simply short-circuited to ground to keep the MCU supplied?
Is there any error coming up (overcurrent, speed-feedback....)?
Are the outputs driven low at start-up (to charge the boot capacitors) before alignment or they are in high impedance?
2023-01-09 03:36 AM
My goal is to use the HALL Sensor Feedback for my application.
I have connected a jumper to J8 in the place shows below:
This Jumper is always connected even when I program the board using ST-LINK.
I have no error coming up since the motor does not even engage.
Can you please tell me what you mean by OUTPUT? Do you mean the PWM signal from the microcontroller?