Welcome! Log In Create A New Profile


Controlling stepper motors with LabVIEW+RAMPS 1.4

Posted by lacorca 
Controlling stepper motors with LabVIEW+RAMPS 1.4
April 30, 2019 06:55AM
Hi everyone,
I´m trying to control 3 stepper motor with LabVIEW 2014. The steppers are wired to A4988 driver in the RAMPS 1.4, and the shield is connected to Arduino Mega.
I connect Arduino and LabVIEW with LINX. The problem is that I have to put the pins where the stepper is connected to in LabVIEW, but this pins are 1A, 1B, 2A, 2B in the A4988.
Does anyone know if there is a correspondence between these 4 pins of the RAMPS and Arduino pins?
If somebody has an example, I would appreciate it!
Re: Controlling stepper motors with LabVIEW+RAMPS 1.4
April 30, 2019 07:07AM
We have a section dedicated to RAMPS (I have requested that this be moved to the RAMPS section)

1A, 1B, 2A, 2B on the pololu are the output pins these go to the stepper motors

The inputs are listed in pins_RAMPS.h as follows (these are in arduino naming convention)
With standard pololu stepper drivers you can ignore the CS pins, that is for 'smart' stepper drivers with SPI ports.

// Steppers
#define X_STEP_PIN         54
#define X_DIR_PIN          55
#define X_ENABLE_PIN       38
#ifndef X_CS_PIN
  #define X_CS_PIN         53

#define Y_STEP_PIN         60
#define Y_DIR_PIN          61
#define Y_ENABLE_PIN       56
#ifndef Y_CS_PIN
  #define Y_CS_PIN         49

#define Z_STEP_PIN         46
#define Z_DIR_PIN          48
#define Z_ENABLE_PIN       62
#ifndef Z_CS_PIN
  #define Z_CS_PIN         40

#define E0_STEP_PIN        26
#define E0_DIR_PIN         28
#define E0_ENABLE_PIN      24
#ifndef E0_CS_PIN
  #define E0_CS_PIN        42

#define E1_STEP_PIN        36
#define E1_DIR_PIN         34
#define E1_ENABLE_PIN      30
#ifndef E1_CS_PIN
  #define E1_CS_PIN        44

you also might want to look at the ramps test firmware.. it moves all stepper back and forward and turn on the mosfets.
RAMPS1.4 Test code

So on the RAMPS you have 5 stepper drivers, labeled X, Y, Z, E0 and E1 You need to work out which ones you are using.

Each polulu stepper driver takes 3 digital input signals
Enable (active low) enables the driver chip and energizes the stepper motor.
Direction, sets the direction of movement, clockwise or anticlockwise
Step, move one step in the direction set above. NB with microstepping you may not get physical movement each Step, but it will jump to correct place when it can

Edited 8 time(s). Last edit at 04/30/2019 08:08AM by Dust.
Sorry, only registered users may post in this forum.

Click here to login