pen plotter - today at minesinside.mines.edu/~whoff/courses/eeng383/projects/2014fall/hong_… ·...

12
Pen Plotter Todd Sorden and Jonathan Hong

Upload: others

Post on 22-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Pen Plotter Todd Sorden and Jonathan Hong

Page 2: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Overview • Physical Set-Up

• Components

• Top Level Design

• Flow Chart

• Pseudo Code

• Timing Diagram

• Questions

Page 3: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Physical Set-Up

Page 4: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Components • HCS12 Microcontroller

• Stepper Motor (x2) (paper & pen horizontal position) o Easy Driver (x2)

• Solenoid (pen vertical position) o Darlington Driver

o Voltage Regulator

• Paper Roller

• Print Head Belt

Page 5: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Top Level Design

Page 6: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Program

Page 7: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Pseudo Code - Main • Initialize Functions and Parameters

o Character Array Constants

o Character Queue Array[]

• Int Printer Queue, int Input Queue, int Total Characters Queued

o Printer Movement Functions

• Vertical(), Horizontal(), Pen()

o Printer General Functions

• Print stored character(int[] a), New line()

While( Total Characters Queued != 0 )

a = Queue Array[ Printer Queue ]

if (a = return){ New line(); }

else{

Print stored character(a);

Printer Queue = (Printer Queue% Size of Queue Array) + 1;

Total Characters Queued--;

}

Page 8: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Pseudo Code - Interrupt Interrupt ( Input from SCI detected )

if ( Input Queue – 1 != Printer Queue ){

Queue Array[ Input Queue ] = Input from SCI;

Input Queue = (Input Queue% Size of Queue Array) + 1;

Total Characters Queued++;

}

Printer Input

B Queue Array

Print Character( )

Page 9: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Pseudo Code - Movement Void HorizontalPixel(int dir){

PTT Horizontal Motor dir = dir

for( k < steps ){

PTT Horizontal Motor = 1;

PTT Horizontal Motor = 0;

}

Void VerticalPixel(int dir){

PTT Vertical Motor dir = dir

for( k < steps ){

PTT Vertical Motor = 1;

PTT Vertical Motor = 0;

}

Void PrintPixel(void){

PTT Solenoid = 0 // Makes Pen touch Paper

Delay

PTT Solenoid = 1 // Removed Pen from Paper

}

Page 10: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Pseudo Code – Print Char Void Print Character (int A[])

for( int k; k<35; k++ )

if( A[k] = 1){ PrintPixel();}

if( k % 5 == 4 ){

dir != dir; //reverser direction

VerticalPixel(down);

Delay;

}

HorizontalPixel(dir);

}

for( int I = 0; i<6; i++ ) VerticalPixel(up);

for( int I = 0; I<3; i++ ) HorizontalPixel(right);

letterA[] = [0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1…

Page 11: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Timing Diagram

Page 12: Pen Plotter - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014fall/Hong_… · • Flow Chart • Pseudo Code • Timing Diagram • Questions . Physical Set-Up

Watt are you doing?

zzzzzz