cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to successfully change the speed using STC_ExecRamp().

Vincent7
Associate III
Hello Everybody,
 
MCSDK:6.3.0
CubeMX: 6.3.0
Workbench : 6.3.0
Cube IDE : 1.15.0
Power Board : IHM08M1(Rshunt=0.01Ω)
Control Board : NUCLEO-G431RB
Motor : BLDC 26w 24v/8 pole pairs / rpm=4k / rated current=1.8A/hall sensor
 

I am currently testing the use of STC_ExecRamp(). In WORKBENCH, the default speed is set to 1000.

However, when I call STC_ExecRamp() in the code and change the speed to 500, the readback speed is still 1000.

I have set it to Speed Mode.

Could anyone point out what might be wrong?

3 REPLIES 3
GMA
ST Employee

Hello @Vincent7,

Refere to STC_ExecRamp() function header for more detail.
Does retval returned by STC_ExecRamp() call is "true"?
Did you wait "STC_ExecRamp() duration" timing value before checking the speed?
Does ordering the same ramp with MC Pilot is also not correctly processed?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

Hello GMA,
Thanks for your reply.

Q1) STC_ExecRamp() call is "true"?
Ans : Yes


Q2) Did you wait "STC_ExecRamp() duration" timing value before checking the speed?
Ans : Yes (I manually control it using a flag, so I visually observe the motor running for a while before changing the flag. I only wanted to change the default speed from 1000 to 1200 in Workbench to verify the functionality.)

 

Q3) Does ordering the same ramp with MC Pilot is also not correctly processed?
Ans : No, it is normal, but I am not sure if MC Pilot also calls STC_ExecRamp(). I guess it does because I saw it being executed while debugging.

However, the issue is that when I use MC_ProgramSpeedRampMotor1(SethFinalSpeed/6, 1000) in the while loop to control the target speed, it works correctly.My main goal is to implement Speed+Torque control. I saw content related to Speed & Torque Control in the documentation, so I was wondering if I need to use STC-related commands to achieve this.

Please kindly show me where I made a mistake.

Attached are my STC initialization and control logic inside the while loop.

 

Initial_STC.png

SpeednTorqCtrl_Handle_t.png

while loop.png

 

 

 

 

 

 

 

Hello @Vincent7,

Sorry, maybe I missed one point; to control torque or speed ramps, you have to use available APIs
MC_ProgramTorqueRampMotor1_F()
MC_ProgramSpeedRampMotor1_F()

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA