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_current by
meta/referencesynthesizers.cpp
- Committer:
- nki
- Date:
- 2015-03-16
- Revision:
- 34:bfe180de813a
- Parent:
- 11:dccbaa9274c5
File content as of revision 34:bfe180de813a:
#include "includes.h" #include "meta.h" #include "sensors.h" #include "lut.h" #include "core.h" void SynchronousReferenceSynthesizer::GetReference(float angle, float throttle, float *ref_d, float *ref_q) { *ref_d = 0.00f; *ref_q = _max_phase_current * throttle; } float ReferenceSynthesizer::LutSin(float theta) { if (theta < 0.0f) theta += 360.0f; if (theta >= 360.0f) theta -= 360.0f; return sinetab[(int) theta] * 2.0f - 1.0f; } float ReferenceSynthesizer::LutCos(float theta) { return LutSin(90.0f - theta); }