From 53b74865281d009169900864d9cd83213d389bd1 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Mon, 16 Oct 2023 11:11:46 +0200 Subject: [PATCH] industry/foc: reset velocity observer output foc_velocity_zero_xx() is called --- industry/foc/fixed16/foc_vel_odiv.c | 2 ++ industry/foc/fixed16/foc_vel_opll.c | 2 ++ industry/foc/float/foc_vel_odiv.c | 2 ++ industry/foc/float/foc_vel_opll.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/industry/foc/fixed16/foc_vel_odiv.c b/industry/foc/fixed16/foc_vel_odiv.c index 5df851893..a5460fa1d 100644 --- a/industry/foc/fixed16/foc_vel_odiv.c +++ b/industry/foc/fixed16/foc_vel_odiv.c @@ -214,6 +214,8 @@ static int foc_velocity_div_zero_b16(FAR foc_velocity_b16_t *h) div->cfg.filter, div->cfg.per); + div->o.speed = 0; + return ret; } diff --git a/industry/foc/fixed16/foc_vel_opll.c b/industry/foc/fixed16/foc_vel_opll.c index b16cbee1d..36abdd56a 100644 --- a/industry/foc/fixed16/foc_vel_opll.c +++ b/industry/foc/fixed16/foc_vel_opll.c @@ -212,6 +212,8 @@ static int foc_velocity_pll_zero_b16(FAR foc_velocity_b16_t *h) pll->cfg.kp, pll->cfg.ki); + pll->o.speed = 0; + return ret; } diff --git a/industry/foc/float/foc_vel_odiv.c b/industry/foc/float/foc_vel_odiv.c index 43491b5a5..dfb8d820f 100644 --- a/industry/foc/float/foc_vel_odiv.c +++ b/industry/foc/float/foc_vel_odiv.c @@ -214,6 +214,8 @@ static int foc_velocity_div_zero_f32(FAR foc_velocity_f32_t *h) div->cfg.filter, div->cfg.per); + div->o.speed = 0.0f; + return ret; } diff --git a/industry/foc/float/foc_vel_opll.c b/industry/foc/float/foc_vel_opll.c index 0e554848a..a18b6675c 100644 --- a/industry/foc/float/foc_vel_opll.c +++ b/industry/foc/float/foc_vel_opll.c @@ -212,6 +212,8 @@ static int foc_velocity_pll_zero_f32(FAR foc_velocity_f32_t *h) pll->cfg.kp, pll->cfg.ki); + pll->o.speed = 0.0f; + return ret; }