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:
- 10:370851e6e132
- Parent:
- 7:dc5f27756e02
- Child:
- 14:80ce59119d93
diff -r d7eb815cb057 -r 370851e6e132 Transforms/Transforms.cpp
--- a/Transforms/Transforms.cpp Tue May 10 01:15:57 2016 +0000
+++ b/Transforms/Transforms.cpp Thu May 12 05:02:52 2016 +0000
@@ -9,8 +9,8 @@
//float sine = sin(theta);
float cosine = FastCos(theta);
float sine = FastSin(theta);
- *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;