AccPedCD.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /********************************************************************************
  2. * 常州易控汽车电子股份有限公司
  3. * (c) Copyright 2009-2018 ECTEK
  4. * 保留所有权利
  5. ********************************************************************************
  6. * 工程名称:整车管理_车辆运动
  7. * 文件名: AccPedCD.h
  8. * 功能描述 : 油门踏板模块驱动头文件
  9. * 引用记录:
  10. * 备注:
  11. * 修订记录:
  12. * 日期 版本 作者 描述
  13. * 2018.01.12 00.01.00 李中 第一版
  14. *******************************************************************************/
  15. #ifndef __ACCPEDCD_H
  16. #define __ACCPEDCD_H
  17. #include "Std_Types.h"
  18. /*********************************************************************************************/
  19. /*样例代码*/
  20. #ifdef _SAMPLE_CODE_
  21. /*************************************************************/
  22. /*标定数据区开始(请不要在该区域加入非标定数据相关的内容) */
  23. typedef struct
  24. {
  25. uint16 xSize;
  26. uint16 xDist[4];
  27. uint16 values[4];
  28. }AccPedCD_rUW_CUR_TYPE;
  29. #define MAPDATA_START_SEC_VAR_CONST
  30. #include "MemMap.h"
  31. /*AccPedCD_Cal*/
  32. extern PRAGMA_MAPDATA const uint16 AccPedCD_uSRCMaxUW_C; /*AccPedCD_uSRCMaxUW_C,最大值*/
  33. extern PRAGMA_MAPDATA const uint16 AccPedCD_uSRCMinUW_C; /*AccPedCD_uSRCMinUW_C,最小值*/
  34. extern PRAGMA_MAPDATA const uint16 AccPedCD_uMaxDiffUW_C; /*AccPedCD_uMaxDiffUW_C,AccPed2与AccPed1最大相差多少...*/
  35. extern PRAGMA_MAPDATA const uint16 AccPedCD_uHighLimIdleUW_C; /*AccPedCD_uHighLimIdleUW_C,怠速开关高限*/
  36. extern PRAGMA_MAPDATA const uint16 AccPedCD_uLowLimIdleUW_C; /*AccPedCD_uLowLimIdleUW_C,怠速开关低限*/
  37. extern PRAGMA_MAPDATA const uint16 AccPedCD_bPlausEnUW_C; /*AccPedCD_bPlausEnUW_C,油门合理性检测是否启用*/
  38. extern PRAGMA_MAPDATA const uint16 AccPedCD_rFltUW_C; /*数字油门,AccPedCD_rFltUW_C*/
  39. extern PRAGMA_MAPDATA const uint16 AccPedCD_bDigEnUW_C; /*油门控制模式,AccPedCD_bDigEnUW_C, 1为正常控制, 0为数字油门*/
  40. extern PRAGMA_MAPDATA const uint16 AccPedCD_swtUseUW_C; /*AccPedCD_swtUseUW_C,油门传感器类型,1:双油门,2:怠速开关,3:单油门*/
  41. extern PRAGMA_MAPDATA const uint16 AccPedCD_idxIdleSwtTypeUW_C; /*AccPedCD_idxIdleSwtTypeUW_C,怠速开关类型 ,0:接电源常开,1:接电源常闭,2:接地常开,3:接地常闭*/
  42. extern PRAGMA_MAPDATA const AccPedCD_rUW_CUR_TYPE AccPedCD_rUW_CUR; /*油门标定,AccPedCD_rUW_CUR,系数256,单位%*/
  43. extern PRAGMA_MAPDATA const uint16 AccPedCD_rThresFltLowPosUW_C; /*AccPedCD_rThresFltLowPosUW_C,小油门限*/
  44. extern PRAGMA_MAPDATA const uint16 AccPedCD_rThresFltMidPosUW_C; /*AccPedCD_rThresFltMidPosUW_C,中油门限*/
  45. extern PRAGMA_MAPDATA const uint16 AccPedCD_facT1LowNegUW_C; /*AccPedCD_facT1LowNegUW_C,小油门负向滤波系数*/
  46. extern PRAGMA_MAPDATA const uint16 AccPedCD_facT1MidNegUW_C; /*AccPedCD_facT1MidNegUW_C,中油门负向滤波系数*/
  47. extern PRAGMA_MAPDATA const uint16 AccPedCD_facT1HighNegUW_C; /*AccPedCD_facT1HighNegUW_C,大油门负向滤波系数*/
  48. extern PRAGMA_MAPDATA const uint16 AccPedCD_facT1LowPosUW_C; /*AccPedCD_facT1LowPosUW_C,小油门正向滤波系数*/
  49. extern PRAGMA_MAPDATA const uint16 AccPedCD_facT1MidPosUW_C; /*AccPedCD_facT1MidPosUW_C,中油门正向滤波系数*/
  50. extern PRAGMA_MAPDATA const uint16 AccPedCD_facT1HighPosUW_C; /*AccPedCD_facT1HighPosUW_C,大油门正向滤波系数*/
  51. extern PRAGMA_MAPDATA const uint16 AccPedCD_duThresStationaryUW_C; /*AccPedCD_duThresStationaryUW_C,稳态油门变化范围*/
  52. extern PRAGMA_MAPDATA const uint16 AccPedCD_facT1StationaryUW_C; /*AccPedCD_facT1StationaryUW_C,稳态滤波系数*/
  53. extern PRAGMA_MAPDATA const uint16 AccPedCD_facDualRelUW_C; /*AccPedCD_facDualRelUW_C, 双油门两路信号的比例关系,第一路/第二路*/
  54. extern PRAGMA_MAPDATA const uint16 AccPedCD_drHealRmpUp_C; /*AccPedCD_drHealRmpUp_C; 加速踏板故障恢复正向Ramp步长。APPCD_drHealRmpUp_C: healing ramp pos. slope<value>*/
  55. extern PRAGMA_MAPDATA const uint16 AccPedCD_drHealRmpDwn_C; /*AccPedCD_drHealRmpDwn_C; 故障恢复时向下Ramp步长; APPCD_drHealRmpDwn_C: healing ramp neg. slope<value>*/
  56. #define MAPDATA_STOP_SEC_VAR_CONST
  57. #include "MemMap.h"
  58. /*标定数据区结束 */
  59. /*************************************************************/
  60. #define _ACCPED_DELTA_MONITOR_TIME 100 /*油门斜率计算频率为1s*/
  61. void AccPedCD_Init(void);
  62. void AccPedCD_Filter(void);
  63. void AccPedCD_DualAnalog(void);//双油门
  64. void AccPedCD_Switch(void); //带怠速开关的油门
  65. void AccPedCD_SingleAnalog(void); //单油门
  66. void AccPedCD_Update(void);
  67. void AccPedCD_Monitor(void);
  68. extern uint16 AccPedCD_rUW; //滤波前加速踏板位置
  69. extern uint16 AccPedCD_rFltUW; //油门踏板位置
  70. extern uint16 AccPedCD_rRawUW; //由电压值直接查表得到的位置
  71. extern uint16 AccPedCD_uUW,AccPedCD_u2UW;
  72. extern sint16 AccPedCD_drUnFltW; //油门踏板斜率
  73. extern uint16 AccPedCD_rOldUW; //上一时刻油门踏板,用于斜率计算
  74. #endif //_SAMPLE_CODE_
  75. /*********************************************************************************************/
  76. #endif