Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-dev-f303 FastPWM3
Diff: Transforms/Transforms.cpp
- Revision:
- 14:80ce59119d93
- Parent:
- 10:370851e6e132
diff -r a3fa0a31b114 -r 80ce59119d93 Transforms/Transforms.cpp
--- a/Transforms/Transforms.cpp Sun May 22 03:47:40 2016 +0000
+++ b/Transforms/Transforms.cpp Mon Oct 31 16:48:16 2016 +0000
@@ -9,10 +9,10 @@
//float sine = sin(theta);
float cosine = FastCos(theta);
float sine = FastSin(theta);
- *d = alpha*cosine - beta*sine; //This is a hack - effectively using -beta instead of beta
- *q = -beta*cosine - alpha*sine; //I think because I'm using pi as the d axis offset instead of zero, but I need to investigate more.
- //*d = alpha*cosine + beta*sine;
- //*q = beta*cosine - alpha*sine;
+ //*d = alpha*cosine - beta*sine; //This is a hack - effectively using -beta instead of beta
+ //*q = -beta*cosine - alpha*sine; //I think because I'm using pi as the d axis offset instead of zero, but I need to investigate more.
+ *d = alpha*cosine + beta*sine;
+ *q = beta*cosine - alpha*sine;
//DAC->DHR12R1 = (int) (*q*49.648f) + 2048;
//DAC->DHR12R1 = (int) (*q*2048.0f) + 2048;
}