|
@@ -148,7 +148,7 @@ void mot_params_ind_inductance(float v, float freq, u16 l_type) {
|
|
|
hj_w = 360.0f / hj_n;
|
|
hj_w = 360.0f / hj_n;
|
|
|
sys_debug("hj %f, %f, %f, %f, %f, %f, %f\n", hj_v, hj_freq, hj_n, hj_samples, K_terms, Vdead, hj_w);
|
|
sys_debug("hj %f, %f, %f, %f, %f, %f, %f\n", hj_v, hj_freq, hj_n, hj_samples, K_terms, Vdead, hj_w);
|
|
|
float fft_angle = 360.0f / hj_samples * K_terms;
|
|
float fft_angle = 360.0f / hj_samples * K_terms;
|
|
|
- SinCos_Lut(fft_angle, &hj_image, &hj_real);
|
|
|
|
|
|
|
+ arm_sin_cos(fft_angle, &hj_image, &hj_real);
|
|
|
hj_real = hj_real * 2.0f;
|
|
hj_real = hj_real * 2.0f;
|
|
|
n_ind_ld = l_type;
|
|
n_ind_ld = l_type;
|
|
|
n_samples = 0;
|
|
n_samples = 0;
|
|
@@ -204,7 +204,7 @@ void mot_params_high_freq_inject(void) {
|
|
|
float hj_angle = hj_w * (float)n_samples;
|
|
float hj_angle = hj_w * (float)n_samples;
|
|
|
rand_angle(hj_angle);
|
|
rand_angle(hj_angle);
|
|
|
float s, c;
|
|
float s, c;
|
|
|
- SinCos_Lut(hj_angle, &s, &c);
|
|
|
|
|
|
|
+ arm_sin_cos(hj_angle, &s, &c);
|
|
|
float vd = 0, vq = 0;
|
|
float vd = 0, vq = 0;
|
|
|
if (n_ind_ld == L_TYPE_D) {
|
|
if (n_ind_ld == L_TYPE_D) {
|
|
|
vd = hj_v * c;
|
|
vd = hj_v * c;
|
|
@@ -257,7 +257,7 @@ void mot_params_calc_inductance(void) {
|
|
|
|
|
|
|
|
float z_angle = fast_atan_2(i_image, i_real) - fast_atan_2(v_image, v_real);
|
|
float z_angle = fast_atan_2(i_image, i_real) - fast_atan_2(v_image, v_real);
|
|
|
float s,c;
|
|
float s,c;
|
|
|
- SinCos_Lut(pi_2_degree(z_angle), &s, &c);
|
|
|
|
|
|
|
+ arm_sin_cos(pi_2_degree(z_angle), &s, &c);
|
|
|
|
|
|
|
|
float z_mag = v_mag / (i_mag + 0.0000001f);
|
|
float z_mag = v_mag / (i_mag + 0.0000001f);
|
|
|
float z_real = z_mag * c;
|
|
float z_real = z_mag * c;
|