Challenges going faster than certain rpm

Hey @daniel,

Yes, your MCU is fast and you can have loop times even much higher than 2.5kHz if you use a different sensor. I2C based AS5600 is really not meant for high speeds or fast loop times. But even an ideal sensor you will still not be able to come to 500rad/s.

The open-loop control is really really fast. cca 10x-100x faster then the FOC and it makes a lot of difference.

Velocity control algorithm takes longer time to execute and that is probably the reason why you see such a high difference. Try using the motion downsampling to let more time to the FOC algorithm and less for your motion control as your task for the moment is very simple. With some motion downsampling you should be able to reach at least this 150rad/s.

You are using a timer?

There is part of the equation that influences a lot and that is power supply voltage. As when going faster your back-emf rises motor’s torque fill diminish and it will not be able to reach higher speeds. So one simple way you can increase your speed range would be to use a higher power-supply voltage.

We do not do the compensation of the delay in the library in this way. We do have the adaptive time sampling which will help in motion control applications but not in the field vector setting. There is something that you can do if you are motivated though, we do use the motor.zero_electric_angle which basically determines the calibrated offset in between sensor and the motor 0 angles. For higher velocities (due to this delay you are interested in) we will have a certain offset in between where the motor is and where we this it is which will depend on velocity.
So you could add your estimation of the offset to the motor.zero_electric_angle:

You could do something like this in your loop

float normal_zero_angle = motor.zero_electric_angle;
float alpha = 0.1; // something small - this is up to you to find depending on your motor and sensor
void loop (){
   motor.zero_electric_angle=normal_zero_angle + alpha*motor.shaft_velocty;
   ...
   motor.loopFOC();
   motor.move();
}
1 Like