cancel
Showing results for 
Search instead for 
Did you mean: 

Information on the C code procedure SPD_GetAvrgMecSpeedUnit ?

BTrem.1
Senior II

In the FOC motor code the average mechanical motor speed is returned by procedure SPD_GetAvrgMecSpeedUnit which simply returns a value pointed at. I'd like to know the details of how the average is done and over what period of time and what sample rate. I believe it may be using a define STO_FIFO_DEPTH_UNIT from drive_parameters.h but am not sure of this.

Any documentation or discussion of this would be helpful to my project.

Thanks,

Brian

1 REPLY 1
Laurent Ca...
Lead II

Dear @BTrem.1​ 

According to the source code of the function STO_PLL_CalcAvrgMecSpeedUnit this is a very classic averaging (ie: sum of measures / number of measures).

I think that yes indeed this function uses STO_FIFO_DEPTH_UNIT, which seems to be equal to STO_FIFO_DEPTH_01HZ, which is set to 64 (see docs/data_set_reference.txt).

Please check "Best answer" if this answers to your question.

Best regards