You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/13 13:25:28 UTC

[GitHub] [incubator-nuttx] raiden00pl opened a new pull request #5483: libdsp: improvements for lib_observer.c

raiden00pl opened a new pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483


   ## Summary
   The main motivation of these changes is to improve modularity and enable various combinations of the motor controller logic.
   
   - libdsp/lib_observer.c: separate angle observer from speed observer
   They can be used completely independently, so they should'n be coupled.
   For example, a sensored motor controller in speed control mode doesn't need an angle estimator.
   
   - libdsp/lib_observer.c: update some comments
   The angle observer always refer to a motor electrical angle,
   while the speed observer can be applied to a motor electrical speed or a motor mechanical speed.
   
   - libdsp/lib_observer.c: remove dir argument from motor_sobserver_div as we can automatically detect the direction of movement
   
   ## Impact
   Breaking change for code that uses previous observer interfaces.
   Not used yet in NuttX repositories.
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483#discussion_r806142300



##########
File path: include/dsp.h
##########
@@ -529,31 +535,32 @@ void foc_vdq_mag_max_get(FAR struct foc_data_f32_s *foc, FAR float *max);
 
 /* BLDC/PMSM motor observers */
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per);
-float motor_observer_speed_get(FAR struct motor_observer_f32_s *o);
-float motor_observer_angle_get(FAR struct motor_observer_f32_s *o);
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per);
+void motor_aobserver_init(FAR struct motor_aobserver_f32_s *observer,
+                           FAR void *ao, float per);

Review comment:
       ```suggestion
   void motor_aobserver_init(FAR struct motor_aobserver_f32_s *observer,
                             FAR void *ao, float per);
   ```

##########
File path: include/dsp.h
##########
@@ -529,31 +535,32 @@ void foc_vdq_mag_max_get(FAR struct foc_data_f32_s *foc, FAR float *max);
 
 /* BLDC/PMSM motor observers */
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per);
-float motor_observer_speed_get(FAR struct motor_observer_f32_s *o);
-float motor_observer_angle_get(FAR struct motor_observer_f32_s *o);
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per);
+void motor_aobserver_init(FAR struct motor_aobserver_f32_s *observer,
+                           FAR void *ao, float per);
+float motor_sobserver_speed_get(FAR struct motor_sobserver_f32_s *o);
+float motor_aobserver_angle_get(FAR struct motor_aobserver_f32_s *o);
 
-void motor_observer_smo_init(FAR struct motor_observer_smo_f32_s *smo,
-                             float kslide, float err_max);
-void motor_observer_smo(FAR struct motor_observer_f32_s *o,
-                        FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
-                        FAR struct motor_phy_params_f32_s *phy, float dir);
+void motor_aobserver_smo_init(FAR struct motor_aobserver_smo_f32_s *smo,
+                              float kslide, float err_max);
+void motor_aobserver_smo(FAR struct motor_aobserver_f32_s *o,
+                         FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
+                         FAR struct motor_phy_params_f32_s *phy, float dir,
+                         float speed);
 
 void motor_sobserver_div_init(FAR struct motor_sobserver_div_f32_s *so,
                               uint8_t samples, float filer, float per);
-void motor_sobserver_div(FAR struct motor_observer_f32_s *o,
-                         float angle, float dir);
+void motor_sobserver_div(FAR struct motor_sobserver_f32_s *o, float angle);
 
-void motor_observer_nfo_init(FAR struct motor_observer_nfo_f32_s *nfo);
-void motor_observer_nfo(FAR struct motor_observer_f32_s *o,
+void motor_aobserver_nfo_init(FAR struct motor_aobserver_nfo_f32_s *nfo);
+void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                         FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                         FAR struct motor_phy_params_f32_s *phy, float gain);

Review comment:
       ```suggestion
   void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                            FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                            FAR struct motor_phy_params_f32_s *phy, float gain);
   ```

##########
File path: libs/libdsp/lib_observer.c
##########
@@ -547,12 +571,12 @@ void motor_observer_nfo_init(FAR struct motor_observer_nfo_f32_s *nfo)
  *
  ****************************************************************************/
 
-void motor_observer_nfo(FAR struct motor_observer_f32_s *o,
+void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                         FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                         FAR struct motor_phy_params_f32_s *phy, float gain)

Review comment:
       ```suggestion
   void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                            FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                            FAR struct motor_phy_params_f32_s *phy, float gain)
   ```

##########
File path: include/dsp.h
##########
@@ -529,31 +535,32 @@ void foc_vdq_mag_max_get(FAR struct foc_data_f32_s *foc, FAR float *max);
 
 /* BLDC/PMSM motor observers */
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per);
-float motor_observer_speed_get(FAR struct motor_observer_f32_s *o);
-float motor_observer_angle_get(FAR struct motor_observer_f32_s *o);
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per);

Review comment:
       ```suggestion
   void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
                             FAR void *so, float per);
   ```

##########
File path: libs/libdsp/lib_observer.c
##########
@@ -61,33 +60,64 @@
  *
  ****************************************************************************/
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per)
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per)

Review comment:
       ```suggestion
   void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
                             FAR void *so, float per)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483#issuecomment-1040693268


   > LGTM!
   > 
   > But seems that CI fails because of some Beta feature "Unchanged files with check annotations"
   
   This is because this patch doesn't rebase the latest mainline, and CI by default check all change from your base to latest mainline plus the new change.
   Anyway, let's ignore the false alarm and merge this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] raiden00pl commented on pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
raiden00pl commented on pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483#issuecomment-1039999463


   @pkarashchenko thx for review. done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483#discussion_r806142300



##########
File path: include/dsp.h
##########
@@ -529,31 +535,32 @@ void foc_vdq_mag_max_get(FAR struct foc_data_f32_s *foc, FAR float *max);
 
 /* BLDC/PMSM motor observers */
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per);
-float motor_observer_speed_get(FAR struct motor_observer_f32_s *o);
-float motor_observer_angle_get(FAR struct motor_observer_f32_s *o);
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per);
+void motor_aobserver_init(FAR struct motor_aobserver_f32_s *observer,
+                           FAR void *ao, float per);

Review comment:
       ```suggestion
   void motor_aobserver_init(FAR struct motor_aobserver_f32_s *observer,
                             FAR void *ao, float per);
   ```

##########
File path: include/dsp.h
##########
@@ -529,31 +535,32 @@ void foc_vdq_mag_max_get(FAR struct foc_data_f32_s *foc, FAR float *max);
 
 /* BLDC/PMSM motor observers */
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per);
-float motor_observer_speed_get(FAR struct motor_observer_f32_s *o);
-float motor_observer_angle_get(FAR struct motor_observer_f32_s *o);
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per);
+void motor_aobserver_init(FAR struct motor_aobserver_f32_s *observer,
+                           FAR void *ao, float per);
+float motor_sobserver_speed_get(FAR struct motor_sobserver_f32_s *o);
+float motor_aobserver_angle_get(FAR struct motor_aobserver_f32_s *o);
 
-void motor_observer_smo_init(FAR struct motor_observer_smo_f32_s *smo,
-                             float kslide, float err_max);
-void motor_observer_smo(FAR struct motor_observer_f32_s *o,
-                        FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
-                        FAR struct motor_phy_params_f32_s *phy, float dir);
+void motor_aobserver_smo_init(FAR struct motor_aobserver_smo_f32_s *smo,
+                              float kslide, float err_max);
+void motor_aobserver_smo(FAR struct motor_aobserver_f32_s *o,
+                         FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
+                         FAR struct motor_phy_params_f32_s *phy, float dir,
+                         float speed);
 
 void motor_sobserver_div_init(FAR struct motor_sobserver_div_f32_s *so,
                               uint8_t samples, float filer, float per);
-void motor_sobserver_div(FAR struct motor_observer_f32_s *o,
-                         float angle, float dir);
+void motor_sobserver_div(FAR struct motor_sobserver_f32_s *o, float angle);
 
-void motor_observer_nfo_init(FAR struct motor_observer_nfo_f32_s *nfo);
-void motor_observer_nfo(FAR struct motor_observer_f32_s *o,
+void motor_aobserver_nfo_init(FAR struct motor_aobserver_nfo_f32_s *nfo);
+void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                         FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                         FAR struct motor_phy_params_f32_s *phy, float gain);

Review comment:
       ```suggestion
   void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                            FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                            FAR struct motor_phy_params_f32_s *phy, float gain);
   ```

##########
File path: libs/libdsp/lib_observer.c
##########
@@ -547,12 +571,12 @@ void motor_observer_nfo_init(FAR struct motor_observer_nfo_f32_s *nfo)
  *
  ****************************************************************************/
 
-void motor_observer_nfo(FAR struct motor_observer_f32_s *o,
+void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                         FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                         FAR struct motor_phy_params_f32_s *phy, float gain)

Review comment:
       ```suggestion
   void motor_aobserver_nfo(FAR struct motor_aobserver_f32_s *o,
                            FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab,
                            FAR struct motor_phy_params_f32_s *phy, float gain)
   ```

##########
File path: include/dsp.h
##########
@@ -529,31 +535,32 @@ void foc_vdq_mag_max_get(FAR struct foc_data_f32_s *foc, FAR float *max);
 
 /* BLDC/PMSM motor observers */
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per);
-float motor_observer_speed_get(FAR struct motor_observer_f32_s *o);
-float motor_observer_angle_get(FAR struct motor_observer_f32_s *o);
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per);

Review comment:
       ```suggestion
   void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
                             FAR void *so, float per);
   ```

##########
File path: libs/libdsp/lib_observer.c
##########
@@ -61,33 +60,64 @@
  *
  ****************************************************************************/
 
-void motor_observer_init(FAR struct motor_observer_f32_s *observer,
-                         FAR void *ao, FAR void *so, float per)
+void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
+                         FAR void *so, float per)

Review comment:
       ```suggestion
   void motor_sobserver_init(FAR struct motor_sobserver_f32_s *observer,
                             FAR void *so, float per)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483#issuecomment-1039109878


   Sorry @raiden00pl I think missed to merge this PR before merging #5479


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] raiden00pl commented on pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
raiden00pl commented on pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483#issuecomment-1039260056


   NP. Conflicts solved


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] raiden00pl commented on pull request #5483: libdsp: improvements for lib_observer.c

Posted by GitBox <gi...@apache.org>.
raiden00pl commented on pull request #5483:
URL: https://github.com/apache/incubator-nuttx/pull/5483#issuecomment-1039260056






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org