AssistCurve.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. /**
  2. * @file AssistCurve.c
  3. * @author Zhang, Kai(zhangkai71@midea.com)
  4. * @brief
  5. * @version 0.1
  6. * @date 2021-11-15
  7. *
  8. * @copyright Copyright (c) 2021
  9. *
  10. */
  11. #ifndef ASSISTCURVE_H
  12. #define ASSISTCURVE_H
  13. #include "asr.h"
  14. #include "mathtool.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif // __cplusplus
  18. /****************************************
  19. *
  20. * Definitions & Macros
  21. *
  22. ****************************************/
  23. #define TIMEUNIT 1 // run time unit 1ms
  24. #define CURSWITCH 1// 开关电流斜坡
  25. #define MOTORSPEEDLIMIT_ENABLE 0 // 0-disable,1-enable
  26. #define CURVE_NUM 10 // number of gear
  27. #define GEAR_NUM 6 // number of gear
  28. #define CADENCE_PULSES_PER_CIRC 64
  29. #define TORQUE2PU 1165 // Q20 1<<20/TORQUEBASE = (1<<20)/900
  30. #define BIKE_WHEEL_PERIMETER 219 // CM
  31. #define BIKE_MECH_RATION 35
  32. #define BIKE_SPEED_IQLIMIT_THRESHOLD1 25 // Km/h
  33. #define BIKE_SPEED_IQLIMIT_THRESHOLD2 (BIKE_SPEED_IQLIMIT_THRESHOLD1 + 2) // Km/h
  34. #define BIKE_SPEED_THROTTLE_MAX 25 // Km/h
  35. #define BIKE_SPEED_WALK_MAX 6 // Km/h
  36. #define BIKE_FRONTTEETH_NMB 38 // number
  37. #define BIKE_BACKTEETH_NMB 11 // number
  38. #define BIKE_BACKLIGHT_MODE 2 //mode 1-6
  39. #define BIKE_BACKLIGHT_VOLTAGE 6 //6 or 12V
  40. #define BIKE_FORWARDLEDLIGHT_VOLTAGE 6 //6 or 12V
  41. #define BIKE_LIGHT_PARA ((BIKE_BACKLIGHT_MODE<<12)|(BIKE_BACKLIGHT_VOLTAGE<<8)|BIKE_FORWARDLEDLIGHT_VOLTAGE)
  42. #define BIKE_WHEEL_SIZE_ADJUST 0 //cm
  43. #define BIKE_START_MODE 2 //Normal
  44. #define BIKE_POWERSTART_DELAY_TIME 0 //0.2s
  45. #define BIKE_POWEROFF_DELAY_TIME 0 //0.2s
  46. #define BIKE_AUTO_POWER_OFF_TIME 15 //min
  47. #define BIKE_POWER_PARA ((BIKE_POWERSTART_DELAY_TIME<<12)|(BIKE_POWEROFF_DELAY_TIME<<8)|BIKE_AUTO_POWER_OFF_TIME)
  48. #define BIKE_THROTTLE_SMOOTH_INCREASE 15 //*10
  49. #define BIKE_THROTTLE_SMOOTH_DECREASE 30 //*10
  50. #define BIKE_THROTTLE_SMOOTH ((BIKE_THROTTLE_SMOOTH_INCREASE<<8)|(BIKE_THROTTLE_SMOOTH_DECREASE))
  51. #define BIKE_NONEOBCEBNABLE 0x00 //0xAA-支持,其他不支持
  52. #define BIKE_REARLIGHTCYCLE 8 //低亮尾灯周期
  53. #define BIKE_REARLIGHTDUTY 4 //低亮尾灯占空比
  54. #define BIKE_DELTASPEEDLIMITION 0 //只能是负数
  55. #define BIKE_ASSIST_MODE1 0x0155
  56. #define BIKE_ASSIST_MODE2 0x02AA
  57. #define TORQUE_START_THRESHOLD 70 // 0.1Nm
  58. #define TORQUE_STOP_THRESHOLD 30 // 0.1Nm
  59. #define TORQUE_SWITCH2_THRESHOLD 120 // 0.1Nm
  60. #define TORQUE_SWITCH1_THRESHOLD 100 // 0.1Nm
  61. #define BIKE_ASS_MOTOR_TORQUE_MAX 30 // 0.1Nm
  62. #define BIKE_SPD_MOTOR_CURRENT_MAX 5 /* 电流系数初始值 */
  63. #define BIKE_SPD_MOTOR_CONSTANT_COMMAND 4096 /* 速度波动补偿系数初始值 */
  64. //#define CUR_LIM_DEFAULT \
  65. // { \
  66. // 1024, 512, 716, 870, 1024, 1024 \
  67. // } // 电流0-100% 1-50% 2-70% 3-85% 4-100% 5-100% Q10
  68. #define CUR_LIM_DEFAULT \
  69. { \
  70. 1024, 1024, 1024, 1024, 1024, 1024 \
  71. } // 电流0-100% 1-50% 2-70% 3-85% 4-100% 5-100% Q10
  72. #define ASS_LIM_DEFAULT \
  73. { \
  74. {0, 716, 870, 1024, 1024, 1024}, 0 \
  75. } // Q10 percentage 0 70% 85% 100% 100% 100%
  76. #define TORQUE_CAL_IN_DEFAULT \
  77. { \
  78. 0, 0, 0, 0, 0, 0, 0, 0, 0 \
  79. }
  80. #define START_GAIN_DEFAULT \
  81. { \
  82. 16384, 10240, 6144, 4778, 4096 \
  83. } // Q12
  84. #define ASS_LINER_TORQUE_DEFAULT \
  85. { \
  86. 2048, 2867, 4096, 10000, 2867 \
  87. } // Q12
  88. //#define TORQUE_ASSIST_DEFAULT \
  89. // { \
  90. // 0, 1290, 1228, 91,\
  91. // 0, 2212, 1024, 91,\
  92. // 0, 3355, 819, 91, \
  93. // 0, 4792, 614, 0,\
  94. // 0, 6636, 409, 0,\
  95. // 0, 8478, 409, 0,\
  96. // 0, 11059, 0, 0,\
  97. // 0, 13639, 0, 0, \
  98. // 0, 16957, 0, 0,\
  99. // 0, 22118, 0, 0,\
  100. // 16589, 22118, 0, 0,\
  101. // 33178, 25805, 0, 0, \
  102. // 66355, 29491, 0, 0, \
  103. // 132710, 29491, 0, 0,\
  104. // 232243, 29491, 0, 0 \
  105. // }
  106. #define TORQUE_ASSIST_DEFAULT \
  107. { \
  108. 0, 0, 2048, 137,\
  109. 0, 0, 2458, 137,\
  110. 0, 0, 2867, 137, \
  111. 0, 7004, 410, 273,\
  112. 0, 8663, 410, 273,\
  113. 0, 10506, 410, 273,\
  114. 9953, 16957, 0, 273,\
  115. 16589, 21012, 0, 273, \
  116. 36495, 22856, 0, 273,\
  117. 82944, 29491, 0, 137,\
  118. 149299, 29491, 0, 137,\
  119. 232243, 29491, 0, 137, \
  120. 82944, 29491, 0, -683,\
  121. 149299, 29491, 0, -683,\
  122. 232243, 29491, 0, -683, \
  123. }
  124. #define CADENCE_ASSIST_DEFAULT \
  125. { \
  126. 0, 0, 10000, 0, 0, 0, 10000, 0, 0, 0, 10000, 0, 0, 0, 10000, 0, 0, 0, 10000, 0 \
  127. }
  128. #define TORQUR_ASSIST_BASE M_IS_PEAK_MAX_AP //5500 // Maximum Current
  129. #define TORQUR_CP(x) ((ULONG)(x)*M_IS_PEAK_MAX_AP /TORQUR_ASSIST_BASE)
  130. #define TORQUE_ASSIST_DEFAULT2 \
  131. { \
  132. TORQUR_CP(10), TORQUR_CP(50), TORQUR_CP(200), 100,\
  133. TORQUR_CP(30), TORQUR_CP(80), TORQUR_CP(350), 100,\
  134. TORQUR_CP(50), TORQUR_CP(120), TORQUR_CP(600), 100, \
  135. TORQUR_CP(70), TORQUR_CP(260), TORQUR_CP(1200), 100,\
  136. TORQUR_CP(10), TORQUR_CP(90), TORQUR_CP(800), 100,\
  137. 0, 0, 0, 0,\
  138. 0, 0, 0, 0,\
  139. 0, 0, 0, 0,\
  140. 0, 0, 0, 0,\
  141. 0, 0, 0, 0,\
  142. 0, 0, 0, 0,\
  143. 0, 0, 0, 0,\
  144. 0, 0, 0, 0,\
  145. 0, 0, 0, 0,\
  146. 0, 0, 0, 0,\
  147. }// Y1, Y2, Y3, Z 单位:0.1 Nm
  148. #define ASS_CURVE_X1 30 // 单位:0.1Nm
  149. #define ASS_CURVE_X2 100 // 单位:0.1Nm
  150. #define ASS_CURVE_X3 300 // 单位:0.1Nm
  151. #define ASSISTMOD_SELECT_DEFAULT 0x0000
  152. //////////////////////////////// just for Assist Module It may has bug when u used in other Module//////////////
  153. #define TIME_MS2CNT(X) ((ULONG)(X) / TIMEUNIT) // X unit:ms
  154. #define PERCENT30(x) (((ULONG)(x)*300) >> 10) // X is variable needed to percentage
  155. #define PERCENT50(x) (((ULONG)(x)*500) >> 10) // X is variable needed to percentage
  156. #define Q12_1 4096 // Q12(1)=4096
  157. #define Q14_1 16384 // Q14(1)=16384
  158. /***************************************
  159. *
  160. * Type Definations
  161. *
  162. ***************************************/
  163. /**
  164. * @brief Assist Curve
  165. * Y = a*X^3 + b*X^2 + c*x +d
  166. */
  167. typedef struct
  168. {
  169. SLONG slY1; // 助力曲线点位坐标(X1,Y1)输入X1输出Y1 配置值 单位:0.1Nm
  170. SLONG slY2; // 助力曲线点位坐标(X2,Y2)输入X1输出Y2 配置值 单位:0.1Nm
  171. SLONG slY3; // 助力曲线点位坐标(X3,Y3)输入X1输出Y3 配置值 单位:0.1Nm
  172. SLONG slZ; // 线性段与二次曲线切换点, 配置值 单位:0.1Nm
  173. } ASS_CURVE_PREMETER;
  174. /**
  175. * @brief Assist Curve coefficient
  176. * Y = k1*x+b x< Z
  177. * Y =k1*x+k2*(x-Z)^2+b x>= Z
  178. */
  179. typedef struct
  180. {
  181. SWORD swk1; // Q10 k1 =(y2-y1)/(x2-x1)
  182. SWORD swb; // Q0 b = y2-k2*x1
  183. SWORD swk2; // Q20 k2 = (y3-k1*x3-b)/(x3-Z)^2
  184. SWORD swZ; // Q14
  185. } ASS_CURVE_COEF;
  186. /**
  187. * @brief Assist Curve compenssation coefficient
  188. *
  189. */
  190. typedef struct
  191. {
  192. SWORD swKLow; // Q12
  193. SWORD swKHigh; // Q12
  194. } ASS_CURVE_COMP_COEF;
  195. /**
  196. * @brief Polynomial coefficient
  197. * Y = a*X^3 + b*X^2 + c*x +d
  198. *
  199. */
  200. typedef struct
  201. {
  202. SLONG a; // Q12
  203. SLONG b; // Q12
  204. SLONG c; // Q12
  205. SLONG d; // Q12
  206. } POLY_COEF;
  207. /**
  208. * @brief Polynomial coefficient
  209. * Y = z*(x-h)^2 + k
  210. *
  211. */
  212. typedef struct
  213. {
  214. SLONG z; // Q12
  215. SLONG h; // Q12
  216. SLONG k; // Q12
  217. } ORIG_COEF;
  218. /**
  219. * @brief Type of Assist FSM
  220. *
  221. */
  222. typedef enum
  223. {
  224. Startup = 0,
  225. TorqueAssit = 1,
  226. SpeedAssit = 2,
  227. Spd2Torq = 3,
  228. StartupCruise = 4,
  229. StopAssit = 5,
  230. ReduceCurrent = 6,
  231. Prepare = 7
  232. } ASS_FSM_STATUS;
  233. /**
  234. * @brief AssistCurve Para Configure of Bike
  235. *
  236. */
  237. typedef struct
  238. {
  239. // Bike info
  240. UWORD uwWheelPerimeter; // Q0 0.1cm
  241. UWORD uwMechRationMotor;
  242. UWORD uwThrottleMaxSpdKmH;
  243. UWORD uwCartSpdKmH;
  244. UWORD uwNmFrontChainring;
  245. UWORD uwNmBackChainring;
  246. UWORD uwAssistSelect1;
  247. UWORD uwAssistSelect2;
  248. UWORD uwLightVoltage;
  249. SWORD swDeltPerimeter;
  250. UWORD uwStartMode;
  251. UWORD uwAutoPowerOffTime;
  252. UWORD uwThrottleSmooth;
  253. UWORD uwNoneOBCEnable;
  254. UWORD uwRearLightCycle;
  255. UWORD uwRearLightDuty;
  256. SWORD swDeltaBikeSpeedLimit;
  257. // SWORD swAlmMotorOverHeatCeVal;
  258. // SWORD swAlmMotorOverHeatTM;
  259. // SWORD swAlmPwrLimitMotorStartTempVal;
  260. UWORD uwControlFunEN;
  261. UWORD uwThrottleGearEN;
  262. UWORD uwCadPulsePerCirc;
  263. UWORD uwBikeAssTorMaxPu;
  264. // Drive info
  265. UWORD uwMotorPoles;
  266. UWORD uwCofCurMaxPu; // Q14,allowed max Current
  267. UWORD uwCofTorMaxPu; // Q14,allowed max Torque
  268. } ASS_PARA_CONFIGURE;
  269. /**
  270. * @brief AssistCurve Para Set From extern
  271. *
  272. */
  273. typedef struct
  274. {
  275. UWORD uwStartupCoef; // Q12 assist gain during startup
  276. UWORD uwStartupCruiseCoef;
  277. UWORD uwAssistStartNm;
  278. UWORD uwAssistStopNm;
  279. UWORD uwStartUpGainStep;
  280. UWORD uwStartUpCadNm;
  281. UWORD uwTorLPFCadNm;
  282. UWORD uwSpeedAssistSpdRpm;
  283. UWORD uwSpeedAssistIMaxA;
  284. UWORD uwAssistLimitBikeSpdStart;
  285. UWORD uwAssistLimitBikeSpdStop;
  286. UWORD uwCadenceWeight; // Q12 0-4094 Cadence sensor assist weight of the whole assist current��the torque weight = 4096 - uwTorWeight
  287. UWORD uwTorWeight; // Q12 0-4094
  288. UWORD uwTorAssAjstGain; // Q12 0-4094
  289. UWORD uwCadenceAssAjstGain; // Q12 0-4094
  290. UWORD uwAsssistSelectNum;
  291. UWORD uwSpdRegion[3]; // Q15 MOTOR SPEED
  292. UWORD uwSpdRegionGain[3]; // Q12 0-4094
  293. } ASS_PARA_SET;
  294. /**
  295. * @brief AssistCurve persentage input
  296. *
  297. */
  298. typedef struct
  299. {
  300. UWORD uwGearSt; // Assist Gear
  301. SWORD swDirection; // Motor direction
  302. UWORD uwtorque;
  303. UWORD uwtorquelpf;
  304. UWORD uwtorquePer; // Q15, Torque sensor output persentage Tmax = 80Nm
  305. UWORD uwcadancePer; // Q15, Cadance output persentage Fmax = 5Hz
  306. UWORD uwcadance; // Q20, Cadance frequency
  307. UWORD uwcadancelast; // Q20, last step Cadance frequency
  308. UWORD uwcadanceFWCnt; // Cadance pulse count number
  309. UWORD uwbikespeed; // Q20, bikespeed hz
  310. UWORD uwSpdFbkAbsPu; // Q15, bikespeed hz
  311. SWORD swSpdFbkPu;
  312. UWORD uwBaseSpdrpm;
  313. SWORD swFlxIqLimit; // Q14
  314. SWORD swPwrIqLimit; // Q14
  315. UWORD SOCValue;
  316. SWORD swCurFdbPu; //Q14
  317. SWORD swCurRefPu;
  318. } ASS_PER_IN;
  319. typedef struct
  320. {
  321. POLY_COEF uwTorqueAssGain[GEAR_NUM];
  322. POLY_COEF uwCadencAsseGain[GEAR_NUM];
  323. ASS_CURVE_PREMETER slAssCurPre[CURVE_NUM];
  324. ASS_CURVE_COEF swAssCurCoef[CURVE_NUM];
  325. ASS_CURVE_COMP_COEF swAssCompCoef;
  326. UWORD uwAssCurvGain;
  327. UWORD uwAssistCurveGain; //根据电机最大电流调整助力曲线
  328. UBYTE ucAssistRatioGain[5];
  329. UBYTE ucAssistAccelerationGain[5];
  330. UBYTE ucMaxCurrentGain[5];
  331. UBYTE ucMaxTorqueGain[5];
  332. UWORD uwStartupGain;
  333. UWORD uwStartupCruiseGain; // Q12 assist gain during startup cruise
  334. SWORD swCoefStep;
  335. UWORD uwSpeedAssistIMaxA;
  336. UWORD uwAssThreshold;
  337. UWORD uwAssStopThreshold;
  338. UWORD StartFlag;
  339. SWORD swSmoothGain; // Q12
  340. SWORD swSmoothStopGain; /* 停机电流系数 */
  341. UWORD uwStartUpGainAddStep; // Q12
  342. UWORD uwStartUpTargetGain; // Q12
  343. UWORD uwStartUpTimeCadenceCnt;
  344. UWORD uwSwitch2TorqThreshold;
  345. UWORD uwSwitch1TorqThreshold;
  346. ULONG ulStartupDeltInv;
  347. SWORD swTorqFilterGain; // Q14 Torque filter change from lpf to move average filter
  348. SWORD swCadanceGain;
  349. UWORD uwCadencePeriodCNT;
  350. SWORD swCadanceCNT;
  351. SWORD sw2StopCNT;
  352. SWORD swAss2SpdCNT;
  353. UWORD uwSpeedConstantCommand;
  354. UWORD swSpdLoopAbsCurMax;
  355. SWORD swSpeedlimtrpm;
  356. SWORD swBikeSpeedGain;
  357. SWORD swMotorSpeedGain;
  358. UWORD uwCurrentMaxPu;
  359. SWORD swCurrentmax_torAssPu;
  360. SWORD swCurrentmax_cadAssPu;
  361. BOOL blAssistflag;
  362. BOOL blHCadLTorflag;
  363. } ASS_PER_COEF;
  364. typedef struct
  365. {
  366. POLY_COEF uwTorqueAssGain[GEAR_NUM];
  367. POLY_COEF uwCadencAsseGain[GEAR_NUM];
  368. } ASS_PER_COEFIN;
  369. typedef struct
  370. {
  371. UWORD swTorAssistSum1;
  372. UWORD swTorAssistSum2;
  373. SWORD swTorAss2CurrentTemp;
  374. SWORD swCadAss2CurrentTemp;
  375. SWORD swTorAssistCurrentTemp;
  376. SWORD swTorSpdLoopCurrentTemp;
  377. SWORD swTorAssistCurrent;
  378. SWORD swTorRefTarget;
  379. SWORD swTorRefEnd;
  380. SWORD swSpeedRef;
  381. SWORD swCadSpd2MotSpd;
  382. SWORD swVoltLimitPu;
  383. BOOL blAssHoldFlag;
  384. BOOL blTorqPIFlg;
  385. SWORD swAssitCurRef;
  386. } ASS_PER_OUT;
  387. /**
  388. * @brief AssistCurve current limit input
  389. *
  390. */
  391. typedef struct
  392. {
  393. UWORD uwIqlimit; // Q14, Iq limit
  394. } ASS_CURLIM_OUT;
  395. /**
  396. * @brief AssistCurve current limit input
  397. *
  398. */
  399. typedef struct
  400. {
  401. UWORD uwLimitGain[GEAR_NUM];
  402. UWORD uwSpdThresHold; // Q15 motor speed to decided whether ass or not
  403. UWORD uwBikeSpdThresHold1; // Q15 the start bike speed to limit iqref
  404. UWORD uwBikeSpdThresHold2; // Q15 the end bike speed to limit iqref
  405. ULONG ulBikeSpdDeltInv; // Q14
  406. UWORD uwBikeSpdIqLimitK;
  407. UWORD uwMotorSpdThresHold1;// Q15 the start motor speed to limit iqref
  408. UWORD uwMotorSpdThresHold2;// Q15 the start motor speed to limit iqref
  409. ULONG ulMotorSpdDeltInv; // Q14
  410. } ASS_CURLIM_COEF;
  411. typedef struct
  412. {
  413. SWORD swValue;
  414. UWORD uwLength; // 6: 2^6 value to average
  415. SLONG slSum;
  416. SLONG slAverValue;
  417. SWORD *swBuffer;
  418. UWORD uwIndex;
  419. BOOL blSecFlag;
  420. } MAF_IN;
  421. typedef struct
  422. {
  423. UWORD uwMotprPolePairs;
  424. UWORD uwMotorFluxWb;
  425. SLONG swCalCoefINV;
  426. } TOR2CURRENT_CAL_COEF;
  427. typedef struct
  428. {
  429. UWORD uwIqLimitInitAbs;
  430. UWORD uwIqLimitStartSoc;
  431. UWORD uwIqLimitEndSoc;
  432. SWORD swIqLImitK;
  433. } ASS_LIMIT_ACCORDING_VOL_COF;
  434. typedef struct
  435. {
  436. UWORD uwIqLimitAbs;
  437. } ASS_LIMIT_ACCORDING_VOL_OUT;
  438. typedef struct
  439. {
  440. SWORD swImaxPu;
  441. SWORD swIminPu;
  442. SWORD swTorqRefPu;
  443. SWORD swTorqFdbPu;
  444. } ASS_TORQ_PI_IN;
  445. typedef struct
  446. {
  447. SWORD swErrZ1Pu;
  448. SLONG slIRefPu;
  449. SWORD swIRefPu;
  450. } ASS_TORQ_PI_OUT;
  451. /****************************************
  452. *
  453. * Exported variable
  454. *
  455. ****************************************/
  456. extern ASS_FSM_STATUS Ass_FSM;
  457. extern ASS_PER_IN ass_stCalIn;
  458. extern ASS_PER_COEF ass_stCalCoef;
  459. extern ASS_PER_OUT ass_stCalOut;
  460. extern ASS_PARA_CONFIGURE ass_stParaCong;
  461. extern ASS_PARA_SET ass_stParaSet;
  462. extern ASS_LIMIT_ACCORDING_VOL_COF ass_stCurLimCalBMSCoef;
  463. extern ASS_LIMIT_ACCORDING_VOL_OUT ass_stCurLimitCalBMSOut;
  464. extern ASS_CURLIM_COEF ass_stCurLimCoef;
  465. extern ASS_CURLIM_OUT ass_stCurLimOut;
  466. extern ASR_SPDPI_IN asr_stTorqSpdPIIn;
  467. extern ASR_SPDPI_OUT asr_stTorqSpdPIOut;
  468. extern ASR_SPDPI_COF asr_stTorqSpdPICoef;
  469. extern ASR_SPDPI_COFIN asr_stTorqSpdPICoefIn;
  470. extern ASS_TORQ_PI_IN ass_stTorqPIIn;
  471. extern ASS_TORQ_PI_OUT ass_stTorqPIOut;
  472. extern SWORD ass_swTorqMafBuf[64];
  473. extern MAF_IN ass_stTorqMafValue;
  474. extern SWORD ass_swUqLimMafBuf[64];
  475. extern MAF_IN ass_stUqLimMafValue;
  476. extern LPF_OUT ass_pvt_stCurLpf;
  477. extern UWORD ass_uwPwrCurLim[6];
  478. /************************************************************************
  479. Ram Allocation
  480. *************************************************************************/
  481. /***************************************
  482. *
  483. * Function Definations
  484. *
  485. ***************************************/
  486. void ass_voAssitEEInit(void);
  487. void ass_voAssitCoef(void);
  488. void ass_voAssist(void);
  489. void ass_voMoveAverageFilter(MAF_IN *in);
  490. void ass_voMoveAverageFilterClear(MAF_IN *in);
  491. void ass_voAssistCurveCoef(ASS_CURVE_COMP_COEF *comp);
  492. SLONG ass_voAssistCurveCal(ASS_CURVE_COEF *coef, SWORD *value);
  493. #ifdef __cplusplus
  494. }
  495. #endif // __cplusplus
  496. #endif