View Single Post
Old 09-25-2015, 04:15 PM   #2076 (permalink)
e*clipse
Permanent Apprentice
 
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 314 Times in 215 Posts
Paul - is the sensorless.c code you sent the same code you're working on now w/ thingstodo? Wow. 42 pages of code. This may take a bit of coffee.

I did make it through AC-Controller V-Hz.
It's nicely commented - that's a big help.

VV Is this generally right? VV
It basically advances around the sinusoid defined in the huge lookup table at the start. The amount of advance is determined by the "throttle_feedback" variable.

The throttle_feedback variable is set by the AtoD converter, which is triggered by the PWM. This is all handled in a huge interrupt, ADCInterrupt, starting on page 7.

If this is right, it doesn't really use SVM; the variables theta1, theta2, and theta3 are the angle variables, with theta2 clocked 120 degrees and theta3 clocked 240 degrees from theta1.

You comment that it's ok if theta2 and theta3 overflow when they are being clocked relative to theta1. Example:
theta2 = theta1 + 0x5555; // 120 degree offset. Who cares if it overflows. it just wraps around. Heck ya!

I'm confused - if theta2 gets larger than the 65535, it will go to zero + the difference?

After that, the PWM duty cycle is set based on the sin values from the lookup table.

Did I generally get this right? Also - please explain how the rollover works - this could make things much easier.

-E*clipse
  Reply With Quote