The Sharpie Dotifier

Program Download:

Firmware
dotifier_firmware.c

Laptop Script + Images
sharpie_dotifier.zip

Serial GUI Interface
Terminal v1.9b

The Software
           There are two main programs that we are concerned with:
    -PIC Firmware
    -Laptop BMP Converter Script
The PIC firmware is the code that controls the motors and basically takes care of the whole system. The program/script running on the laptop converts the picture created in paint into a set of commands. These commands are sent to the pic one at a time to build the picture through sharpie dots.

PIC Firmware

           The firmware has 3 main parts that I'll cover briefly:
(1) Servo Timing Control
Timer0 and Timer1 use a sophisticated interrupt method to keep timing accurate and signals going to the servos up to date. The signal runs at the necessary 50 Hz and can update just as quickly. A subroutine has been created so that servos transition from state to state in a gliding movement, rather than a jerky movement.

(2) Stepper Motor Control
Controlling the motors is extremely simple: the clock pulse just needs to be pulsed and the motors will increment 1 step in the direction specified. Since 1 step is only 1.8° a subroutine was created to make movements limited to 200 steps or 360° which is 1 full rotation of the motor shaft.

(3)Command Translation
The serial input is put into a moving buffer and checked for translation matches with each new input. If a command is seen in the appropriate spot of the buffer, it is exected. A single response is returned through serial communication to verify the command was received.

Sample Commands:
           S4350 -> Servo #4 move to location 350
           M0101 -> Stepper Motor Move 10 rotations Counter Clockwise
           S0000 -> Servo #0 move to location 000
           MHOME -> Stepper Motor Move until limit switch is hit

Laptop BMP Converter Script
           This script was built in C++ (the source code is available for download above) and it basically uses windows commands to use a gui tool for sending serial communication commands from the laptop using the serial terminal interface. The command structure has already been laid out and explained, all that needs to be done now is to test out the dotifier!



;