Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Alternating Reversing sequence & Null=V0 space vector PWM #589

Open
Rampagy opened this issue Jan 12, 2023 · 3 comments · May be fixed by #590
Open

Feature request: Alternating Reversing sequence & Null=V0 space vector PWM #589

Rampagy opened this issue Jan 12, 2023 · 3 comments · May be fixed by #590

Comments

@Rampagy
Copy link

Rampagy commented Jan 12, 2023

I noticed on a lot of the manuals for the VESC6 boards mention that FOC only utilizes sinusoidal commutation. I have done some work with NULL=V0 and alternating reversing sequence space vector pulse width modulation on my Github and would like to try and implement it here. I tried looking through the code to see if I could find if was already implemented, but I was not able to.

If you're willing to provide an overview of the code architecture and where you think a good injection point for this would be, it would greatly help me in my endeavor.

https://youtu.be/5eQyoVMz1dY
https://youtu.be/hSXSY4LRizg
https://youtu.be/oHEVdXucSJs

These commutation methods provide ~15% more phase to phase voltage than sinusoidal commutation, and I think it would be a great addition to the project.

supported_commutation

@Rampagy
Copy link
Author

Rampagy commented Jan 12, 2023

I found the code and the description of the code. I think there are some optimizations in the code but am I right to assume that this is alternating sequencing space vector modulation?

If you have alpha and beta would it be possible to directly calculate the quadrature angle with arctan(beta/alpha) and then use a lookup table with the quadrature angle?

I'm thinking something like this (this function assumes complimentary switching):

https://github.com/Rampagy/bldc-firmware/blob/main/CommutationLookupTable.c#L4-L64

with the following lookup tables:

https://github.com/Rampagy/bldc-firmware/blob/main/include/CommutationLookupTable.ch

@Rampagy
Copy link
Author

Rampagy commented Jan 13, 2023

I have gone ahead and analyzed the foc_svm() function and I believe that there might be a bug or an improper interpretation of alpha and beta in my analysis.

This is a plot I got by compiling foc_svm() in gcc to generate the three waveforms. What perplexes me is that the duty cycle goes above PWMFullDutyCycle and below 0, as that's not actually possible on the microcontroller.
image

It seems to me there is either a bug in the foc_math() function or I am not interpreting alpha and beta correctly in my analysis.

The only thing I can think of that might be wrong with my interpretation is if the max alpha and beta could be was 0.866. If that's the case my analysis should use:

beta = 0.866f*(float)sin( (double)(i*3.14159f/180.0f) );
alpha = 0.866f*(float)cos( (double)(i*3.14159f/180.0f) );

@Rampagy Rampagy linked a pull request Jan 16, 2023 that will close this issue
@ElwinBoots
Copy link
Contributor

I have gone ahead and analyzed the foc_svm() function and I believe that there might be a bug or an improper interpretation of alpha and beta in my analysis.

This is a plot I got by compiling foc_svm() in gcc to generate the three waveforms. What perplexes me is that the duty cycle goes above PWMFullDutyCycle and below 0, as that's not actually possible on the microcontroller. image

It seems to me there is either a bug in the foc_math() function or I am not interpreting alpha and beta correctly in my analysis.

The only thing I can think of that might be wrong with my interpretation is if the max alpha and beta could be was 0.866. If that's the case my analysis should use:

beta = 0.866f*(float)sin( (double)(i*3.14159f/180.0f) );
alpha = 0.866f*(float)cos( (double)(i*3.14159f/180.0f) );

That is right. The mod_alpha and mod_beta go up to sqrt(3)/2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants