Introduction: CONTROL STEPPER MOTOR SPEED WITH LABVIEW AND ARDUINO

I Made this in Proteus

u CONTROL STEPPER MOTOR SPEED WITH LABVIEW AND ARDUINO...!! wolaa

Step 1: This Tutorial Is:

> Using Labview to interface Arduino to PC via USB port.

> Using Labview to send data that describes Motor Speed to Arduino without any toolkits.

> Solving the problem of Arduino serial port hanging.

> Using Arduino to generate Stepping pulses.

> Using Arduino Mega’s Serial port 1 to show stepper motors speed on a serial LCD.

The best way to interface Arduino to PC is via its USB port. Arduino uses virtual Serial COM port to interface its USB connector to PC. At the same time Arduino uses its USB to interface its own serial (USART) port…. Bravo Arduino!!!

To send data to Arduino from your computer just connect it to USB port and use a program that can deal with computers serial port. This program can be Aeduino Serial port monitor, MIKRO C Serial terminal tool, PIC MP-LAB, or a program you establish. The one you build on yourself can be made by using a programming language like C, C#, C++, Python, Basic, NI-LABVIEW… etc.

Your own program not only has the advantage of interfacing the port, but performing a specific mission you need in your project as well. And so I do down here.

Step 2: In Labview (any Version) Establish the Following Front Panel

Step 3: Establish the Following Block Diagram. (click to Enlarge)

Step 4: And Here Is the Another Case of (if) Statement.

Step 5: This Virtual Instrument:

>> Starts communication with Arduino.

>> Detects if there is a change in control knob value.

>> If there is a change it sends the new value to Arduino.

>> Else, it clears serial port Input/output register to avoid data overflow and serial port overloading.

>> When pressing STOP, it sends “0” (brake or hold order) to Arduino.

Step 6: Arduino Code

Step 7: This Arduino Sketch:

Checks if labview sent a new value.If there is a new value, it converts it into integer byte with the same value.This integer byte represents the delay interval used in stepping sequence. That, the greater the delay the lower the speed and vice versa.Else, Arduino continue running the motor at current speed. This prevents the processor from overloading the serial port and pushes it to avoid Arduino Serial port hanging… Bravo ;)

Calculates motor speed from its resolution and delay intervals between steps as following:

Rpm = (60 x 1000 x step angle) / (360 x (delay m.sec))

Rpm = (1000 x step angle) / (6 x (delay in msec))

I used a 1.8 deg/step motor in this project and so:

Rpm = 300 / (delay in msec)

Sends the calculated motor speed to another Serial port of Arduino Mega to show if our code works

Step 8:

I simulated this tutorial with PROTEUS and worked perfectly.

In real application, it controlled my stepper motor perfectly on the long run.

Step 9: Proteus File

Enjoy.. :)

Comments

author
SciD (author)2017-05-01

In the figures under Steps 3 and 4 I see a LabVIEW icon that looks like a blue backward pointing arrow with a smaller arrow joined under it and pointing down. (It's just above the "Equal To?" icon. just inside the while loop.)

What is that? I've looked everywhere.

Also, I am new to Arduino and LabVIEW (bought the Sparkfun Kit).

If I get this, I load the INO file into the Arduino using the standard Arduino software kit, and then run the LabVIEW code, yes?

Great instructable by the way. Your showing me that I should use a "modularized code approach" (some LaVIEW code, some Arduino INO) saved me a lot of grief.

I was trying to do it all in LabVIEW alone, and it was painful

Thanks.

author
joony786 (author)SciD2017-05-03

Thanks for such appreciation , fell free to contact me . I'm hear for u Guys..!!
as for this icon did u know close loop? serch about that u will find your answe.!! more u dig more u find .

author
SciD (author)2017-05-02

Working VI please.

author
joony786 (author)SciD2017-05-03

contact me at joon786@gmail.com

author
sya'banS (author)2017-04-16

Why i canot open .pdsprj extension file fro my proteus 7.0?

author
joony786 (author)sya'banS2017-04-17

use this link http://autometronicschool.blogspot.com/2015/12/free-download-proteus-v83-sp2-with.html

author
joony786 (author)sya'banS2017-04-16

use proteus 8.3 or higher. lower version doesn't support thnks.

author
sya'banS (author)joony7862017-04-17

Thanks Joony very much, Now i used proteus 8,6 and fixed it,

If you share vi labview design, I will feel more happy wkwkwk

author
AhmedF114 (author)2017-03-04

COMPIM ???!!!

author
AhmedF114 (author)2017-03-02

hardware connections!! please

author
CiprianC8 (author)2016-09-07

how to configure proteus to comunicate with labview? ciprian_clipea@yahoo.com if you may help

author
MuhammadA759 (author)2016-09-02

i would ask if i want to send data from 2 motors or more using lapview to arduino how can i do this ??

About This Instructable

14,531views

132favorites

License:

Bio: I ain't no physicist, but I knows what matters. :p By the way, I'm an Electronic Engineer . Interested in Electronic Hobby's and ... More »
More by joony786:CONTROL STEPPER MOTOR SPEED WITH LABVIEW AND ARDUINOPID (Proportional–Integral–Derivative) ControllerMicro Servo Robot Arm
Add instructable to: