Arduino CNC Shield V3 &A4988

Podemos usar esta shield con el firmware GRBL , o sin el. Entonces utilizaremos la libreria <AccelStepper.h> con la posibilidad de usar cuatro motores ,en cuyo caso hay que puentear los pines 12 y 13 con las entradas step y dir del driver A. Del mismo modo el pin 8 del arduino Uno debe estar a nivel bajo para que se activen los motores, a menos que cambiemos el estado del pin a traves de nuestro sketch.

Ejemplo de distribución de pines tomados de un ejemplo para control de un robot “”scara” de cuatro motoresy un relé.

#define limitSwitch1 11
#define limitSwitch2 10
#define limitSwitch3 9
#define limitSwitch4 A3 //pin CoolEn de la shield
// Define the stepper motors and the pins the will use
AccelStepper stepper1(1, 2, 5); // (Type:driver, STEP, DIR)
AccelStepper stepper2(1, 3, 6);
AccelStepper stepper3(1, 4, 7);
AccelStepper stepper4(1, 12, 13);
 gripperServo.attach(A0, 600, 2500);

Firmware grbl

Adquirí el kit arduino uno con la shield v3 y los drivers A4988 Actualmente utilizo la versión 1.1 de GRBL y el sitio web que va a aclararte casi todo es este:

https://github.com/gnea/grbl

https://github.com/gnea/grbl/wiki

Cambios de versión de grbl que afectan al Shield V3

En esta imagen se presenta el firmware de las primeras versiones de cuyo wiring se definió el diseño de la cnc shield v3.

Version antigua

Pero a partir de la versión 09c y ya en las mejoras de la grbl 1.1 se modifico el firmware para añadir nuevos $.

New ‘$’ Grbl settings for max and min spindle rpm. Allows for tweaking the PWM output to more closely match true spindle rpm. When max rpm is set to zero or less than min rpm, the PWM pin D11 will act like a simple enable on/off output

Nuevas versiones

Tenemos 3 ejes y 4 motores, en la CNC shiel vereis los ejes X, Y, Z perfectamente identificados y un cuarto que está marcado como A. Este eje se podría usar de forma independiente, pero si querems montar una cnc con un eje Y movil, necesitariamos dos motores. Habria que hacer dos puentes en la fila de la Y del grupo d ejumpers y el driver A estaria en paralelo con el driver Y.No podremos utilizar el driver A separadamente ya que necesitariamos los pines 12 y 13.

A partir de la version 0.9c el pin 12 del arduino se utiliza como “z-limit” ya que el pin 11 se utiliza como salida PWM que controlará los valores de rpm como maximo y minimo del spindle o husillo .Asi que si vamos a utilizar los hard limits tendremos en cuenta este cambio cableando el z limit al pin 12 que viene serigrafiado como spindle enable .El pin 13 se encargaria de cambiar la direccion del giro del spindle.

Driver A4988

The A4988 is a complete microstepping motor driver with
built-in translator for easy operation. It is designed to operate bipolar stepper motors in full-, half-, quarter-, eighth-, and sixteenth-step modes, with an output drive capacity of up to 35 V and ±2 A. The A4988 includes a fixed off-time current regulator which has the ability to operate in Slow or Mixed decay modes.
The translator is the key to the easy implementation of the
A4988. Simply inputting one pulse on the STEP input drives the motor one microstep. There are no phase sequence tables, high frequency control lines, or complex interfaces to program.
The A4988 interface is an ideal fit for applications where a
complex microprocessor is unavailable or is overburdened.
During stepping operation, the chopping control in the A4988 automatically selects the current decay mode, Slow or Mixed. In Mixed decay mode, the device is set initially to a fast decay for a proportion of the fixed off-time, then to a slow decay for the remainder of the off-time. Mixed decay current control results in reduced audible motor noise, increased step accuracy, and reduced power dissipation

Los puentes que estan en a shield implican que un valor de nivel alto corresponde con el puente puesto y nivel bajo sin poner ya que un extremo comun de los puentes esta conectado a VDD

En la red podremos ver multitud de ejemplos para calcular la tensión de referencia de los drivers en sus ejes XYZ. Segun su DataSheet podemos leer esto:

Internal PWM Current Control. Each full-bridge is 
controlled  by a fixed off-time PWM current control circuit that limits   the load current to a desired value, ITRIP . Initially, a diagonal pair  of source and sink FET outputs are enabled and current flows  through the motor winding and the current sense resistor, RSx.
 When the voltage across RSx equals the DAC output voltage, the  current sense comparator resets the PWM latch. The latch then  turns off the appropriate source driver and initiates a fixed off  time decay mode
 The maximum value of current limiting is set by the selection of  RSx and the voltage at the VREF pin. The transconductance function  is approximated by the maximum value of current limiting,
 ITripMAX (A), which is set by
 ITripMAX = VREF / ( 8 x RS)
 where RS is the resistance of the sense resistor (Ω) and VREF is  the input voltage on the REF pin (V).
 The DAC output reduces the VREF output to the current sense
 comparator in precise steps, such that
 Itrip = (%ITripMAX / 100) × ITripMAX
 (See table 2 for %ITripMAX at each step.)
 It is critical that the maximum rating (0.5 V) on the SENSE1 and  SENSE2 pins is not exceeded.

Según mi experiencia lo que he comprobado es que girando el potenciometro totalmente ccw comprobaremos que el motor no gira, asi que una vez que demos la orden de movimiento iremos moviendo cw el potenciometro hasta que comience a girar comprobando con la mano la fuerza adquirida.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Translate »