• Howdy! we're looking for donations to finish custom knowledgebase software for this forum. Please see our Funding drive thread

FOC Angle calculation

Dipak

1 µW
Joined
Apr 20, 2024
Messages
4
Location
India
Dear mspider65 and casainho,

I hope this message finds you well. I wanted to express my sincere gratitude for generously sharing your code publicly. Your contribution has been incredibly beneficial to me, saving me significant time.

After studying your code meticulously, I am thoroughly impressed by its clarity and efficiency. However, despite my best efforts, there's one aspect that I'm struggling to grasp. Specifically, I'm having difficulty understanding how you derived the FOC angle and where the lookup table values originate.

Would you mind sparing a moment to shed some light on this matter? Any insights you could provide would be greatly appreciated.

Thank you once again for your invaluable contribution.

Warm regards,
Dipak
 
Here you will find how i have calculated the reference angle between rotor and applied phase current under "no load condition".
Optimized TSDZ2 Firmware
As you know, then the reference (no-load) angle should be corrected according to motor phase current and motor speed, but i have not found any literature reference on how to calculate the correction based on the motor characteristics (inductance etc..).
Having a power meter capable of measuring high continuous currents and a training roller, you could use the same method i used to calculare te reference angle under no load conditions also to calculate a correction table based on Motor Phase current and motor speed.
You have just run the motor at a fixed wheel power and then change the advance angle until you find the angle that give the minimum current reading and then for each measure record the values of motor current, motor speed and optimal advance angle.
I haven't done this (I don't have a trainer and power supply with precise current measurement) and my actual correction values are sub-optimal and are based on many tests on a reference climb looking at graphs of motor current and temperature.
 
Last edited:
how you derived the FOC angle
You have to be aware, that this is no classical FOC with Park, Clarke etc. It's just adjusting the advance angle following the theory. But it's the best, you can get of the poor controller hardware :)
but i have not found any literature reference on how to calculate the correction based on the motor characteristics
?! @casainho has implemented the advance angle adjustment following the paper of Shane Colton.
image.png


regards
stancecoke
 
Last edited:
Apologies for the delayed response.

Thank you for your reply. I'll review and update you soon. Currently, I'm tackling a noisy output issue with the hall sensor during fast motor rotation, causing commutation errors. Here are the details:

[Insert details]

Appreciate your assistance in resolving this.
 

Attachments

  • Hall_sensor_glitches.png
    Hall_sensor_glitches.png
    23.1 KB · Views: 2
Back
Top