LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple stepper motor/ultrasonic sensor LabVIEW control

hello all. I am currently on a project, involving actuating pixels controlled by ultrasonic sensor (distance values I recieve). the actuation is handled by one stepper motor per pixel (motor: 12v/1.5A) (i have to run 9 such pixels). i have decided to interface 1 arduino mega with LabVIEW so as the keep short my budget. i had some queires and was seeking help.

1. my design involves actuating all 9 motors individually and distinct, will the LabVIEW design be same as for one motor? (i have run only a single motor code and am facing difficulty with multiple control)

2. my application requires real time value processing. i just hope so many motors controled would not slow down my pixel motion?

also I would like to know if there are any other downloadable packages that may assist/ease me in my application.

any queries/ans from a different perspective are also welcomed.

0 Kudos
Message 1 of 8
(7,148 Views)

What are "actuating pixels"?

Are you using LINX or LIFA or neither?

If you are looking for actual 'real-time' control and data processing using LabVIEW, you'll probably need something more powerful and faster communicating than an Arduino.  It sounds like a myRIO would be a much better solution.

0 Kudos
Message 2 of 8
(4,991 Views)

For driving 9 stepper motors I suggest you use an Adafruit Motor/Stepper/Servo Shield Version 2.  See:

<http://www.adafruit.com/products/1438>

Each shield can drive two stepper motors.  The shields use I2C and are addressable.  Up to 32 shields may be stacked.  This means you could drive 64 stepper motors from one Arduino.  However you can only drive one stepper motor at a time.  You will need to assemble the shields.  Some soldering is required.   The shields are not ion stock.  However considering the number of stepper motors you want to drive I believe it is worth the wait.

You may be able to use LIFA an d an Arduino Uno.   But for more processing I suggest you use LINX.  LINX has support for I2c with Chipkit Uno and MyRIO devices.

hrh212

0 Kudos
Message 3 of 8
(4,991 Views)

the actuating pixels rise up and form a surface for a detected object or can also perform predefined paterns.

here, these three video links will help you get a clear idea regarding my plan.

https://www.youtube.com/watch?v=z3B0uHcv1Lo

https://www.youtube.com/watch?v=hJSfPgJEXKE

https://www.youtube.com/watch?v=V0ihZ3u5Stk

i got LIFA on one of my pcs and LINX on another. Infact I am switching on to power window dc motors rather than the complex stepper motors for my actuating mechanism. Also, I dont have a clear idea about the possiblity of such a project on LabVIEW.

And as you suggest about using a better controller, I feel, if i use 9 of the dc motors (rather than steppers) for this application, an arduino mega must be able to process it without a significant lag.

your say?

0 Kudos
Message 4 of 8
(4,991 Views)

Both LIFA and LINX do not come with an example for driving a DC motor shield or a modular H Bridge. Some  DC motor shields or modular H bridges may be easy to use with LIFA. Others may not be easy to use with LIFA.  I suggest you tell us what motor shield you are planning to use.  We can then compare your  choice with past experiences and provide comments on how hard or easy it will be to use your chosen DC motor shield with LIFA.

One possible choice for a modular H bridge is <https://www.sparkfun.com/products/9457>  Each module can drive 2 DC motors.  Each motor requires the use of 2 digital pins and one PWM pin. Therefor 9 DC motors will require 18 digital pins and 9 PWM pins,  An Arduino Mega 2560 has 54 digital pins and 15 of the digital pins may be used as PWM pins. 

Another possibility is an an Adafruit Motor/Stepper/Servo Shield Version 2.  See:: <http://www.adafruit.com/products/1438>

Each Adafruit Motor/Stepper/Servo Shield Version 2. can drive 4 DC motors.  Adafruit supplies a library that makes it easy to use the Ardyuino IDE or Labview's serial interface capabilities with the Adafruit Motor/Stepper/Servo Shield Version 2.  There is an example in the LIFA Documents folder  for using Labview with the Adafruit Motor/Stepper/Servo Shield Version 2.  The example does not use LIFA.

From when one motor stops to when an other motor starts moving will  take approximately 10 to 25 milli seconds.  The length of time to switch to another motor is mostly dependent upon LIFA or Labviewe overhead and not the speed of the micro controller.

hrh212.    

0 Kudos
Message 5 of 8
(4,991 Views)

i am currently using 2 drivers, that is one 2A and another 5A which can drive 2 motors each as you said(il buy more for the rest of the motors). Either way, i have planned on dedicating 1 uno just for my ultrasonic sensor value acquisition and one mega just for motors and the extra led lighting effects.

i tested a program which involved running one motor from the ultrasonic sensor value i get, and it worked out pretty good. just that it takes a small lag time in turning on and off the motor (its very slight though). and as you said that it is due to the labview overhead and not the arduino.

is there anything i can do to prevent a lag time caused on labview(any package which may help out).

using arduino is fixed for me due to the economical and ease in programming factors.

neil23

0 Kudos
Message 6 of 8
(4,991 Views)

The fastest way to switch between DC motors is to keep all the decision making procedure on when to switch to a different DC motor on the Arduino Mega 2560.  This means don't use LIFA and a very limited use of Labview with the Arduino Mega 2560.

hrh212

0 Kudos
Message 7 of 8
(4,991 Views)

You haven't said what event controls when you switch to a new motor. But if the event is related to a ultra sonic  sensor reading I suggest you use an Arduuino Due instead of an Arduino mega 2560.  The Arduino Due has more processing power than an Arduino Mega 2560 and you will be able to run both your ultra sonic sensor and DC motor control routines on one one computer board.  The Arduino Due has 54 I/O pins and 12 of the 54 pins can be used for PWM.  The Arduino Due uses the Arduino IDE.

The down side to using an Arduino Due is the present versions of LIFA and LINX are not compatible with the Arduino Due.  And the I/O pins are rated at 3.3 volts.  This means some of the older shields that use 5 volt logic and built for the Arduino Uno and the Arduino Mega 2560 may damage an Arduinmo Due I/O pin.

For more information on an Arduino Due see:

<http://arduino.cc/en/Main/arduinoBoardDue>

hrh212

0 Kudos
Message 8 of 8
(4,991 Views)