From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW LINX + RAMPS 1.4 to control 3 stepper

Hello,

I´m trying to control with LabVIEW 3 stepper motors NEMA 17. To do that, I have Arduino Mega and LINX to connect with LabVIEW. 

The problem is that I don´t know how to make it works with the RAMPS 1.4. 

Do you know if there are some tools for labview to work with a ramps 1.4 board?

Thank you!

0 Kudos
Message 1 of 5
(3,105 Views)

I'm not familiar with the RAMPS boards but it looks like an Arduino Mega shield designed to provide additional I/O (presumably in your case for the stepper motors).

 

From a quick (and possibly wrong) guess, I'd say that the RAMPS board expects you to toggle Arduino Mega pins to control the power flow through the RAMPS board. Is that right? (If not, how do you control the RAMPS board, ignoring LabVIEW at first?)

 

If that's true, then your problem becomes just one of controlling the Mega using LabVIEW. It appears as though the RAMPS pins connect to most/all of the Mega I/O pins on the edge of the board, but I don't see a reason that would prohibit normal serial communication to the Arduino using the USB. If you're wanting to use the direct serial pins for communication (I think this is ports 1-3 on Mega, maybe?) then you'd have to check whether they are accessible around/under the shield, or via the shield.


GCentral
0 Kudos
Message 2 of 5
(3,074 Views)

First, thank you for your answer cbutcher.

Yes, your guess is right. But I haven´t fixed the problem yet.

I realize I can´t control the stepper motor because I didn´t put correctly the pins that are connected to the motors in LabVIEW. I don´t know what are the correct pins, because the stepper motor is wired to an A4988 driver (image attached), and the driver is connected to the RAMPS.

A4988-Wiring-Diagram.png

The pins of the driver where the steppers are connected are 1A, 1B, 2A and 2B. But what Arduino pins corresponds to this four pins?

Thank you everyone, it was awesome someone could help me!

0 Kudos
Message 3 of 5
(3,066 Views)

Well now I'm really guessing, but from your image I'd say you need to set P4 (or whichever Arduino pin you connected to the STEP input) to be true/false/true/false at an appropriate frequency to drive the speed of the motor (Arduino has PWM that you could use for this, with some extra "high-level" functions to prevent you having to actually worry about the frequency to closely: https://www.arduino.cc/en/Tutorial/PWM), and then the P3 is true/false for left/right, or right/left, or up/down, etc.

 

Edit: That link isn't super helpful. This one might be more useful when trying to change the frequency: SecretsOfArduinoPWM. However, as I said, this is just my guess at how to control your hardware. Read the manual! 🙂


GCentral
0 Kudos
Message 4 of 5
(3,062 Views)

Hello,

I know this is an old post but I want to do the same as you have just mentioned. Problem is, I cannot control the Arduino pins with the LINX. For example, the stepper enable pin is connected with the arduino (Mega 2560) pin number 60, and with the LINX I cannot control that pin. None of the DigitalWrite, AnalogWrite, or PWM does not work with that pin.

 

Do you have any idea how to control these pins with LINX?

 

Thank you.

 

0 Kudos
Message 5 of 5
(2,662 Views)