I set up a small test rig in order to play with anticogging (ACT BLF42BLF03, B-G431B-ESC1, AS5047 (SPI)). I did this before with a very low cogging , but it went nowhere, so this time I tried it with a real cogging monster. Unfortunately, my experiments stopped right at the start, since I cannot move the motor to the sensor zero position. The cogging is so strong that it always jumps over this, by >100 pulses. Of course, I can “virtually” move my zero position by just adding a offset to the sensor count, but this behaviour raised the question for me, if the sensor alignment of simpleFOC is reliable for such motors. Looking at the code, all it does is to move to the electrical zero and then read the sensor position. This of course will work since the the move will always be to the same position, but is this position really the electrical zero or is it heavily biased by the cogging?
For the fun of it, here is a chart position vs. time for three full sensor rotations (counter clockwise). It seems that with decreasing el. angle, the motor moves less than expected and then, at a certain point it jumps.
To experiment with such things as your deadtime compensation was exactly the reason for setting up the test rig. What i experience here is definitely cogging however. You can also feel it with the unpowered motor. Also, I dud not expect it to be any better, but my concern is more general, that for motors with such strong cogging, the angle alignment might be off.
What I forgot to mention above: It is all very low level open loop.
Since I have very, very low cogging with other motors, I think the deadtime comp has also very little impact. With the motor above, you can see from the charts that it has very distinct cogging points. Effects if the waveform I would expect to be differently distributed. Still, I would like to try your work with a good motor and see if it further improves. There is always the hunt for making it better and it is pretty amazing, what hobbyists can achieve today!
I have never used position control, so I must be saying something wrong.
But I thought that was the point of the cogging map.
Commanding a position in closed loop and checking how much q axis has to be applied to stay there.
In order to create that map, I first need to calibrate the sensor and I need an absolute zero positon. For my case, I can just define any other position as zero, so that’s not the real problem. My concern is more the default electrical angle. Most people will use a very low voltage for the sensor alignment and the result may be completely off, depending on the alignment of motor and sensor, but I am not sure of that, hence just doubt…
I have a motor on my desk with 3PP. It also has quite high inertia due to attached weights, but the setup has low friction.
The result with the alignment procedure is a very high amount of oscillation, as the motor is snapped towards the zero position but massively overshoots due to inertia, low friction and generally low power of the motor.
The motor perhaps doesn’t settle in time, resulting in a non-optimal zero angle.
So I’m also thinking about a more intelligent alignment procedure, but its not that easy to come up with a general concept.
Maybe a noob-idea, but the cogging has valleys and peaks. So far you are trying to find the peak.
Why not look for the valley and calculate the offset-angle? You know the peaks are spread evenly, based on the PP-count.
Just have to figure out which peak is CW or CCW from the valley.
That‘s exactly my solution right now, but it comes with a very big „but“:
I manually pick the offset and can place it exactly where i don‘t expect any jumps. A general solution would need to perform that automatically. This is not very difficult, but time consuming (detecting jumps is easy, then try iteratively different offsets).
This only solves the alignment of sensor and motor, but is the electrical zero angle really the true zero, if it is impacted by cogging? That was my real initial question and it is still unanswered. I simply don‘t know enough about motor physics (virtually nothing).
I’m talking about the zero-finding procedure… not really specific to the cogging problem.
The tools available are:
a sensor, currently un-aligned to the rotor, but useful for delta measurements and velocity
open-loop driving of the motor
the rotor’s magnetic field of the permanent magnets, which will align itself to the stator field
Assumptions we can make are:
the motor is unloaded, and does not have significant friction
the motor is free to move, also trough multiple rotations
operating conditions such as power supply voltage are constant throughout the calibration procedure
My thoughts are currently along the lines of running the motor in open loop mode, slowly, and stopping it each time it crosses an electrical zero. Use a “homing” procedure around that zero and then move to the next one. Repeat this for 2-3 revolutions, and average the results to get a good value for the electrical zero.