/* sine_array: Fixed size int array representing the sine function values multiplied by 10000. It is used to approximate sine calculation. _sin: Function approximating the sine calculation by using sine_array. It receives an angle in between 0 and 2PI and returns the sine value. It has two optimized versions: one using a float array and another using an int array. The latter is faster. _cos: Function approximating the cosine calculation by using sine_array. It receives an angle in between 0 and 2PI and returns the cosine value. It first calculates the sine value and then returns its value with an angle of +90 degrees. _normalizeAngle: Function normalizing a radian angle to the range [0,2PI]. It receives an angle and returns the angle within the specified range. _electricalAngle: Function calculating the electrical angle given the mechanical shaft angle and the number of pole pairs. It multiplies the mechanical angle by the number of pole pairs. _sqrtApprox: Function approximating the square root calculation using the fast inverse square root algorithm. It receives a number and returns an approximate value of its square root. *

给下面的C语言函数添加注释#include mathh#include FOC_utilsh int array instead of float array 4x200 points per 360 deg 2x storage save int 2Byte float 4 Byte sin10000const int sine_array200 = 079158237316395473552

原文地址: https://www.cveoy.top/t/topic/e81m 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录