1
0
Fork 0
forked from nuttx/nuttx-update

libdsp/lib_observer.c: use float numbers in all calculations

we want to use FPU instructions in calculations not __aeabi
This commit is contained in:
raiden00pl 2023-10-15 10:15:58 +02:00 committed by Alan Carvalho de Assis
parent 2be45a3391
commit 8bdb78b446

View file

@ -612,10 +612,10 @@ void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
* as that makes the angle very unstable.
*/
if (vector2d_mag(nfo->x1, nfo->x2) < (phy->flux_link * 0.5))
if (vector2d_mag(nfo->x1, nfo->x2) < (phy->flux_link * 0.5f))
{
nfo->x1 *= 1.1;
nfo->x2 *= 1.1;
nfo->x1 *= 1.1f;
nfo->x2 *= 1.1f;
}
angle = fast_atan2(nfo->x2 - l_ib, nfo->x1 - l_ia);