ETCdriverimplement0908v10.docx
《ETCdriverimplement0908v10.docx》由会员分享,可在线阅读,更多相关《ETCdriverimplement0908v10.docx(7页珍藏版)》请在冰豆网上搜索。
ETCdriverimplement0908v10
ETCDriverImplementDocument
TianjinUniversity—InfineonAutomotiveElectronicJointLaboratory
StateKeyLaboratoryofEngines
TianJinUniversity,China
Revisionhistory
Version
By
Modifications
V0.1,08thJuly2008
WeiZhou
Creation
Contents
1Introduction4
1.1Overview4
1.2Reference4
2.Typedefinition5
3GlobalVariable6
4FunctionDefinitions7
4.1ETC_Init7
4.2ETC_DSBL8
4.3ETC_ENBL9
4.4ETC_SetIN2H10
4.5ETC_SetIN2L10
4.6ETC_IN1PWM10
4.7ETC_PWM11
4.8ETC_PID11
5ResourcesConfiguration12
5.1PeriperalConfig12
5.2InterruptConfig12
6CompileEnvironment13
1Introduction
1.1Overview
ThisdocumentdescribestheimplementationsoftheETCdrivertobedevelopedintheframeoftheGEMS-K1project.
TheETCdriverconfigurescontroltheETCaccuratelyandquickly,thecontrollerisbuiltbyPIDwhichisdividedintotwoparts,soitcanbemorebettersatisfiedthenon-linearsystem.
1.2Reference
[1]ETC_testSpec_20080908_v1.0_LB.doc
[2]ETC_driver_specification_20080908_v1.0.doc
2.Typedefinition
Type
Description
Range
3GlobalVariable
Thischapterdescribestheglobalvariable.
Varialbes
Type
Description
LastDutyCycle
float
Savetheabsolutereturn-valueofETC_PIDfunctioninthelastcycleanditisusedintheETC_PWMfunctionwhichcalculatesPWMsignal.
CurDutyCycle
float
Savetheabsolutereturn-valueofETC_PIDfunctioninthecurrentcycle
Direction
uint8
SavethedirectionvalueoftheETCanditisusedintheETC_PWMfunction.
ETC_PID_Par_ram[10][3]
float
ItisusedtocontrolthePIDcontroller.
ETC_BasDutCyc_CW[10]
float
ItisusedintheKWP2000function.
ETC_BasDutCyc_CCW[10]
float
ItisusedintheKWP2000function.
4FunctionDefinitions
4.1ETC_Init
Syntax
voidETC_Init(void);
Parameters
None
Return
None
Notification
Description
Thisistheinitializationfunctionofthetimer.
Reentrancy
No
Remarks
4.2
ETC_DSBL
Syntax
voidETC_DSBL()
Parameters
None
Return
None
Notification
Description
ThisfunctiondisablestheETCcontroller.
Reentrancy
No
Remarks
4.3
ETC_ENBL
Syntax
voidETC_ENBL()
Parameters
none
Return
none
Notification
Description
ThisfunctionenablestheETCcontroller.
Reentrancy
No
Remarks
4.4
ETC_SetIN2H
Syntax
voidETC_SetIN2H(void)
Parameters
none
Return
none
Notification
Description
ThisfunctioncontrolsthedirectionofthePWMoutput(positivedirection).
Reentrancy
No
Remarks
4.5ETC_SetIN2L
Syntax
voidETC_SetIN2L(void)
Parameters
none
Return
none
Notification
Description
ThisfunctioncontrolsthedirectionofthePWMoutput(negativedirection).
Reentrancy
No
Remarks
4.6ETC_IN1PWM
Syntax
voidETC_IN1PWM(floatFre,floatDutyCycle)
Parameters
Fre:
thefrequencyofPWM.
DutyCycle:
thedutyfactorofPWM.
Return
none
Notification
Description
ThisfunctioncontrolsthePWMofthefirstPeriperal.
Reentrancy
No
Remarks
4.7ETC_PWM
Syntax
voidETC_PWM(floatFre,floatDutyCycle,uint8Dir)
Parameters
Fre:
thefrequencyofPWM.
DutyCycle:
thedutyfactorofPWM.
Dir:
thedirectionofthePWM
Return
none
Notification
Description
ThisfunctioncalculatesthecontrolPWMsignalincludingthefrequency,
dutyfactoranddirection.
Reentrancy
No
Remarks
4.8ETC_PID
Syntax
floatETC_PID(floatnumber1,floatETC_Angle,floatMean_Angle);
Parameters
number1:
theoutputofETCcontrollerinthelastcycle.
ETC_Angle:
theactualthrottlepositionoftheETC.
Mean_Angle:
theoutputthrottlepositionwhichprovidedbyECU.
Return
out:
thecontrolvalueofthrottleposition.
Notification
Description
ThisisthecontrolleroftheElectronicthrottle.
Reentrancy
No
Remarks
5ResourcesConfiguration
TheresourceusedbyETCdriver
5.1PeriperalConfig
Source
Description
P0.14~P0.15
AsETCdriveroutputpins
5.2InterruptConfig
Source
SRN
TOS
Priority
Name
Description
6CompileEnvironment
CompileTool:
TaskingforTricore