I can not use the index of my encoder because it is independent of the controller. The zero is done whenever the IC has power.
That sounds bad... I am surprised because you said that it is a magnetic encoder. These ones know about the absoulte angular relationship... And how can they realize hall sensor emulation then...
I'm using an
AS5047sensor.
The only way I would be to rotate the magnet until the index changes state ... but this is very difficult. The magnet is glued to the motor shaft.
So I've been seeing if I notice torque changes while change the angles, but I do not notice any difference.
Did you compare torque in both spinning directions? Only if that is equal then you know that alignment is correct.
I'll do it again tomorrow.
But I did as you said. Vary the angle from 270º (-90º) to + 90º in both directions in 5º steps.
After I fixed my error in the code, the motor started to run fine. But I did not notice any difference in torque, so I went to get a dynamometer to check.
With the dynamometer I just tested for one of the directions ... tomorrow I'm going to test all this again.
I already put everything in doubt.
I'm doing the tests using speed control. But did not make more sense do these tests in torque control?
No, that's okay. As you stall the motor, the speed controller tells the torque controller "go for it" and directs full torque (nominal motor current from motor parameters).
So I did not screw up
!
Looks not too bad, is that a level that you expect? Is it the same in both spinning directions? Is it constant when allowing the motor to spin (giving rope slowly)? Or you you have that cogging effect again here?
I expected more force... but as it is in open-loop it seems normal.
I'll test again tomorrow in the opposite direction.
In open-loop I do not have significant congging. I had the rope tied and so the motor runs until it's locked. I did not try to release the rope slowly.
If torque is the same in both spinning directions, it means that the alignment is working well, and can be considered validated. What I would do last here is measure (low pass filtered) phase voltages and currents in stepper mode. This would validate the entire power stage.
If all tests are positive, and same torque in both directions, this means that both motor feedback, controller and firmware are working well. If there is still massive cogging at low revs, then that is all caused by the motor construction. Unless you implement an anti-cogging strategy, there is nothing else to do that I can think of.
I'm going try to prove all this part tomorrow.
What seems to me so far is that the alignment angle does not make any difference. I varied a few angles and re-tested the full code in low revs and had the same cogging as before.
Everything points to the construction of these motors.
If this does not work, it seems the only solution is to run in "stepper mode" at low revs. In this case I have to create a compromise between maximum torque and heating. For example, in low revs the motor runs but with reduced torque to avoid heating.