Step Motordriverimplement0118v01.docx

上传人:b****2 文档编号:23463043 上传时间:2023-05-17 格式:DOCX 页数:6 大小:52.88KB
下载 相关 举报
Step Motordriverimplement0118v01.docx_第1页
第1页 / 共6页
Step Motordriverimplement0118v01.docx_第2页
第2页 / 共6页
Step Motordriverimplement0118v01.docx_第3页
第3页 / 共6页
Step Motordriverimplement0118v01.docx_第4页
第4页 / 共6页
Step Motordriverimplement0118v01.docx_第5页
第5页 / 共6页
点击查看更多>>
下载资源
资源描述

Step Motordriverimplement0118v01.docx

《Step Motordriverimplement0118v01.docx》由会员分享,可在线阅读,更多相关《Step Motordriverimplement0118v01.docx(6页珍藏版)》请在冰豆网上搜索。

Step Motordriverimplement0118v01.docx

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模板 > 动态背景

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1