Yupp, i do have a PID controller attached but this motor needs to be integrated in a robotic arm. Until now i did position control, wich means the motor is reaching the desired position with no problems. The problem here is the speed, wich isnt constant during the rotation: whenever the motor needs to lift the arm up it has a slow speed and when the arm has to go down it goes very rapidly. Is there a way to precisely control the speed of the motor even when the load isnt even during the rotaion?
So...I should have two PID loops, one that is in charge of reaching the desired position and one to reach the desired speed and maintain it? I get that and it is a great idea...i was thinking also about ramping down the speed when the motor gets close to the desired position so i dont have to deal with a lot of inertia.
Perhaps you didn't ramp the set-point value to something the motor can follow under load? If its really strugglng to lift perhaps the torque rating of your motor isn't sufficient for the task.