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
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.