mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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 https://github.com/apache/nuttx-apps/issues/3047 Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
parent
cf1d5bb08b
commit
5d4b720596
2 changed files with 2 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ int foc_feedforward_pmsm_b16(FAR struct motor_phy_params_b16_s *phy,
|
|||
|
||||
vdq_comp->q = -b16mulb16(vel_now,
|
||||
(phy->flux_link + b16mulb16(phy->ind,
|
||||
idq->q)));
|
||||
idq->d)));
|
||||
vdq_comp->d = b16mulb16(b16mulb16(vel_now, phy->ind), idq->q);
|
||||
|
||||
return OK;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ int foc_feedforward_pmsm_f32(FAR struct motor_phy_params_f32_s *phy,
|
|||
* so vq compensation must be negative here.
|
||||
*/
|
||||
|
||||
vdq_comp->q = -vel_now * (phy->flux_link + phy->ind * idq->q);
|
||||
vdq_comp->q = -vel_now * (phy->flux_link + phy->ind * idq->d);
|
||||
vdq_comp->d = vel_now * phy->ind * idq->q;
|
||||
|
||||
return OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue