This package includes python class and scripts for Raspberry Pi to control a home-made pen plotter.
Mini.CNC.mp4
To build and set up the plotter I mainly followed the instructions below
http://funofdiy.blogspot.com/2013/10/a-raspberry-pi-controlled-mini-laser.html
This is the main program. You need to modify line 25 (G code file name), line 29 (pin numbers for stepper motor X), line 31 (pin numbers for stepper motor Y), line 32 (pin number for pen switch), line 35, 36 (resolution of the machine in unit of mm/step). The code read and interpret G code, and send corresponding commands to the motor control functions.
Gcdoe_executer.py can accept code generated by inkscape GCodeTools extension.
defines the Bipolar_Stepper_Motor class. By default, line 5 is commented and line 7 is valid. This corresponds to a 8-step half-angle sequence. If maximum torque is desired, you can comment line 7 and uncomment line 5 to select 4-step full-angle sequence.
defines a set of functions such as LCM (for calculating the lcm of two integers) and Motor_Step (for controlling two motors simultaneously). Usually you don't need to modify anything.
This is a simple G code which plots a small spiral. It can perfectly test whether the machine can process G code, especially the circular interpolation G02 and G03, correctly.
A simple G code which plots several straight lines to make a grid. Perfect code to test the machine and make a coordinate system!