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.
Diff: main.cpp
- Revision:
- 202:1baff0df86d1
- Parent:
- 201:5d1a3aa50fe0
- Child:
- 203:cb2a3ea31dce
diff -r 5d1a3aa50fe0 -r 1baff0df86d1 main.cpp
--- a/main.cpp Mon Feb 12 00:02:50 2018 +0000
+++ b/main.cpp Mon Feb 12 01:13:52 2018 +0000
@@ -78,32 +78,15 @@
constrain_norm(&foc.vd, &foc.vq, 1.0f, 1.0f, 1.0f + _OVERMODULATION_FACTOR);
- /*
- if (!control.enabled) {
- foc.vd = 0.0f;
- foc.vq = 0.0f;
- }
- */
-
float pv = foc.p + read.w / _V_PHASE_SWIZZLE;
float sin_pv = sinf(pv);
float cos_pv = cosf(pv);
/*inverse transforms*/
invpark(foc.vd, foc.vq, sin_pv, cos_pv, &foc.valpha, &foc.vbeta);
-
+
+ /*set outputs*/
float va, vb, vc, voff;
-
- //invclarke(foc.valpha, foc.vbeta, &va, &vb);
- //vc = -va - vb;
-
- /*SVPWM*/
- //voff = (fminf(va, fminf(vb, vc)) + fmaxf(va, fmaxf(vb, vc)))/2.0f;//don't think about it
- //va = va - voff;
- //vb = vb - voff;
- //vc = vc - voff;
-
- /*set outputs*/
switch (BREMS_mode) {
case MODE_CFG:
va = 0.0f;
@@ -148,7 +131,6 @@
go_disabled();
break;
}
-
/*log data*/
if (_ENABLE_LOGGING) {
@@ -164,6 +146,7 @@
}
}
+ /*disable outputs if necessary*/
if (!control.enabled) {
va = 0.0f; vb = 0.0f; vc = 0.0f;
}