KS0311 Keyestudio CNC V0.9A+4988 Driver with Heat Sink Kit

From Keyestudio Wiki
Revision as of 09:22, 8 March 2018 by Keyestudio (talk | contribs) (Created page with " == Keyestudio CNC V0.9A+4988 Driver(with Heat Sink)Kit == == Introduction == This kit mainly includes a keyestudio CNC V0.9A and three A46988 driver modules. <br> Keyes...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Keyestudio CNC V0.9A+4988 Driver(with Heat Sink)Kit

Introduction

This kit mainly includes a keyestudio CNC V0.9A and three A46988 driver modules.
Keyestudio CNC GRBL V0.9 is a main board developed by Keyestudio for CNC, laser engraving machine, writing robots and other robots. It has complete interfaces with cost-effective and can be driven via external connection, suitable for DIY and factory use.
The A4988 is a DMOS microstepping driver with converter and overcurrent protection, which can operate a bipolar stepper motor in full, half, 1/4, 1/8 and 1/16 step modes, with output-driven performance up to 35 V and ± 2A. The A4988 also includes a fixed off-time current regulator that operates in slow or mixed-decay modes.
thumb

Specifications of CNC V0.9A

  • 1.Microprocessor:MEGA328p
  • 2.Input Voltage:DC 12V
  • 3.Supporting File Format:Gcode
  • 4.Supporting Machine Structure:CNC, laser engraving machine, writing robots


thumb

Features of A4988 Driver

  • 1.With simple stepper and direction control interface.
  • 2.Five different step modes: full, half, 1/4, 1/8 and 1/16 step modes.
  • 3.Adjustable potentiometer used to adjust the max current output to gain higher step rate.
  • 4.Automatic decay mode detection/selection.
  • 5.Overheat closed circuit, under-voltage lockout, cross-current protection.
  • 6.Ground short-circuit protection and load short-circuit protection.


thumb

Pinout Diagram


thumb

Setting Method of A4988 Working Mode


thumb

Wiring Diagram


thumb

Install Driver Software and Development Environment Software IDE

(1) Install Diver Software

For different operating system, there may be slight difference in installation method. Below is an example in WIN 7.
a. When you connect Keyestudio CNC GRBL V0.9 to your computer the first time, right click “Computer” —>“Properties”—> “Device manager”, you can see “USB2.0-Serial”.
thumb

b. Click “USB2.0-Serial”, select “Update Driver software”.
thumb

c. In this page, click “Browse my computer for driver software”.
thumb

d. Find the “usb_ch341_3.1.2009.06” file.
thumb

e. Click “Next”, Installation completed; Then,click “Close”.
thumb

f. After driver is installed, go to “Device manager” again. right click “Computer” —> “Properties”—> “Device manager”, you can see device as below figure shown, also the correct Com port.
thumb

(2) Install Development Environment Software IDE

a. Double click arduino-1.5.6-r2-windows to start. Select “I Agree”to accept license agreement.
thumb

b. Select components to install and click “Next”.
thumb

c. Click “Browse” and select another folder. Click “Install” to start the installation.
thumb

d. Finally, wait for a few minutes to finish.
thumb

Testing Method

Wire it up well as wiring diagram shown, upload the below code to Keyestudio CNC GRBL V0.9 using IDE. Then you can check the function of each interface.

Sample Code

#define Light1  13 
#define Light2  A1 
#define Light3  A2 
#define Light4  A3
#define Light5  A4
#define Light6  A5

#define EN1  8
#define X_DIR     5       //X axis  direction control of stepper motor
#define Y_DIR     6       //y axis  direction control of stepper motor
#define Z_DIR     7       //z axis  direction control of stepper motor
#define X_STP     2       //x axis step control
#define Y_STP     3       //y axis step control
#define Z_STP     4       //z axis step control
#define X_LIMIT   9       //X limit
#define Y_LIMIT   10      //Y limit
#define Laser     11      //motor or laser control pin
#define Z_LIMIT   12      //Z limit
#define E_LIMIT   A0      //E limit
const int Button_A7 = A7;
const int Button_A6 = A6;
int Button_value_A7 = 0; 
int Button_value_A6 = 0; 
int Button_valueX = 0; 
int Button_valueY = 0;
int Button_valueZ = 0;
int Button_valueE = 0;

void setup() {
  pinMode(Light1, OUTPUT);    pinMode(Light2, OUTPUT);
  pinMode(Light3, OUTPUT);    pinMode(Light4, OUTPUT);
  pinMode(Light5, OUTPUT);    pinMode(Light6, OUTPUT);
  
  pinMode(EN1, OUTPUT);
  pinMode(X_DIR, OUTPUT);
  pinMode(Y_DIR, OUTPUT);
  pinMode(Z_DIR, OUTPUT);
  pinMode(X_STP, OUTPUT);
  pinMode(Y_STP, OUTPUT);
  pinMode(Z_STP, OUTPUT);
  pinMode(Button_A7, INPUT);  
  pinMode(Button_A6, INPUT); 
  pinMode(E_LIMIT, INPUT); 
  pinMode(X_LIMIT, INPUT); 
  pinMode(Y_LIMIT, INPUT); 
  pinMode(Z_LIMIT, INPUT); 
  Serial.begin(9600);
}

void EN()
{
  digitalWrite(EN1, LOW); 
}
//stepper motor turn forward or reverse
void turn(boolean dir, int steps)
{
  EN();
  digitalWrite(X_DIR,dir);
  digitalWrite(Y_DIR,dir);
  digitalWrite(Z_DIR,dir);
  delay(100);
  for(int i=0;i<steps;i++)
  {
    digitalWrite(X_STP, HIGH);
    digitalWrite(Y_STP, HIGH);
    digitalWrite(Z_STP, HIGH);
    delayMicroseconds(100);
    digitalWrite(X_STP, LOW);
    digitalWrite(Y_STP, LOW);
    digitalWrite(Z_STP, LOW);
    delayMicroseconds(100); 
   }
}
//laser is on
void Laser_ON()
{
  digitalWrite(Laser, HIGH); 
  delay(500);
  //digitalWrite(Laser, LOW); 
  //delay(500);
}
//laser is off
void Laser_OFF()
{
  digitalWrite(Laser, LOW); 
  delay(500);
  //digitalWrite(Laser, LOW); 
  //delay(500);
}

void loop() 
{
  
  Button_valueX = digitalRead(X_LIMIT);
  if(Button_valueX == LOW)  
  {
    digitalWrite(Light3, HIGH);
    turn(true, 4000);
  }
  else 
  {
    digitalWrite(Light3, LOW);
  }
  Serial.print("Button_valueX = ");
  Serial.println(Button_valueX);
  
  Button_valueY = digitalRead(Y_LIMIT);
  if(Button_valueY == LOW)  
  {
    digitalWrite(Light4, HIGH);
    turn(false, 4000);
  }
  else digitalWrite(Light4, LOW);
  Serial.print("Button_valueY = ");
  Serial.println(Button_valueY);
  
  Button_valueZ = digitalRead(Z_LIMIT);
  if(Button_valueZ == LOW)  digitalWrite(Light5, HIGH);
  else digitalWrite(Light5, LOW);
  Serial.print("Button_valueZ = ");
  Serial.println(Button_valueZ);
  
  Button_value_A7 = analogRead(Button_A7);
  if(Button_value_A7 == 0)  digitalWrite(Light1, HIGH);
  else digitalWrite(Light1, LOW);
  Serial.print("Button_value_A7 = ");
  Serial.println(Button_value_A7);
  
  Button_value_A6 = analogRead(Button_A6);
  if(Button_value_A6 == 0)  digitalWrite(Light2, HIGH);
  else digitalWrite(Light2, LOW);
  Serial.print("Button_value_A6 = ");
  Serial.println(Button_value_A6);   
  
  Button_valueE = analogRead(E_LIMIT);
  if(Button_valueE == 0)  
  {
    digitalWrite(Light6, HIGH);
    Laser_ON();
  }
  else 
  {
    digitalWrite(Light6, LOW);
    Laser_OFF();
  }
  Serial.print("Button_valueE = ");
  Serial.println(Button_valueE);    
}

Reference

https://drive.google.com/open?id=1_4sXpnYjZugHtxnEWnQZkfyHRzZPSZpr


Get One Now