encoder_off2.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #include "math/fix_math.h"
  2. /* Auto gen by my tools, and use matlab to desing a FIR filter-(MC100/Simulink/Fir_angle.m) */
  3. /* Matlib Command: Fir=Fir_angle; angle_off=filter(Fir.Numerator, 1, angle_in); */
  4. /* angle_in is the data, by plot MC_tools */
  5. /* Use angle_out=single(angle_off) convert double to float */
  6. #define FIR_PHASE_SHIFT 277
  7. const static s16q10_t _encoder_off_map[] = {
  8. 9062,9063,9064,9066,9067,9069,9070,9072,9074,9075,9077,9079,9081,9083,9084,9086,
  9. 9088,9090,9092,9094,9096,9098,9100,9102,9104,9106,9108,9110,9112,9114,9116,9118,9120,9121,9123,9125,
  10. 9127,9128,9130,9132,9133,9135,9136,9138,9139,9140,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,
  11. 9151,9152,9153,9153,9154,9154,9155,9155,9156,9156,9156,9157,9157,9157,9157,9158,9158,9158,9158,9159,
  12. 9159,9159,9159,9160,9160,9160,9161,9161,9161,9162,9162,9163,9164,9164,9165,9166,9167,9168,9169,9171,
  13. 9172,9174,9175,9177,9179,9181,9184,9186,9189,9191,9194,9198,9201,9205,9208,9212,9217,9221,9226,9231,
  14. 9236,9241,9247,9253,9259,9265,9272,9279,9286,9294,9301,9310,9318,9327,9336,9345,9355,9365,9375,9386,
  15. 9397,9408,9420,9432,9444,9457,9470,9483,9497,9510,9525,9539,9554,9570,9586,9602,9618,9635,9652,9669,
  16. 9687,9705,9723,9742,9761,9780,9800,9820,9840,9860,9881,9902,9924,9945,9967,9990,10012,10035,10058,10081,
  17. 10104,10128,10152,10176,10200,10225,10250,10274,10300,10325,10350,10376,10401,10427,10453,10479,10506,10532,10558,10585,
  18. 10611,10638,10665,10691,10718,10745,10772,10799,10826,10852,10879,10906,10933,10959,10986,11013,11039,11066,11092,11118,
  19. 11145,11171,11197,11223,11248,11274,11299,11325,11350,11375,11399,11424,11448,11472,11496,11520,11544,11567,11590,11613,
  20. 11636,11658,11680,11702,11724,11745,11766,11787,11807,11828,11848,11867,11887,11906,11925,11943,11961,11979,11997,12014,
  21. 12031,12048,12064,12080,12096,12112,12127,12141,12156,12170,12184,12198,12211,12224,12236,12249,12261,12272,12284,12295,
  22. 12306,12316,12327,12336,12346,12355,12365,12373,12382,12390,12398,12406,12413,12420,12427,12434,12440,12446,12452,12458,
  23. 12463,12468,12473,12478,12482,12486,12490,12494,12497,12500,12504,12506,12509,12512,12514,12516,12518,12519,12521,12522,
  24. 12523,12524,12525,12525,12526,12526,12526,12526,12526,12525,12525,12524,12523,12522,12521,12519,12518,12516,12514,12512,
  25. 12510,12507,12505,12502,12499,12496,12493,12490,12487,12483,12479,12475,12471,12467,12463,12459,12454,12449,12445,12440,
  26. 12434,12429,12424,12418,12412,12406,12400,12394,12388,12381,12375,12368,12361,12354,12347,12339,12331,12324,12316,12308,
  27. 12300,12291,12283,12274,12265,12256,12247,12237,12228,12218,12208,12198,12188,12178,12167,12156,12146,12135,12123,12112,
  28. 12101,12089,12077,12065,12053,12041,12028,12015,12003,11990,11977,11963,11950,11936,11923,11909,11895,11881,11867,11852,
  29. 11838,11823,11809,11794,11779,11764,11749,11733,11718,11702,11686,11671,11655,11639,11623,11607,11591,11575,11558,11542,
  30. 11526,11509,11493,11476,11459,11443,11426,11409,11392,11375,11359,11342,11325,11308,11291,11274,11257,11240,11223,11206,
  31. 11190,11173,11156,11139,11122,11106,11089,11072,11055,11039,11022,11006,10989,10973,10956,10940,10924,10908,10892,10875,
  32. 10859,10844,10828,10812,10796,10781,10765,10750,10734,10719,10704,10689,10673,10658,10644,10629,10614,10599,10585,10570,
  33. 10556,10541,10527,10513,10499,10485,10471,10457,10443,10429,10415,10401,10388,10374,10361,10347,10334,10320,10307,10294,
  34. 10280,10267,10254,10241,10227,10214,10201,10188,10175,10162,10149,10136,10123,10109,10096,10083,10070,10057,10044,10030,
  35. 10017,10004,9991,9977,9964,9951,9937,9924,9910,9897,9883,9869,9855,9841,9828,9814,9799,9785,9771,9757,
  36. 9743,9728,9714,9699,9685,9670,9655,9640,9626,9611,9596,9580,9565,9550,9535,9519,9504,9488,9473,9457,
  37. 9442,9426,9410,9394,9378,9363,9347,9331,9315,9299,9283,9267,9251,9235,9219,9203,9186,9171,9155,9138,
  38. 9122,9106,9091,9075,9059,9043,9027,9012,8996,8981,8966,8950,8935,8920,8905,8890,8875,8861,8847,8832,
  39. 8818,8804,8791,8777,8764,8750,8737,8725,8712,8700,8688,8676,8664,8653,8642,8631,8621,8610,8600,8591,
  40. 8581,8572,8563,8555,8546,8538,8531,8524,8517,8510,8504,8498,8492,8487,8482,8478,8474,8470,8466,8463,
  41. 8461,8458,8456,8455,8454,8453,8452,8452,8453,8453,8454,8456,8458,8460,8462,8465,8468,8472,8476,8480,
  42. 8485,8490,8495,8501,8507,8513,8520,8527,8534,8542,8550,8558,8567,8576,8585,8594,8604,8614,8624,8635,
  43. 8646,8657,8668,8679,8691,8703,8715,8727,8739,8752,8765,8778,8791,8804,8818,8832,8845,8859,8873,8887,
  44. 8901,8916,8930,8944,8959,8973,8988,9002,9017,9031,9046,9060,9075,9090,9104,9119,9133,9148,9162,9176,
  45. 9191,9205,9219,9233,9247,9261,9275,9288,9302,9315,9329,9342,9355,9367,9380,9393,9405,9417,9429,9441,
  46. 9453,9465,9476,9487,9498,9509,9519,9530,9540,9550,9560,9569,9579,9588,9597,9606,9614,9623,9631,9639,
  47. 9647,9654,9661,9668,9675,9682,9688,9695,9701,9707,9712,9718,9723,9728,9733,9738,9742,9746,9750,9754,
  48. 9758,9762,9765,9768,9771,9774,9777,9779,9782,9784,9786,9788,9789,9791,9792,9794,9795,9796,9797,9797,
  49. 9798,9798,9799,9799,9799,9799,9799,9799,9799,9798,9798,9797,9797,9796,9795,9794,9793,9792,9791,9789,
  50. 9788,9787,9785,9784,9782,9780,9779,9777,9775,9773,9771,9769,9767,9765,9762,9760,9758,9755,9753,9750,
  51. 9748,9745,9743,9740,9737,9734,9732,9729,9726,9723,9720,9717,9713,9710,9707,9704,9700,9697,9693,9690,
  52. 9686,9683,9679,9675,9671,9667,9664,9660,9656,9651,9647,9643,9639,9634,9630,9625,9621,9616,9612,9607,
  53. 9602,9597,9592,9587,9582,9577,9572,9567,9562,9556,9551,9545,9540,9534,9529,9523,9517,9511,9505,9500,
  54. 9494,9488,9481,9475,9469,9463,9457,9450,9444,9438,9431,9425,9419,9412,9406,9399,9393,9386,9380,9373,
  55. 9366,9360,9353,9347,9340,9333,9327,9320,9314,9307,9301,9294,9288,9281,9275,9268,9262,9256,9249,9243,
  56. 9237,9231,9225,9219,9213,9207,9202,9196,9190,9185,9180,9174,9169,9164,9159,9154,9149,9144,9140,9135,
  57. 9131,9126,9122,9118,9114,9110,9106,9103,9099,9096,9093,9090,9087,9084,9081,9079,9076,9074,9072,9070,
  58. 9068,9066,9064,9063,9061,9060,9059,9058,9057,9056,9055,9055,9055,9054,9054,9054,9054,9054,9054,9055,
  59. 9055,9056,9056,9057,9058,9059,9060,9061,9062,9063,9064,9066,9067,9069,9070,9072,9074,9075,9077,9079,
  60. 9081,9083,9084,9086,9088,9090,9092,9094,9096,9098,9100,9102,9104,9106,9108,9110,9112,9114,9116,9118,
  61. 9120,9121,9123,9125,9127,9128,9130,9132,9133,9135,9136,9138,9139,9140,9142,9143,9144,9145,9146,9147,
  62. 9148,9149,9150,9151,9151,9152,9153,9153,9154,9154,9155,9155,9156,9156,9156,9157,9157,9157,9157,9158,
  63. 9158,9158,9158,9159,9159,9159,9159,9160,9160,9160,9161,9161,9161,9162,9162,9163,9164,9164,9165,9166,
  64. 9167,9168,9169,9171,9172,9174,9175,9177,9179,9181,9184,9186,9189,9191,9194,9198,9201,9205,9208,9212,
  65. 9217,9221,9226,9231,9236,9241,9247,9253,9259,9265,9272,9279,9286,9294,9301,9310,9318,9327,9336,9345,
  66. 9355,9365,9375,9386,9397,9408,9420,9432,9444,9457,9470,9483,9497,9510,9525,9539,9554,9570,9586,9602,
  67. 9618,9635,9652,9669,9687,9705,9723,9742,9761,9780,9800,9820,9840,9860,9881,9902,9924,9945,9967,9990,
  68. 10012,10035,10058,10081,10104,10128,10152,10176,10200,10225,10250,10274,10300,10325,10350,10376,10401,10427,10453,10479,
  69. 10506,10532,10558,10585,10611,10638,10665,10691,10718,10745,10772,10799,10826,10852,10879,10906,10933,10959,10986,11013,
  70. 11039,11066,11092,11118,11145,11171,11197,11223,11248,11274,11299,11325,11350,11375,11399,11424,11448,11472,11496,11520,
  71. 11544,11567,11590,11613,11636,11658,11680,11702,11724,11745,11766,11787,11807,11828,11848,11867,11887,11906,11925,11943,
  72. 11961,11979,11997,12014,12031,12048,12064,12080,12096,12112,12127,12141,12156,12170,12184,12198,12211,12224,12236,12249,
  73. 12261,12272,12284,12295,12306,12316,12327,12336,12346,12355,12365,12373,12382,12390,12398,12406,12413,12420,12427,12434,
  74. 12440,12446,12452,12458,12463,12468,12473,12478,12482,12486,12490,12494,12497,12500,12504,12506,12509,12512,12514,12516,
  75. 12518,12519,12521,12522,12523,12524,12525,12525,12526,12526,12526,12526,12526,12525,12525,12524,12523,12522,12521,12519,
  76. 12518,12516,12514,12512,12510,12507,12505,12502,12499,12496,12493,12490,12487,12483,12479,12475,12471,12467,12463,12459,
  77. 12454,12449,12445,12440,12434,12429,12424,12418,12412,12406,12400,12394,12388,12381,12375,12368,12361,12354,12347,12339,
  78. 12331,12324,12316,12308,12300,12291,12283,12274,12265,12256,12247,12237,12228,12218,12208,12198,12188,12178,12167,12156,
  79. 12146,12135,12123,12112,12101,12089,12077,12065,12053,12041,12028,12015,12003,11990,11977,11963,11950,11936,11923,11909,
  80. 11895,11881,11867,11852,11838,11823,11809,11794,11779,11764,11749,11733,11718,11702,11686,11671,11655,11639,11623,11607,
  81. 11591,11575,11558,11542,11526,11509,11493,11476,11459,11443,11426,11409,11392,11375,11359,11342,11325,11308,11291,11274,
  82. 11257,11240,11223,11206,11190,11173,11156,11139,11122,11106,11089,11072,11055,11039,11022,11006,10989,10973,10956,10940,
  83. 10924,10908,10892,10875,10859,10844,10828,10812,10796,10781,10765,10750,10734,10719,10704,10689,10673,10658,10644,10629,
  84. 10614,10599,10585,10570,10556,10541,10527,10513,10499,10485,10471,10457,10443,10429,10415,10401,10388,10374,10361,10347,
  85. 10334,10320,10307,10294,10280,10267,10254,10241,10227,10214,10201,10188,10175,10162,10149,10136,10123,10109,10096,10083,
  86. 10070,10057,10044,10030,10017,10004,9991,9977,9964,9951,9937,9924,9910,9897,9883,9869,9855,9841,9828,9814,
  87. 9799,9785,9771,9757,9743,9728,9714,9699,9685,9670,9655,9640,9626,9611,9596,9580,9565,9550,9535,9519,
  88. 9504,9488,9473,9457,9442,9426,9410,9394,9378,9363,9347,9331,9315,9299,9283,9267,9251,9235,9219,9203,
  89. 9186,9171,9155,9138,9122,9106,9091,9075,9059,9043,9027,9012,8996,8981,8966,8950,8935,8920,8905,8890,
  90. 8875,8861,8847,8832,8818,8804,8791,8777,8764,8750,8737,8725,8712,8700,8688,8676,8664,8653,8642,8631,
  91. 8621,8610,8600,8591,8581,8572,8563,8555,8546,8538,8531,8524,8517,8510,8504,8498,8492,8487,8482,8478,
  92. 8474,8470,8466,8463,8461,8458,8456,8455,8454,8453,8452,8452,8453,8453,8454,8456,8458,8460,8462,8465,
  93. 8468,8472,8476,8480,8485,8490,8495,8501,8507,8513,8520,8527,8534,8542,8550,8558,8567,8576,8585,8594,
  94. 8604,8614,8624,8635,8646,8657,8668,8679,8691,8703,8715,8727,8739,8752,8765,8778,8791,8804,8818,8832,
  95. 8845,8859,8873,8887,8901,8916,8930,8944,8959,8973,8988,9002,9017,9031,9046,9060,9075,9090,9104,9119,
  96. 9133,9148,9162,9176,9191,9205,9219,9233,9247,9261,9275,9288,9302,9315,9329,9342,9355,9367,9380,9393,
  97. 9405,9417,9429,9441,9453,9465,9476,9487,9498,9509,9519,9530,9540,9550,9560,9569,9579,9588,9597,9606,
  98. 9614,9623,9631,9639,9647,9654,9661,9668,9675,9682,9688,9695,9701,9707,9712,9718,9723,9728,9733,9738,
  99. 9742,9746,9750,9754,9758,9762,9765,9768,9771,9774,9777,9779,9782,9784,9786,9788,9789,9791,9792,9794,
  100. 9795,9796,9797,9797,9798,9798,9799,9799,9799,9799,9799,9799,9799,9798,9798,9797,9797,9796,9795,9794,
  101. 9793,9792,9791,9789,9788,9787,9785,9784,9782,9780,9779,9777,9775,9773,9771,9769,9767,9765,9762,9760,
  102. 9758,9755,9753,9750,9748,9745,9743,9740,9737,9734,9732,9729,9726,9723,9720,9717,9713,9710,9707,9704,
  103. 9700,9697,9693,9690,9686,9683,9679,9675,9671,9667,9664,9660,9656,9651,9647,9643,9639,9634,9630,9625,
  104. 9621,9616,9612,9607,9602,9597,9592,9587,9582,9577,9572,9567,9562,9556,9551,9545,9540,9534,9529,9523,
  105. 9517,9511,9505,9500,9494,9488,9481,9475,9469,9463,9457,9450,9444,9438,9431,9425,9419,9412,9406,9399,
  106. 9393,9386,9380,9373,9366,9360,9353,9347,9340,9333,9327,9320,9314,9307,9301,9294,9288,9281,9275,9268,
  107. 9262,9256,9249,9243,9237,9231,9225,9219,9213,9207,9202,9196,9190,9185,9180,9174,9169,9164,9159,9154,
  108. 9149,9144,9140,9135,9131,9126,9122,9118,9114,9110,9106,9103,9099,9096,9093,9090,9087,9084,9081,9079,
  109. 9076,9074,9072,9070,9068,9066,9064,9063,9061,9060,9059,9058,9057,9056,9055,9055,9055,9054,9054,9054,
  110. 9054,9054,9054,9055,9055,9056,9056,9057,9058,9059,9060,9061,
  111. };