Project in progress
Linear Motion Plotter

Linear Motion Plotter © GPL3+

A CNC pen plotter with linear motion sensing.

  • 3,524 views
  • 2 comments
  • 9 respects

Components and supplies

Necessary tools and machines

Apps and online services

About this project

This project is basically a different application of the CNC pen plotter. The main goal of my project is that the CNC pen plotter will attach to white boards, which are literally used in college or university classes, and used by teachers or professors to write or explain their lectures into it with the marker pen. With my system, they don't have to write it with marker, rather they will sit down and write their lecture with a custom built pen which has motion sensing capability. The CNC machine then replicates this motion onto the white board. I have made a prototype of this CNC and tested our project code through that.

Check out the working model of my project.

CNC Pen Plotter Images...

Motion Sensing Pen...

Left mouse button attached to the end of the pen which will be clicked by the end point of refill and Z-axis will be activated in real time.

Code

Project_CODEArduino
We can also introduce any of the curve smoothing algorithm to smooth the curve.As I am using the Arduino UNO so I did't use the mentioned method.We have to use Arduino Mega to implement that for more processing power.
#include <AccelStepper.h>
#include <MultiStepper.h>
#include <PS2Mouse.h>
#include <Servo.h> 

// for the Arduino Uno + CNC shield V3
#define MOTOR_A_ENABLE_PIN 8
#define MOTOR_A_STEP_PIN 2
#define MOTOR_A_DIR_PIN 5

#define MOTOR_B_ENABLE_PIN 8
#define MOTOR_B_STEP_PIN 3
#define MOTOR_B_DIR_PIN 6

#define MDATA 10
#define MCLK 9

PS2Mouse mouse(MCLK,MDATA,STREAM);

AccelStepper stepper1(1, MOTOR_A_STEP_PIN, MOTOR_A_DIR_PIN); 
AccelStepper stepper2(1, MOTOR_B_STEP_PIN, MOTOR_B_DIR_PIN); 

Servo myservo;  
int servo_pos = 0;    

MultiStepper xy;
int x=0,y=0,posx=0,posy=0;
void setup() 
{
  Serial.begin(9600);
  myservo.attach(12);  
  stepper1.setEnablePin(MOTOR_A_ENABLE_PIN);
  stepper1.setPinsInverted(false, false, true);
  stepper2.setEnablePin(MOTOR_B_ENABLE_PIN);
  stepper2.setPinsInverted(false, false, true);
  // Configure each stepper
  stepper1.setMaxSpeed(100);
  stepper2.setMaxSpeed(100);
  // Then give them to MultiStepper to manage
  xy.addStepper(stepper1);
  xy.addStepper(stepper2);
  stepper1.enableOutputs();
  stepper2.enableOutputs();
  
  mouse.initialize();
}

void loop() 
{
   int data[3];
   long position[2];
    
    mouse.report(data);
  
   // x+=Filter.run(data[1]);
      x+=data[1];
    //y+=Filter.run(data[2]);
      y+=data[2];
   
    if(x>6000)
      x=6000;
    else if(x<-6000)
      x=-6000;
    else if(y>6000)
      y=6000;
    else if(y<-6000)
      y=-6000;  
    else
    {
        position[0]=-x/7;
        position[1]=-y/7;
     /*---------------------------------------------*/
              Serial.print(data[0]);//status byte
              Serial.print(":");
              Serial.print( position[0]);//X value
              Serial.print(",");
              Serial.print( position[1]);//Y value
              Serial.println();
    /*---------------------------------------------*/ 
        if(data[0]==9 || data[0]==25 || data[0]==41 || data[0]==57)
          myservo.write(170);//pen down
        else if(data[0]==8 || data[0]==40 || data[0]==24 || data[0]==56)
          myservo.write(90);//pen up  
        xy.moveTo(position);
        xy.runSpeedToPosition();
      //  posx=x;
      //  posy=y;
    }
    //delay(100);
}

Custom parts and enclosures

Custom Built PCB
Custom Built PCB to hold the arduino and CNC shield together
Pencnc circuit jkeb8phhlx

Schematics

Overall circuit diagram
Communication of all components with arduino
Entireprojectdiagram su9ltak4vp
Motion Sensing Pen
Extracting the PS2 mouse circuit and incorporate it to a pen
Mouse extraction 8x11mtpidy

Comments

Similar projects you might like

The Drawing Machine

Project showcase by Kramick Saha

  • 6,121 views
  • 5 comments
  • 17 respects

Stringent, the $15 Wall Plotter

Project tutorial by Fredrik Stridsman

  • 26,158 views
  • 46 comments
  • 159 respects

Otto DIY+ Arduino Bluetooth Robot Easy to 3D Print

Project tutorial by Team Otto builders

  • 48,199 views
  • 117 comments
  • 162 respects

CNC Flatbed Pen Plotter

Project in progress by Rodion Borisov

  • 8,615 views
  • 3 comments
  • 18 respects

"Waldo" Motion Capture with LittleArm

Project showcase by Slant Concepts

  • 4,128 views
  • 3 comments
  • 31 respects

Motion Detector Clock

Project in progress by Frazer Reid

  • 1,893 views
  • 0 comments
  • 3 respects
Add projectSign up / Login