![]() |
![]() |
|
MSPM0G3519SensoredFOCMotorControlLibrary
1.0
|
#include "stdint.h"#include <ti/iqmath/include/IQmathLib.h>#include "IQmath_mathacl.h"#include <ti/devices/msp/msp.h>#include <ti/driverlib/driverlib.h>#include <ti/driverlib/m0p/dl_core.h>

Go to the source code of this file.
Macros | |
| #define | LOOKUP_POINTS 16 |
| Number of lookup points. | |
| #define | DELX_LOOKUP _IQ(0.25)/(LOOKUP_POINTS - 1) |
| Delta lookup. | |
| #define | INV_DELX_LOOKUP (int32_t)(((LOOKUP_POINTS - 1) / 0.25)) |
| Inverted Delta lookup. | |
Functions | |
| int32_t | sine_LowPriority (int32_t orig_angle) |
| LUT based sine computation. | |
| int32_t | cosine_LowPriority (int32_t orig_angle) |
| LUT based cosine computation. More... | |
| void | sinCosMATHACLCompute (int_fast32_t orig_angle) |
| Configures the MATHACL for sinCos computation and set the angle. | |
| __STATIC_INLINE int_fast32_t | readMATHACLSin (void) |
| Reads and scales the MATHACL register with sine result. More... | |
| __STATIC_INLINE int_fast32_t | readMATHACLCos (void) |
| Reads and scales the MATHACL register with cosine result. More... | |
| int32_t | sine_LowPrioirty (int32_t orig_angle) |
| sine of angle More... | |
| int_fast32_t | sine (int32_t orig_angle) |
| sine of angle More... | |
| int_fast32_t | cosine (int32_t orig_angle) |
| cosine of angle More... | |
| int_fast32_t | arcTan2 (int_fast32_t iqNInputX, int_fast32_t iqNInputY) |
| Finds tan inverse angle. More... | |
| int32_t cosine_LowPriority | ( | int32_t | orig_angle | ) |
LUT based cosine computation.
cosine of angle
| [in] | orig_angle | Angle input in pu |
References DELX_LOOKUP, INV_DELX_LOOKUP, and LOOKUP_POINTS.
Referenced by readMATHACLCos(), and sine_LowPriority().
| __STATIC_INLINE int_fast32_t readMATHACLSin | ( | void | ) |
Reads and scales the MATHACL register with sine result.
References GLOBAL_IQ.
Referenced by MC_SinCos(), and sinCosMATHACLCompute().
| __STATIC_INLINE int_fast32_t readMATHACLCos | ( | void | ) |
Reads and scales the MATHACL register with cosine result.
References arcTan2(), cosine(), cosine_LowPriority(), GLOBAL_IQ, sine(), and sine_LowPrioirty().
Referenced by MC_SinCos(), and sinCosMATHACLCompute().
| int32_t sine_LowPrioirty | ( | int32_t | orig_angle | ) |
sine of angle
| [in] | orig_angle | Angle input in pu |
Referenced by readMATHACLCos().
| int_fast32_t sine | ( | int32_t | orig_angle | ) |
sine of angle
| [in] | orig_angle | Angle input in pu |
Referenced by closeLoopRun(), readMATHACLCos(), and sinCosMATHACLCompute().
| int_fast32_t cosine | ( | int32_t | orig_angle | ) |
cosine of angle
| [in] | orig_angle | Angle input in pu |
Referenced by readMATHACLCos(), and sinCosMATHACLCompute().
| int_fast32_t arcTan2 | ( | int_fast32_t | iqNInputX, |
| int_fast32_t | iqNInputY | ||
| ) |
Finds tan inverse angle.
| [in] | iqNInputX | Cosine value of angle |
| [in] | iqNInputY | Sine value of angle |
References _IQdiv_mathacl, and GLOBAL_IQ.
Referenced by readMATHACLCos().