KMS read estimator module outputs from code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KMS read estimator module outputs from code

582 Views
akobyl
Contributor I

Hello,

I am trying to access the sensorless estimator's output speed from my main loop but I could not easily find how to do this since the est data structure is static inside drv.c.

I added a simple function inside drv.c which returns the speed estimation variable but is there a preferred method to accomplish this?  

Thanks

Labels (1)
0 Kudos
1 Reply

437 Views
linestream-adam
Senior Contributor I

Andy,

There isn't a preferred method of accessing those variables. Your method will work just fine. The alternative would be to remove the static from the EST_t est declaration and extern access the variable.

It will depend on how you want to setup the data accesses in your project.

That being said, I think it is better to use functions similar to what you did instead of allowing extern access to the motor control structures.