Hi
i am using the speed_fr library with the IDDK code example to construct velocity control loop.
i am setting the k1,k2,k3 coffiecents as follows:
speed1.K1 = _IQ21(1/(BASE_FREQ*T));
speed1.K2 = _IQ(1/(1+T*2*PI*CUT_FREQ)); // CUT_FREQ Low-pass cut-off frequency
speed1.K3 = _IQ(1)-speed1.K2;
for velocity calculation the code example uses the electrical angle. also the electrical and mechanical angles are scaled to 0 -1 values.
the control loop works very good, my problem is that i dont understand how to calculate the real velocity from the scaled value that is out put by the speed_fr .
for example if i want to know the velocity in deg/sec , from how i understand it : i need to take the scaled velocity divided by the pole pairs number (electrical to mechanical velocity) and then multiply it by 360 (to go from the scaled (0 - 1) values to 0 -360. and then multiply it by the BASE_FREQ.
by this calculation i always get values 2 time lower then the actual motor speed.
be happy for advise,
MARK