|
|
@@ -29,7 +29,7 @@ static bool g_focinit = false;
|
|
|
static __INLINE void RevPark(DQ_t *dq, float angle, AB_t *alpha_beta) {
|
|
|
float c,s;
|
|
|
#if 0
|
|
|
- SinCos_Lut(angle, &s, &c);
|
|
|
+ arm_sin_cos(angle, &s, &c);
|
|
|
#else
|
|
|
s = gFoc_Ctrl.out.sin;
|
|
|
c = gFoc_Ctrl.out.cos;
|
|
|
@@ -53,7 +53,7 @@ static __INLINE void Clark(float A, float B, float C, AB_t *alpha_beta){
|
|
|
static __INLINE void Park(AB_t *alpha_beta, float angle, DQ_t *dq) {
|
|
|
float c,s;
|
|
|
#if 0
|
|
|
- SinCos_Lut(angle, &s, &c);
|
|
|
+ arm_sin_cos(angle, &s, &c);
|
|
|
#else
|
|
|
s = gFoc_Ctrl.out.sin;
|
|
|
c = gFoc_Ctrl.out.cos;
|
|
|
@@ -435,7 +435,7 @@ static __INLINE bool PMSM_FOC_Update_Input(void) {
|
|
|
|
|
|
gFoc_Ctrl.in.s_vDC = get_vbus_float();
|
|
|
|
|
|
- SinCos_Lut(gFoc_Ctrl.in.s_motAngle, &gFoc_Ctrl.out.sin, &gFoc_Ctrl.out.cos);
|
|
|
+ arm_sin_cos(gFoc_Ctrl.in.s_motAngle, &gFoc_Ctrl.out.sin, &gFoc_Ctrl.out.cos);
|
|
|
Park(&iAB, gFoc_Ctrl.in.s_motAngle, &gFoc_Ctrl.out.s_RealIdq);
|
|
|
|
|
|
float lowpass = gFoc_Ctrl.in.s_motVelRadusPers * FOC_CTRL_US;
|
|
|
@@ -469,7 +469,7 @@ static __INLINE bool PMSM_FOC_Update_Input(void) {
|
|
|
if (gFoc_Ctrl.in.s_motVelocityFiltered >= CONFIG_Volvec_Delay_Comp_Start_Vel) {
|
|
|
float next_angle = gFoc_Ctrl.in.s_motAngle + gFoc_Ctrl.in.s_motVelRadusPers / PI * 180.0f * (FOC_CTRL_US * 0.8f);
|
|
|
rand_angle(next_angle);
|
|
|
- SinCos_Lut(next_angle, &gFoc_Ctrl.out.sin, &gFoc_Ctrl.out.cos);
|
|
|
+ arm_sin_cos(next_angle, &gFoc_Ctrl.out.sin, &gFoc_Ctrl.out.cos);
|
|
|
}
|
|
|
#endif
|
|
|
return true;
|