2025-02-18 02:39 AM - last edited on 2025-02-18 03:11 AM by Peter BENSCH
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?
2025-02-18 07:15 AM
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?
2025-02-19 02:34 AM
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.
2025-02-20 07:50 AM
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()