Dear team:
A customer of mine added some code to realize position loop and speed loop control based on the routine Proj_lab13b of F28069M.
he speed loop is running normally, the board is designed by himself, and the hardware is no problem, because the speed loop control based on the incremental encoder can run normally.
But with the increase of his own code, the location loop does not work anymore. The specific situation is that after “servo on”, you can hear the noise similar to the current flowing in the motor, but the actual performance of the motor is that there is no “servo on”, that is, there is no torque on the motor shaft, and it can be easily turned by hand.
Observe that the state of gmotorVars.spintac.posctlstate is idle, not busy. Since the motor position control is effective when the state of this variable is busy in the original routine, he feels that this part of the code is not working now. He checked his program according to the original routine, but did not find the problem.
The picture below is a screenshot of “spintac” when the motor has current noise but no torque actually occurs after "servo on". Please help analyze it. What might be wrong?

Best regards






