Reply to topic  [ 1 post ] 
CNC V3.0 Arduino Compatible Shield (HCARDU0086) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:02 pm
Posts: 670
Post CNC V3.0 Arduino Compatible Shield (HCARDU0086)
Image
Image
Description:

This shield (HCARDU0086) is designed to allow you to control a CNC router or milling machine from an Arduino board. It contains 4 driver sockets which allows compatible Pololu A4988 driver modules to be inserted (see HCMODU0068 on our website) providing the ability to drive 3 stepper motor axis (X,Y, & Z) plus an optional 4th auxiliary motor. Additional connectors provide easy connection of end stop sensors and control buttons.

Order Yours Here.

Image
Shield with A4988 deiver modules (HCMODU0068) inserted - not included with shield

Features:

GRBL 0.8c compatible. (Open source firmware that runs on an Arduino UNO that turns G-code commands into stepper signals)
4-Axis support (X, Y, Z , A-Can duplicate X,Y,Z or do a full 4th axis with custom firmware using pins D12 and D13)
2 x End stops for each axis (each axis pair shared by same IO pin)
Spindle enable and direction connection.
Coolant enable connection.
Uses removable Pololu A4988 compatible stepper drivers. (A4988, DRV8825 and others) see our module HCMODU0068
Jumpers headers to set the Micro-Stepping for the stepper drivers.
Compact design.
Stepper Motors can be connected with 4 pin dupont/molex connectors.
Runs on 12-36V DC. (At the moment only the Pololu DRV8825 drivers can handle up to 36V so please consider the operation voltage when powering the board.)

Image


Schematic:
Image


Arduino Test Sketch:
Code:
/*  FILE:    HC_CNC_Shield_Test
    DATE:    21/10/14
    VERSION: 0.1
    AUTHOR:  Andrew Davies

This is an example sketch which tests some of the functions of the Hobby
Components CNC shield (HCARDU0086). The sketch will step the X, Y Z, and Aux
stepper outputs in both directions. It will also report if any of the endstop
or control inputs have been triggered via the serial port.

WARNING: Ensure that your stepper motors are mechanically disconnected before
running this sketch as it will not stop drive to the motors should an endstop be
reached.

If you are using the Aux stepper output you will need to connect the pins labelled
D13 to A-DIR and D12 to A-STEP on the shield.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES,
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR
LACK OF NEGLIGENCE. HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE
FOR ANY DAMAGES INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES FOR ANY REASON WHATSOEVER.
*/


#define EN 8      /* Enable pin for all stepper outputs */

#define X_DIR 5   /* Direction pin for X axis */
#define X_STEP 2  /* Step pin for X axis */

#define Y_DIR 6   /* Direction pin for Y axis */
#define Y_STEP 3  /* Step pin for Y axis */

#define Z_DIR 7   /* Direction pin for Z axis */
#define Z_STEP 4  /* Step pin for Z axis */

#define A_DIR 13  /* Direction pin for Aux driver. Requires D13 and A-DIR pins to be shorted */
#define A_STEP 12 /* Direction pin for Aux driver. Requires D12 and A-STEP pins to be shorted */

#define X_ENDSTOP 9   /* X axis endstop input pin */
#define Y_ENDSTOP 10  /* Y axis endstop input pin */
#define Z_ENDSTOP 11  /* Z axis endstop input pin */
#define ABORT A0  /* Abort input pin */
#define HOLD A1   /* Hold input pin */
#define RESUME A2 /* Resume input pin */

int Count = 0; /* Counter to count number of steps made */
boolean Direction = LOW; /* Rotational direction of stepper motors */

/* The setup routine runs once when you press reset: */
void setup()
{               
  /* Initialize serial */
  Serial.begin(9600);
 
  /* Configure the steper drive pins as outputs */
  pinMode(EN, OUTPUT);
  pinMode(X_DIR, OUTPUT);
  pinMode(X_STEP, OUTPUT);
  pinMode(Y_DIR, OUTPUT);
  pinMode(Y_STEP, OUTPUT);
  pinMode(Z_DIR, OUTPUT);
  pinMode(Z_STEP, OUTPUT);
  pinMode(A_DIR, OUTPUT);
  pinMode(A_STEP, OUTPUT);
 
  /* Configure the control pins as inputs with pullups */
  pinMode(X_ENDSTOP, INPUT_PULLUP);
  pinMode(Y_ENDSTOP, INPUT_PULLUP);
  pinMode(Z_ENDSTOP, INPUT_PULLUP);

  pinMode(ABORT, INPUT_PULLUP);
  pinMode(HOLD, INPUT_PULLUP);
  pinMode(RESUME, INPUT_PULLUP);

  /* Enable the X, Y, Z & Aux stepper outputs */
  digitalWrite(EN, LOW); //Low to enable
}

// the loop routine runs over and over again forever:
void loop()
{
  /* Count one step */
  Count++;
   
  /* If we have reached 500 steps then change the stepper direction and reset the counter */
  if (Count >= 500)
  {
    Direction = !Direction;
    digitalWrite(X_DIR, Direction); // Low = CW
    digitalWrite(Y_DIR, Direction); // Low = CW
    digitalWrite(Z_DIR, Direction); // Low = CW
    digitalWrite(A_DIR, Direction); // Low = CW
    Count = 0;
  }
   
  /* Step the X, Y, Z, and Aux motors */ 
  digitalWrite(X_STEP, HIGH);
  delay(1);
  digitalWrite(Y_STEP, HIGH);
  delay(1);
  digitalWrite(Z_STEP, HIGH);
  delay(1);   
  digitalWrite(A_STEP, HIGH);
  delay(1);
 
  digitalWrite(X_STEP, LOW); 
  delay(1);
  digitalWrite(Y_STEP, LOW);
  delay(1);
  digitalWrite(Z_STEP, LOW); 
  delay(1);
  digitalWrite(A_STEP, LOW); 
  delay(1);
 
  /* Check state of inputs */
  if (!digitalRead(X_ENDSTOP)) Serial.println("X-axis end-stop triggered!");
  if (!digitalRead(Y_ENDSTOP)) Serial.println("Y-axis end-stop triggered!");
  if (!digitalRead(Z_ENDSTOP)) Serial.println("Z-axis end-stop triggered!");
  if (!digitalRead(ABORT)) Serial.println("Abort input triggered!");
  if (!digitalRead(HOLD)) Serial.println("Hold input triggered!");
  if (!digitalRead(RESUME)) Serial.println("Resume input triggered!");
}


Tue Oct 21, 2014 3:18 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD