pen plotter - today at minesinside.mines.edu/~whoff/courses/eeng383/projects/2014fall/hong_… ·...
TRANSCRIPT
Pen Plotter Todd Sorden and Jonathan Hong
Overview • Physical Set-Up
• Components
• Top Level Design
• 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
Top Level Design
Program
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--;
}
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( )
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
}
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…
Timing Diagram
Watt are you doing?
zzzzzz