I want to control motor. Fixed velocity but variable torque

How can I solve my question that I want to fixed the velocity. but wants to change torque.

In the sample code, If torque go higher, and velocity follow it.

which algorithm have I go that can work for my idea.

It is closed loop control. so if there a force that stopped the motor. it will stop and give reaction to force.

but if there is no other force, I want to spin the motor with fixed velocity.

Just a simple comment will very very helpful for me.

What you want is MotionControlType::velocity. Look at the velocity control examples.

holy. Why I didn’t notice that.

thanks for your reply.