Motor not reaching rated speed

No, my code does not using voltage sense

1 Like

The flash usage is exactly the same? :sweat_smile:

Yes this trick with writing the stuff in the setup to i2c instead of every time is very noteworthy, 9khz is a lot better than I was getting, I found it took about 300 microseconds to read the sensor (blocking, too), the whole motor.move loop in torque mode only ran at 1 khz on a 64mhz m0 core stm32 device. I did reduce that by interleaving that write operation, which I thought you had to do every time you read the sensor. If you don’t have to that’s noteworthy.

Ya it was exactly the same…

Just wonder if you set the i2c clock (to 1MHz) before or after initiating the sensor? I found out that it has to be after for it to take effect

Exactly the same is really weird.
Are you sure you are changing the right files?

This is different by MCU type, unfortunately. On some MCUs you have to do it before calling SPI.begin(),and on other MCU types it is afterwards :frowning:

I made some tests with ESP32 and AS5600 I2C@1MHz. It works flawless, but it didn’t increase motor speed.

I also tested it in torque-mode with smoothingSensor and saw some differences:
It ran slightly slower in one direction, but faster in the other.
I guess, it can be corrected with phase_angle correction.

Ideally the smoothing shouldn’t make much difference in terms of speed.

This sounds exactly like a motor timing issue. That it goes faster in one direction than the other would be because the zero offset of the sensor is biassed in one direction. Thus the motor timing is by default slightly different in one direction than the other. Try adjusting the sensor zero offset by just setting it with a single line of code to slightly higher than whatever the program is currently using. If that makes the motor go faster then that’s it.

1 Like

I tried it, because the AS5600 and the AS5048 I own, have a dead spot at the turning point.
In velocity mode it is even more noticeable. (will test that tomorrow)
If smoothingSensor could compensate the sensor-hiccup it would make it run slightly faster, I thought.
Fo sure it’s quieter.

Just to let everyone know, after switching to a SPI magnetic encoder (AS5047p) the motor is able to reach rated speed. It seems like the i2c encoders are just not fast enough after all. After the change the loop is running at ~14kHz.

4 Likes

That doesn’t mean it’s getting good efficiency, if it’s getting poor efficiency that will still cause issues later with maximal output of torque. Also the same issue can still arise just at a higher rpm. Also efficiency will taper off to zero as speed increases.

@jasonlcy, I am using the same HW (both board and SPI sensor), but can’t manage to get beyond 8 kHz loop speed (already in discussion here) so far. 14kHz seems like a big jump and I am curious as to how you achieved that. What was the max rotation speed you reached ? Any chance you could share your code with me?
Thank you !!