Step Motordriverimplement0118v01.docx
- 文档编号:23463043
- 上传时间:2023-05-17
- 格式:DOCX
- 页数:6
- 大小:52.88KB
Step Motordriverimplement0118v01.docx
《Step Motordriverimplement0118v01.docx》由会员分享,可在线阅读,更多相关《Step Motordriverimplement0118v01.docx(6页珍藏版)》请在冰豆网上搜索。
StepMotordriverimplement0118v01
StepMotorDriverImplementDocument
TianjinUniversity—InfineonAutomotiveElectronicJointLaboratory
StateKeyLaboratoryofEngines
TianJinUniversity,China
Revisionhistory
Version
By
Modifications
V0.1,18thJan2008
JiangTang
Creation
Contents
1Introduction4
1.1Overview4
1.2Reference4
2.Typedefinition5
3GlobalVariable6
4FunctionDefinitions7
4.1WritePin7
4.2StepMotorReset8
4.3StepMotor_AccSlowdown9
4.4StepMotorC10
5ResourcesConfiguration11
5.1PeriperalConfig11
5.2InterruptConfig11
6CompileEnvironment12
1Introduction
1.1Overview
ThisdocumentdescribestheimplementationsoftheStepMotordrivertobedevelopedintheframeoftheGEMS-K1project.
TheStepMotordriverconfiguresworkingstepofstepmotor.Thestepwayishalf-step.Thereisaresetfunctionthatpullsdownthestepmotortotheposition“0”.Theresetfunctioniswalkingback500steps.Whenagoalstepfinished,resetalltherelatedpins.Whenanewgoalstepstarted,firstwalktothelaststate,thenspeedup,whenthegoalstepisnear,slowdown.
1.2Reference
[1]StepMotordrivertestreport
2.Typedefinition
Type
Description
Range
OCStepMotor_ErrorType
Recommendedtype:
16bitunsignedvalue.Numbersfrom0to15arereservedfortheHISIOLibraryitself,numbersbetween16and63aredefinedintheHISIODriverdocument.Errorcodesfrom64to127arefordriverspecificerrorcodesnotdefinedintheHISIODriverdocumentandnumbersstartingfrom128arereservedforfutureuse.
OCStepMotor_R_OK
3GlobalVariable
Thischapterdescribestheglobalvariableusedbyscheduler.
Varialbes
Type
Description
N_Coef
int
Controlwalksteplength
counter
int
Controlwalksteplength
StepMotor
STEP_STATUS
Thestatusofstepmotor
StepMotor.step
Setthegoalstepposition
StepMotor.NowPosition
Thepositionofcurrentstep
4FunctionDefinitions
4.1WritePin
Syntax
OCStepMotor_ErrorTypeWritePin(void);
Parameters
none
Return
OCStepMotor_R_OK:
writepinwassuccessful.
Notification
Description
WritetostepmotorcontrolpinaccordingtoStepMotor.NowPosition
Reentrancy
No
Remarks
StepMotor.NowPosition
P1.8
P1.9
P1.10
P1.11
0
1
0
1
0
1
1
0
0
0
2
1
0
0
1
3
0
0
0
1
4
0
1
0
1
5
0
1
0
0
6
0
1
1
0
7
0
0
1
0
4.2
StepMotorReset
Syntax
OCStepMotor_ErrorTypeStepMotorReset(void)
Parameters
None
Return
OCStepMotor_R_OK:
currentresetwassuccessful.
Notification
Description
Resetstepmotortotheposition“0”
Reentrancy
No
Remarks
4.3
StepMotor_AccSlowdown
Syntax
OCStepMotor_ErrorTypeStepMotor_AccSlowdown(void)
Parameters
none
Return
OCStepMotor_R_OK:
Acceleratingorslowdownfunctionsteparesuccessful
Notification
Description
Thefunctionacceleratesthewalksteporslowsdownthewalkstep.
Forexample,whenStepMotor.step=300,changeStepMotor.stepto10,andcurrentpositionisbetween10and300,thesethingswillhappen:
Slowdown(forward)—Accelerates(backward)—SlowDown(backward)
—Resetallpins.
Reentrancy
No
Remarks
4.4
StepMotorC
Syntax
OCStepMotor_ErrorTypeStepMotorC(void)
Parameters
none
Return
OCStepmotor_R_OK:
Controlstepmotorsuccessfully.
Notification
Description
Thefunctionwasthewholecontrolfunctionofstepmotor,otherfunctionwasembeddedinthisfunction.
Reentrancy
No
Remarks
5ResourcesConfiguration
Theresourceusedbystepmotordriver
5.1PeriperalConfig
Source
Description
P2.6
Asstepmotorenablepin,highlevelenable
P2.7
Asstepmotorenablepin,highlevelenable
P1.8
StepA+
P1.9
StepA-
P1.10
StepB+
P1.11
StepB-
5.2InterruptConfig
Source
SRN
TOS
Priority
Name
Description
6CompileEnvironment
CompileTool:
TaskingforTricore
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Step Motordriverimplement0118v01
![提示](https://static.bdocx.com/images/bang_tan.gif)