aLec33_Trobot - Summer 2006 Introduction to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Summer 2006 Lecture 32 Lecture 32 Labs 9 and 10 TRobot Introduction to Microcontrollers Introduction to Microcontrollers Lecture 32 Nachiket M. Kharalkar 2 Today Today ’s Agenda s Agenda • Recap • TRobot introduction Fal 2008 EE 319k Lecture 32 Nachiket M. Kharalkar 3 Stepper motor output sequence Stepper motor output sequence • Full-step sequence = 5,6,10,9,. .. • Half-step sequence = 5,4,6,2,10,8,9,1,. .. A A’ B B’ 50101 60110 1 01010 91001 Fal 2008 EE 319k Lecture 32 Nachiket M. Kharalkar 4 Driving the stepper motor Driving the stepper motor • Forward stepping causes the motor to spin forward – Full-step sequence = 5,6,10,9,. .. – Half-step sequence = 5,4,6,2,10,8,9,1,. .. • Backward stepping causes the motor to spin backward – Full-step backward sequence = 9,10,6,5,. .. – Half-step backward sequence = 1,9,8,10,2,6,4,5,. . Fal 2008 EE 319k Lecture 32 Nachiket M. Kharalkar 5 Stepper motor controller $55 $66 $AA $99 $56 $6A $A9 $95 $5A $69 $A5 $96 $59 $65 $A6 $9A Fal 2008 EE 319k Lecture 32 Nachiket M. Kharalkar 6 org $3800 Pt rmb 2 ;pointer to current state org $4000 out equ 0 ;8-bit output next equ 1 ;4 pointers to next state S55 fcb $55 ;8-bit output fdb S55,S69,S66,S96 ;next for each in S66 fcb $66 fdb S66,SAA,SAA,S55 SAA fcb $AA fdb SAA,S99,S99,S69 S99 fcb $99 fdb S99,SAA,S55,SAA S69 fcb $69 fdb S69,SAA,S55,S55 S96 fcb $96 fdb S96,S55,SAA,SAA Main lds #$4000 bsr Timer_Init ; activate TCNT movb #$FF,DDRT ; PT7-PT0 stepper movb #$00,DDRM ; PM1=CCW, PM0=CW movw #S55,Pt ; initial state loop ldx Pt movb out,X,PTT ; step motor ldd #2000 bsr Timer_Wait ; wait 0.25ms ldaa PTM ; read inputs anda #$03 ; just CCW,CW lsla ; 0,2,4,6 leax next,X ; list of pointers ldx A,X ; next depends on in stx Pt bra loop FSM implementation
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Summer 2006 Lecture 32 Lecture 32 Nachiket M. Kharalkar 7 TRobot TRobot Lecture 32 Nachiket M. Kharalkar 8 The battlefield is a 1024 by 1024 The battlefield is a 1024 by 1024 meter square. North is up meter square. North is up 512 1023 256 768 y 0 512 1023 256 768 x N S E W Lecture 32 Nachiket M. Kharalkar 9 Key concepts Key concepts • For collision purposes, each robot has a bounding-box that is about 4 meters wide, 5 meters long, and 3 meters high. • Robot positions are reported as the center of the box, which is the center of rotation if one track is moved forward, while the other track is moved backwards. • The robot heading is the direction of the left and right tracks. The turret heading is relative to the robot. E.g., a turret heading of 0 means the turret is facing in the same direction as the tank. Lecture 32 Nachiket M. Kharalkar 10 There are two headings of interest.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

aLec33_Trobot - Summer 2006 Introduction to...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online