Mostrando entradas con la etiqueta cnc. Mostrar todas las entradas
Mostrando entradas con la etiqueta cnc. Mostrar todas las entradas

EasyDriver CNC

ATENCION!
Los comandos para configurar GRBL no funcionan en el serial monitor del arduino!
Usar el mismo Gcode sender para configurarlo, o el software de terminal CoolTerm


Quick setup guide
http://blog.protoneer.co.nz/quick-grbl-setup-guide-for-windows-arduino-g-code-interpreter/

Pin layout de EasyDriver
http://blog.protoneer.co.nz/grbl-arduino-g-code-processor-pin-layout/

Configuración de GRBL 0.8
https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.8

Calculadora GRBL de ShapeOko
http://noblesque.org.uk/ShapeOko/grblcalc/

Software para dibujar para ShapeOko
http://zapmaker.org/projects/grbl-controller-3-0/

Sleep y Enable explicados:
http://xavierstechno.blogspot.com.es/#%21/2012/02/easy-driver-with-arduino.html

Ejemplos de GCODE
https://github.com/grbl/grbl/wiki/G-Code-Examples

Manual de GCODE
http://linuxcnc.org/docs/html/gcode.html

VER SHAPEOKO!
http://www.shapeoko.com/

Usar servo en eje Z
https://github.com/grbl/grbl/issues/220

There is a mod/fork of an old 0.8 grbl version which can use a servo on the Z-Axis:
https://github.com/heise/GRBLDRILL
It was done by the german ct magazin for a small PCB drill.
Unfortunately there is not much documentation about that, as far is i remember the servo does a full movement if you drive Z-Axis from 0 to +5mm via gcode. This can be changed somewhere in the code.
Just try the hex file from the github: https://github.com/heise/GRBLDRILL/blob/master/GRBL/grbl.hex
with a servo connected to analog4 on the Arduino.
Here is the link top the article, but you'll have to buy ist:
https://www.heise.de/artikel-archiv/ch/2012/03/068_Dreiachs-Motorsteuerung-mit-Arduino

Software online para GCODEhttp://www.makercam.com/
Código fuente de GRBL e instrucciones para cargar en Arduino
http://blog.protoneer.co.nz/grbl-arduino-library/

GRBL Arduino Library – Use the Arduino IDE to flash GRBL directly to your Arduino

We have created an Arduino Library of the popular GRBL g-code Interpreter. A great little application that turns your Arduino into a very capable CNC machine.
This library makes it so much easier to install GRBL onto your Arduino. No more issues with making HEX files or trying to find a way to upload the Hex file to your board. Simply install the library and open the right example sketch for your Arduino.
How to install it:
  • Down load the library from GitHub : https://github.com/Protoneer/GRBL-Arduino-Library/archive/master.zip
  • Unzip the library and copy the main folder into the “Libraries” folder in the folder you installed your Arduino software. Eg. C:\arduino-1.0.3\libraries\
  • Rename the folder to “GRBL”. (This will stop the Arduino IDE from complaining about the long folder name)
  • Open up the Arduino IDE.
  • Click on the following menu : File -> Examples – > GRBL (or what ever you renamed the folder to) -> ArduinoUno
  • Upload the sketch to you Arduino UNO board.
If you are interested in the source code, its available at https://github.com/Protoneer/GRBL-Arduino-Library


Configuración de corriente para el Big EasyDriver

Subir este codigo al arduino, y con un destornillador girar el potenciometro para encontrar el punto en que el motor gira bien.



  ////////////////////////////////              
  //TWO WIRE STEP/DIR DRIVER BOARD CODE      
  int Motor1StepPin = 4;
  int Motor1DirPin = 7;

  int Motor2StepPin = 2;
  int Motor2DirPin = 3;  
  
  //The number of steps required for your stepper to make one revolution. (Don't forget to take into 
  //account the settings on your driver board. i.e. Microstepping, half stepping etc.)
  float steps = 200;  
    //Set the travel speed for your stepper motors here. (In Rev/Min)
    //Note: There is a limit to how fast or slow this code is able to spin the stepper motors.
    //You can try experimenting with the "delayMicroseconds" code if you need different speeds.
  int altSpeed=60;
  int azSpeed=60; 
  
  //////////////////////////////// 

  float Motor1Delay, Motor2Delay, doSteps;

void setup()

    Serial.begin(9600);
  ////////////////////////////////              
  //TWO WIRE STEP/DIR DRIVER BOARD CODE  
  pinMode(Motor1StepPin, OUTPUT);
  pinMode(Motor1DirPin, OUTPUT);
  pinMode(Motor2StepPin, OUTPUT);
  pinMode(Motor2DirPin, OUTPUT);
  Motor1Delay = ( 1000000 * ( 60 / (steps * altSpeed) ) ) / 2;
  Motor2Delay  = ( 1000000 * ( 60 / (steps * azSpeed) ) ) / 2;
  ////////////////////////////////  

        pinMode(6, OUTPUT);
//      pinMode(7, OUTPUT);      
//      pinMode(13, OUTPUT);
    

         
}

void loop()
{
  
  delay(1000); 
  digitalWrite(6, LOW);
  delay(100); 
  
  moveToPosition(1, 0, -steps * 1);  
  moveToPosition(1, 0, steps * 1);   
  moveToPosition(1, -steps * 1, 0); 
  moveToPosition(1, steps * 1, 0); 

  digitalWrite(6, HIGH);  

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//This code moves the stepper motors
void moveToPosition(int limitSearch,  long altsteps, long azsteps){
    
//    Serial.println("altsteps");
//    Serial.println(altsteps);
//    Serial.println("azsteps");
//    Serial.println(azsteps);                 
        
  ////////////////////////////////              
  //TWO WIRE STEP/DIR DRIVER BOARD CODE   
  if (abs(azsteps)==azsteps){digitalWrite(Motor2DirPin, HIGH);}else{digitalWrite(Motor2DirPin, LOW);}  
  if (abs(altsteps)==altsteps){digitalWrite(Motor1DirPin, HIGH);}else{digitalWrite(Motor1DirPin, LOW);}

  for (doSteps=1; doSteps <= abs(azsteps); doSteps++){
     digitalWrite(Motor2StepPin, HIGH);
     delayMicroseconds(int(Motor2Delay));
     digitalWrite(Motor2StepPin, LOW); 
     delayMicroseconds(int(Motor2Delay));
  }
     
  for (doSteps=1; doSteps <= abs(altsteps); doSteps++){
     digitalWrite(Motor1StepPin, HIGH);
     delayMicroseconds(int(Motor1Delay));
     digitalWrite(Motor1StepPin, LOW); 
     delayMicroseconds(int(Motor1Delay));
  }
    
}





CNC con servo en eje Z

Proyecto Prusa Mendel:
https://sites.google.com/site/basile/hw/reprap/prusa-mendel/0---antes-de-empezar

EJE Z CON SERVO!!!



There is a mod/fork of an old 0.8 grbl version which can use a servo on the Z-Axis:
https://github.com/heise/GRBLDRILL
It was done by the german ct magazin for a small PCB drill.
Unfortunately there is not much documentation about that, as far is i remember the servo does a full movement if you drive Z-Axis from 0 to +5mm via gcode. This can be changed somewhere in the code.
Just try the hex file from the github: https://github.com/heise/GRBLDRILL/blob/master/GRBL/grbl.hex
with a servo connected to analog4 on the Arduino.
Here is the link top the article, but you'll have to buy ist:
https://www.heise.de/artikel-archiv/ch/2012/03/068_Dreiachs-Motorsteuerung-mit-Arduino

Just tested the hex file with the servo option on an arduino nano - works fine.
It an old 0.8 version, but if i fire Z5 or Z0 the servo on analog4 moves from one end to the other.
Maybe you had a problem on the download. my Link to the hex just pointed to the download page, not the actual hex file (so you saved the html page as hex which causes the corruption error). This is the right link to save as hex file: https://github.com/heise/GRBLDRILL/raw/master/GRBL/grbl.hex
right-click, save as and flash it via avrdude.
btw, you can get an arduino for 6USD:
http://www.banggood.com/Wholesale-New-Ver-Pro-Mini-ATMEGA328-328p-5V-16MHz-Arduino-Compatible-Nano-Size-p-68534.html
Buy a USB to TTL adapter once and use cheap and small arduino nanos afterwords as you wont need the usb connection in most of your cases after programming.




GRBL!!!!

https://github.com/grbl/grbl/wiki/Using-Grbl


GRBL Arduino Library
Use the Arduino IDE to flash GRBL directly to your Arduino


http://blog.protoneer.co.nz/grbl-arduino-library/

------------------------------------------------------------------

Calibración:
============

http://blog.protoneer.co.nz/configuring-grbl-arduino-based-cnc-controller/


GRBL CON PHASE EN LUGAR DE STEP Y DIR!!!
========================================

https://github.com/grbl/grbl/wiki/H-Bridge-as-stepper-driver
https://gist.github.com/nullsub/3238961

LOS ARCHIVOS DE ESTOS LINKS ANTERIORES FUNCIONAN SOLO CON LA VERSION 0.7 DE GRBL QUE SE BAJA DE ACA:
https://github.com/grbl/grbl/tree/v0_7

INSTRUCCIONES PARA CREAR EL .HEX A PARTIR DE LOS FUENTES!

https://github.com/grbl/grbl/wiki/Compiling-Grbl

PATH REQUERIDO PARA PODER CREAR EL .HEX:

path=%path%;C:\crusso\00. Proyectos\00. Arduino\arduino-1.0.5\hardware\tools\avr;C:\crusso\00. Proyectos\00. Arduino\arduino-1.0.5\hardware\tools\avr\bin;C:\crusso\00. Proyectos\00. Arduino\arduino-1.0.5\hardware\tools\avr\avr\bin;C:\crusso\00. Proyectos\00. Arduino\arduino-1.0.5\hardware\tools\avr\utils\bin


Instructivo gcode interpreter (reprap)
======================================



Instructivo inkscape gcode
==========================



Reprap arduino firmware
=======================




Motores NEMA17:

Sketch para máxima velocidad:

[code]

#include <Stepper.h>

const int stepsPerRevolution = 200;    //estos son los steps per revolution... se calcula asi, cada paso del nema 17 es 1.8º, entonces 360/1.8 = 200

Stepper myStepper(stepsPerRevolution, 4,6,5,7);          

void setup() {
  myStepper.setSpeed(150);   //maximo que soportan los nema17
}

void loop() {
  myStepper.step(400);
}
[/code]


Partes de un CNC












Driver L298.




http://dx.com/p/l298n-stepper-motor-driver-controller-board-for-arduino-120542

http://arquiteturaresponsiva.blogspot.com.br/2013/01/controlando-um-motor-de-passo-motorknob.html

http://www.bristolwatch.com/L298N/L298N_arduino.htm

http://www.youtube.com/watch?v=GFKohtByprc












5x5mm CNC Motor Jaw Shaft Coupler 5mm to 5mm Flexible Coupling OD 20x26mm








 Linear Rail Shaft Guide Support Alluminium Pillow Block









Linear Ball Bearing Motion







CNC Linear Motion Shaft Rod









Linear Rod Rail Shaft Support











  




Linear Rail Bar (100/300/400/500/600mm 3D Printer 8mm Lead Screw Rod Z Axis Linear Rail Bar + Nut)













Ball Bearing Pillow Block (Zinc Alloy Diameter 8mm Bore Ball Bearing Pillow Block Mounted Support KP08)












A4988 con Arduino



Codigo:

/*     Simple Stepper Motor Control Exaple Code
 *    
 *  by Dejan Nedelkovski, www.HowToMechatronics.com
 *
 */
// defines pins numbers
const int stepPin = 12;   //3;
const int dirPin = 11;    //4;

void setup() {
  // Sets the two pins as Outputs
  pinMode(stepPin,OUTPUT);
  pinMode(dirPin,OUTPUT);
}
void loop() {
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation
  for(int x = 0; x < 200; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(1000);
  }
  delay(1000); // One second delay
 
  digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 400 pulses for making two full cycle rotation
  for(int x = 0; x < 200; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(1000);
  }
  delay(1000);
}


Fuente: https://chenfuguo.gitbooks.io/arduino/content/Shields/a4988Controller.html
             http://howtomechatronics.com/

Configuracion CNC v3


ATENCION!!! PARA QUE FUNCIONE EL GRBL CONTROLLER DEBE ESTAR CONFIGURADO A 115200!!!


Voltage de los A4988

A = 1.25 * V
V = A / 1.25

Valores de voltage actuales:

X = .464
Y = .640
Z = .000

Configuración GRBL (VERSION 0.9)

$0=10
$1=25
$2=0
$3=0
$4=0
$5=0
$6=0
$10=3
$11=0.010
$12=0.002
$13=0
$20=0
$21=1
$22=0
$23=0
$24=25
$25=500
$26=250
$27=1
$100=6.320
$101=6.320
$102=51
$110=1000
$111=500
$112=500
$120=10
$121=10
$122=10
$130=200
$131=200
$132=200


Inkscape con gcodetools

Version de inkscape: 0.48
Con "gcodetools dev..."


Configuracion GRBL 0.9

https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9#grbls-xval-settings-and-what-they-mean

Compilar y subir GRBL 0.9 a arduino

Bajar el zip de este lugar:

https://github.com/grbl/grbl

luego descomprimirlo, y armar un .zip que solo tenga la carpeta que contiene los examples, los .h y los .c (este zip es el que luego hay que importar como libreria en Sketch / include library)

Primero hay que borrar la EPROM (ver este post para saber como hacerlo: http://expressraider.blogspot.com.uy/2015/02/arduino-midi-drums-paso-paso.html)

Instrucciones para subir el grbl:

https://github.com/grbl/grbl/wiki/Compiling-Grbl

Luego el grbl controller configurarlo a 115200

PCB Wizard

1. Abrir PCB Wizard y desplegar la Circuit Symbol Gallery




2. Arrastrar los componentes




3. Crear las conexiones (posicionar el mouse sobre uno de los pines y arrastrarlo hasta el pin del otro componente al cual se quiere conectar)





4. Convertirlo a PCB: Tools / Convert / Design to Printed Circuit Board
Marcar "Yes, I wish to decide how my design is converted" / Next

Luego setear lo siguiente:



En esta configuración es posible cambiar el ancho de las pistas (en el combo Grid):
Esto es útil en el caso en que se quiera utilizar una mecha de mayor diámetro:




La placa quedará así:




5. Agregar los pads de referencia

Para esto, colocar dos pads a cada lado de la placa (pueden estar dentro o fuera). Deben estar alineados y equidistantes de los bordes de la placa (estas referencias serán utilizadas mas adelante por el software Line Grinder).

Luego de posicionar los pads, editar sus propiedades, y en el tamaño establecer 0.125in en el largo y ancho




Es posible mover los componentes para distribuirlos de otra manera.
En este caso, el ruteo se pierde, y hay que volver a realizarlo mediante el menú Tools / Auto Route / Route all Nets


Y queda así:



6. Marcar el punto de origen

Para esto, ir a View / Co-ordinates / Origin / Change origin
y marcar la esquina inferior izquierda como origen:



7. Exportar a GERBER

Tools / CAD Cam / Export GERBER

Dejar marcado sólamente Solder side y Drill holes


Generacion de GCODE con FlatCam (version utilizada: 8.92 Beta)

8. Generar GCODE utilizando FlatCam  (tutorial en: https://www.youtube.com/watch?v=IbsBCMlQB_c)

        a. File / Open / Open Gerber  --> abrir el archivo .gb0 generado por el pcb wizard que corresponde a los isolation.

        b. File / Open / Open Excellon --> abrir el archivo .drl que contiene los agujeros

9. Seleccionar de la ficha Project, el archivo abierto en el paso a.

10. Ir a la ficha Selected

11. En Tool dia: 0.016 / Passes: 1 / Pass overlap: 0.1500

12. Click en full geo

13. Para generar el cutout (recuadro alrededor):
           a. Ir a ficha Project, click en el .gb0
           b. Ir a ficha Selected
           c. Click en cutout tool
           d. Tool Dia: 0.031 / Margin 0.05 / Gap size: -.1

           e. Donde dice Free form, click en Generate Geo

14. Para generar los drills:
           a. Ir a la ficha Project, click en el .drl
           b. Ir a ficha Selected
           c. Seleccionar todos los drills de la tools table, y en Drills Tool Dia poner: 0.031
           d. Click en Mill Drills Geo
           e. Cut Z: -0.25 / Travel Z: 0.1 / Feed rate: 3.0
           f. Click en Generate

Los pasos anteriores generan los Geometry.
A partir de los Geometry se pueden generar los paths gcode:

1. En la ficha Project, dentro de Geometry, click en el archivo (termina en _mill)

2. Click en Selected

3. Cut Z: -0.05 / Travel Z: 0.4 / Feed rate: 15.0 / Tool dia: 0.016

4. Click en Generate

Hacer lo mimo con el geometry cutout, con estos parametros:

Cut Z: -0.063 / Travel Z: 0.4 / Feed rate: 6.0 / Tool dia: 0.031

Y hacer lo mismo con el archivo de drill:

Cut Z: -0.063 / Travel Z: 0.4 / Feed rate: 15.0 / Tool dia: 0.031


10. Procesar el GCode con Grbl Controller (EL UNIVERAL GCODE SENDER NO FUNCIONA CON LOS ARCHIVOS GENERADOS ANTERIORMENTE... DON'T KNOW WHY)

Conectar al COM donde se encuentre el Arduino.

Cargar el archivo .nc grabado en el paso anterior y enviarlo a Arduino.





8. Generar GCODE con Line Grinder

En Line Grinder, abrir el archivo .gb0 (el que corresponde al Solder side que exportamos en el paso anterior)


Como el gcode que generemos lo vamos a utilizar en una fresadora, es necesario hacer flip de este diseño.
Para esto, ir a Settings y en IsoFlipMode elegir X_Flip


Luego de esto, el diseño queda así:



Si se va a utilizar una fresadora, dejar el parámetro IsoZCutLevel en -0.002
Si se va a utilizar un drypen, cambiarlo a 0.000

Presionar Convert to GCode

y luego, click en Isolation GCode

En la ficha "Isolation GCode" está el código G que necesitamos.

Guardarlo en un archivo con extension .nc, que a continuación abriremos con el Grbl Controller


9.






Crear PCB con DesignSpark para CNC


1. En DesignSpark, File / New / PCB Design


2. Presionar Next y luego elegir default.ptf en "Choose Technology File"

3. En unidades, elegir mm, luego Next

4. Marcar "Define Layers", y elegir Single Sided Board, y luego Next

5. Especificar el tamaño de la placa, luego Next

6. Definir un nombre

Establecer el origen de la esquina inferior izquierda

Click derecho en la esquina inferior izquierda de la placa
Elegir Origins / Set System Origins at Item
Debe aparecer un círculo con una cruz




Establecer los Reference Pin Pad

Los reference pin pads deben ser por lo menos dos y deben estar equidistantes de los bordes de la placa y alineados.

Pueden definirse tanto adentro de la placa como afuera (si no quisieran incluirse en el diseño)
Sirven para que puedan ser alineadas las diferentes capas de PCB que se hagan.

Para definirlos, elegir Add Pad de la barra de herramientas:
Por ejemplo:




El tamaño de estos pines debe ser 0.125 pulgadas, pero como estamos trabajando con mm, los definimos de 3.175mm
Para esto, click derecho sobre el pin, luego Propiedades / Width
Hacer lo mismo para los otros reference pin pads que se hayan creado


Dibujar la placa

Con Add Pad y con Sketch Track, dibujar la placa
** Los Pad's deben medir 1.5mm **



Generar los archivos .gbr y .drl

Output / Manufacturing Plots
Dejar marcado sólamente Bottom Copper y Drill Data [Through Hole]
Marcar Gerber y presionar RUN




Generar Isolation routes y GCODE para la placa

Abrir el software Line Grinder (v01.04)
Open Gerber/Drill File
Abrir el archivo xxxx - Bottom Copper.gbr



Presionar "Convert to GCode"
Elegir "Isolation GCode" en el menu de la izquierda



Settings para Line Grinder [TENER EN CUENTA QUE ESTA TODO EN INCHES, DEJARLO ASI]




Settings para drl:



En la ficha Isolation GCode aparece el codigo G necesario para rutear la placa de PCB



Para procesarlo en el CNC, guardar el codigo G en un archivo .nc y abrirlo con Grbl Controller (3.6.1)

NOTA!!! observar que en el codigo G aparece un comentario (... pad touchdown start ...)
Lo que esta debajo de esto son las marcas de los agujeros, para que sirvan de guia para hacer el perforado manual luego.



Generar GCode para los agujeros (Drill)

Abrir el archivo xxxx - Drill Data - [Through Hole].drl que creó DesignSpark



Abrir la siguiente URL
http://eng-serve.com/cnc/excellon_gcode.html

Pegar el texto contenido en el archivo .drl y presionar "Generate G-Code"


Guadar el texto generado (ej, drill.nc) y luego abrirlo con el Grbl Controller

OJO!!! LAS COORDENADAS NO ESTAN BIEN!!



Fuente:
http://www.ofitselfso.com/LineGrinder/LineGrinderHelp/LineGrinderHelp_DesignSparkConfiguration.html