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.
Fork of priustroller_2 by
referencesynthesizers.cpp
00001 #include "includes.h" 00002 #include "meta.h" 00003 #include "sensors.h" 00004 #include "lut.h" 00005 #include "core.h" 00006 00007 void SynchronousReferenceSynthesizer::GetReference(float angle, float throttle, float *ref_d, float *ref_q) { 00008 *ref_d = 0.00f; 00009 *ref_q = _max_phase_current * throttle; 00010 } 00011 00012 float ReferenceSynthesizer::LutSin(float theta) { 00013 if (theta < 0.0f) theta += 360.0f; 00014 if (theta >= 360.0f) theta -= 360.0f; 00015 return sinetab[(int) theta] * 2.0f - 1.0f; 00016 } 00017 00018 float ReferenceSynthesizer::LutCos(float theta) { 00019 return LutSin(90.0f - theta); 00020 }
Generated on Tue Jul 12 2022 18:31:15 by
1.7.2
