Skip to content

Commit 5d4b720

Browse files
raiden00plxiaoxiang781216
authored andcommitted
foc/foc_feedforward.c: vdq_comp->q should use idq->d
fix typo in calculations for vdq_comp->q. It should use idq->d not idq->q. Reported in #3047 Signed-off-by: raiden00pl <raiden00@railab.me>
1 parent cf1d5bb commit 5d4b720

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

industry/foc/fixed16/foc_feedforward.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int foc_feedforward_pmsm_b16(FAR struct motor_phy_params_b16_s *phy,
6363

6464
vdq_comp->q = -b16mulb16(vel_now,
6565
(phy->flux_link + b16mulb16(phy->ind,
66-
idq->q)));
66+
idq->d)));
6767
vdq_comp->d = b16mulb16(b16mulb16(vel_now, phy->ind), idq->q);
6868

6969
return OK;

industry/foc/float/foc_feedforward.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int foc_feedforward_pmsm_f32(FAR struct motor_phy_params_f32_s *phy,
6161
* so vq compensation must be negative here.
6262
*/
6363

64-
vdq_comp->q = -vel_now * (phy->flux_link + phy->ind * idq->q);
64+
vdq_comp->q = -vel_now * (phy->flux_link + phy->ind * idq->d);
6565
vdq_comp->d = vel_now * phy->ind * idq->q;
6666

6767
return OK;

0 commit comments

Comments
 (0)