This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Position error with position move

Hi!

I am currently working with an application where I want rotate my motor exactly 2,6 revolutions very quickly using Spintac position move with a trapezoidal trajectory. My problem is that the motor settles in a position a bit short off my target position, but when checking the position error in Spintac by using STPOSCTL_getPositionError_mrev it says that I am dead on target. So somewhere on the way the softwares perception of the motors position must have drifted.

It may be worth noting that I am using a 12-bit absolute encoder to sense my motors position, which is implemented in the software by modifying the ENC package. 

It seems that if i do the same movement but at with less max speed the final position error becomes smaller. I am thinking maybe it has to do something with the position converter running to seldom. If my calculations are correct I am currently running the system with the following speed

PWM freq = 40kHz

ISR freq = 20kHz

Ctrl freq = 10kHz

Speed loop freq = 2kHz

The motors max speed is set to 10krpm in the software which results in a max electric frequency of 333Hz since the motor has 2 pole pairs. I read somewhere on the forum the the position converter required at least 3 samples per electrical revolution to perform correct, so this should work, shouldn't it?

Any ideas what the problem may be, I am grateful for any help!

Best regards,

Gustav

  • Gustav,

    What is the magnitude of the position error that you are seeing and how are you detecting it?

    Can you describe the style of absolute encoder used and how you are converting the absolute angle into electrical angle?

    How slowly have you tired doing this position move?  Have you tried a speed as low as 1krpm for example?  My concern is that it is possible that the hardware cannot keep up with the position feedback signal and is losing track.  The easy way to determine this is to run for a long time in a signal direction, if the motor loses control than either the hardware can't keep up or there is a math error in the absolute to electrical conversion.

    Gustav Storck said:
    I read somewhere on the forum the the position converter required at least 3 samples per electrical revolution to perform correct, so this should work, shouldn't it?

    This is correct, so in your situation you should have enough samples in order to be able to control it.  

  • Hi Adam!

    Thank you for your response. After spending some more time investigating the problem i finally found the problem, and it was actually not SW related. The gear on my motor shaft was not fastened correct, so when I was accelerating hard the gear was actually rotating on the shaft due to the inertia of the mechanics. So the motor was moving exactly the distance it was ordered to do, but the mechanics was not.

    Too bad it took so many hours before i realized this. :-(

    Gustav
  • thanks for letting us know and glad it is now working