![]() |
SimpleFOClibrary 2.4.0
|
#include "Arduino.h"Go to the source code of this file.
Classes | |
| struct | DQ_s |
| struct | AB_s |
| struct | Phase_s |
Macros | |
| #define | _sign(a) ( ( (a) < 0 ) ? -1 : ( (a) > 0 ) ) |
| #define | _round(x) ((x)>=0?(long)((x)+0.5f):(long)((x)-0.5f)) |
| #define | _constrain(amt, low, high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) |
| #define | _sqrt(a) (_sqrtApprox(a)) |
| #define | _isset(a) ( (a) != (NOT_SET) ) |
| #define | _UNUSED(v) (void) (v) |
| #define | _powtwo(x) (1 << (x)) |
| #define | _swap(a, b) { auto temp = a; a = b; b = temp; } |
| #define | _2_SQRT3 1.15470053838f |
| #define | _SQRT3 1.73205080757f |
| #define | _1_SQRT3 0.57735026919f |
| #define | _SQRT3_2 0.86602540378f |
| #define | _SQRT2 1.41421356237f |
| #define | _120_D2R 2.09439510239f |
| #define | _PI 3.14159265359f |
| #define | _PI_2 1.57079632679f |
| #define | _PI_3 1.0471975512f |
| #define | _2PI 6.28318530718f |
| #define | _3PI_2 4.71238898038f |
| #define | _PI_6 0.52359877559f |
| #define | _RPM_TO_RADS 0.10471975512f |
| #define | NOT_SET -12345.0f |
| #define | _HIGH_IMPEDANCE 0 |
| #define | _HIGH_Z _HIGH_IMPEDANCE |
| #define | _ACTIVE 1 |
| #define | _NC ((int) NOT_SET) |
| #define | MIN_ANGLE_DETECT_MOVEMENT (_2PI/101.0f) |
Typedefs | |
| typedef DQ_s | DQVoltage_s |
| typedef DQ_s | DQCurrent_s |
| typedef AB_s | ABVoltage_s |
| typedef AB_s | ABCurrent_s |
| typedef Phase_s | PhaseVoltage_s |
| typedef Phase_s | PhaseCurrent_s |
Functions | |
| float | _sin (float a) |
| float | _cos (float a) |
| void | _sincos (float a, float *s, float *c) |
| float | _atan2 (float y, float x) |
| float | _normalizeAngle (float angle) |
| float | _electricalAngle (float shaft_angle, int pole_pairs) |
| float | _sqrtApprox (float value) |
| #define _120_D2R 2.09439510239f |
Definition at line 25 of file foc_utils.h.
| #define _1_SQRT3 0.57735026919f |
Definition at line 22 of file foc_utils.h.
| #define _2_SQRT3 1.15470053838f |
Definition at line 20 of file foc_utils.h.
| #define _2PI 6.28318530718f |
Definition at line 29 of file foc_utils.h.
| #define _3PI_2 4.71238898038f |
Definition at line 30 of file foc_utils.h.
| #define _ACTIVE 1 |
Definition at line 37 of file foc_utils.h.
| #define _constrain | ( | amt, | |
| low, | |||
| high | |||
| ) | ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) |
Definition at line 11 of file foc_utils.h.
| #define _HIGH_IMPEDANCE 0 |
Definition at line 35 of file foc_utils.h.
| #define _HIGH_Z _HIGH_IMPEDANCE |
Definition at line 36 of file foc_utils.h.
Definition at line 13 of file foc_utils.h.
| #define _NC ((int) NOT_SET) |
Definition at line 38 of file foc_utils.h.
| #define _PI 3.14159265359f |
Definition at line 26 of file foc_utils.h.
| #define _PI_2 1.57079632679f |
Definition at line 27 of file foc_utils.h.
| #define _PI_3 1.0471975512f |
Definition at line 28 of file foc_utils.h.
| #define _PI_6 0.52359877559f |
Definition at line 31 of file foc_utils.h.
Definition at line 15 of file foc_utils.h.
Definition at line 9 of file foc_utils.h.
| #define _RPM_TO_RADS 0.10471975512f |
Definition at line 32 of file foc_utils.h.
Definition at line 7 of file foc_utils.h.
| #define _sqrt | ( | a | ) | (_sqrtApprox(a)) |
Definition at line 12 of file foc_utils.h.
| #define _SQRT2 1.41421356237f |
Definition at line 24 of file foc_utils.h.
| #define _SQRT3 1.73205080757f |
Definition at line 21 of file foc_utils.h.
| #define _SQRT3_2 0.86602540378f |
Definition at line 23 of file foc_utils.h.
Definition at line 17 of file foc_utils.h.
| #define _UNUSED | ( | v | ) | (void) (v) |
Definition at line 14 of file foc_utils.h.
| #define MIN_ANGLE_DETECT_MOVEMENT (_2PI/101.0f) |
Definition at line 40 of file foc_utils.h.
| #define NOT_SET -12345.0f |
Definition at line 34 of file foc_utils.h.
| typedef AB_s ABCurrent_s |
Definition at line 61 of file foc_utils.h.
| typedef AB_s ABVoltage_s |
Definition at line 60 of file foc_utils.h.
| typedef DQ_s DQCurrent_s |
Definition at line 52 of file foc_utils.h.
| typedef DQ_s DQVoltage_s |
Definition at line 50 of file foc_utils.h.
| typedef Phase_s PhaseCurrent_s |
Definition at line 71 of file foc_utils.h.
| typedef Phase_s PhaseVoltage_s |
Definition at line 70 of file foc_utils.h.
| float _atan2 | ( | float | y, |
| float | x | ||
| ) |
Function approximating atan2
| float _cos | ( | float | a | ) |
Function approximating cosine calculation by using fixed size array
| a | angle in between 0 and 2PI |
| float _electricalAngle | ( | float | shaft_angle, |
| int | pole_pairs | ||
| ) |
Electrical angle calculation
| shaft_angle | - shaft angle of the motor |
| pole_pairs | - number of pole pairs |
Definition at line 83 of file foc_utils.cpp.
| float _normalizeAngle | ( | float | angle | ) |
normalizing radian angle to [0,2PI]
| angle | - angle to be normalized |
| float _sin | ( | float | a | ) |
Function approximating the sine calculation by using fixed size array
| a | angle in between 0 and 2PI |
| void _sincos | ( | float | a, |
| float * | s, | ||
| float * | c | ||
| ) |
Function returning both sine and cosine of the angle in one call. Internally it uses the _sin and _cos functions, but you may wish to provide your own implementation which is more optimized.
| float _sqrtApprox | ( | float | value | ) |
Function approximating square root function
| value | - number |