EX 0.4 – 1D-CNC

One Axis CNC

This machine is an abridged version of an MIT project which can be see in the references below. The On Axis CNC machine was an attempt to create the most affordable machine out of minimal materials. The assembly consists of recycled cardboard, a stepper motor and a arduino powered through a USB cable into a computer.

INO File: Here

Information:

Aluminum Rod 1/4″

MDF 1/2″

Cardboard 1/8th” Home-Depot Box

Breadboard

Arduino-UNO

Stepper Motor

References:

MIT Archive: Here

Modular Machines: Here

20160922_205744

20160922_205830

diagrams-04-d2880

stepper-sn754410ne

-Raw Code –

#include <Stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution for your motor

// initialize the stepper library on pins 8 through 11:
 Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

int stepCount = 0; // number of steps the motor has taken
 int motorSpeed = 100; //range from 0 to 100:
 const int moveDim = 20; //Millimeters range of motion
 const int stepsPerMM = (stepsPerRevolution/8); //calculate number of steps per MM
 const int endPoint = (moveDim*stepsPerMM); //calculate steps in range

void setup() {
 // nothing to do inside the setup
 }

void loop() {

delay(4);

myStepper.setSpeed(motorSpeed); // set the motor speed:
 //delay(10);
 if (stepCount < endPoint) {
 // step 1/100 of a revolution
 myStepper.step(stepsPerRevolution / 200);
 //delay(10);
 }
 else {
 //step backwards
 myStepper.step(-stepsPerRevolution / 200);
 //delay(10);

}

if (stepCount > (endPoint*2)){
 stepCount=0;
 }

else {
 stepCount = stepCount+1;
 }

// stepCount=stepCount+1;
 // delay(1000);

}