LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication with stepper motor driver

Hi there,

I have been reading about questions similar to this but i am so new to Labview and hardware I'm confused. I am doing an undergraduate chemical engineering thesis project using LabVIEW, a stepper motor and a stepper motor driver.

There is an existing setup that communicates with the stepper motor driver using the serial port of a computer. I now basically wish to control the stepper motor via the stepper motor driver using Labview, communicating via the serial port. I believe that there is some existing LabVIEW examples that have serial port communication examples?

The control of the stepper motor driver will be very basic. I am collecting data from a scale that will have a force applied by the stepper motor. The data from the sale is being aquired by Labview. The stepper motor driver requires on/off (high voltage/low voltage) in order to activate it and drive the stepper motor. When the load on the scale reaches a certain point I wish to reverse the direction of the stepper motor automatically. (Some sort of trigger) Does this sound like something that is easily achievable? Sorry that my question is so vague and I haven't worked this out but I have had this dumped on me with only 9 weeks remaining. Any help is appreciated.

Cheers,
Dave
0 Kudos
Message 1 of 4
(3,985 Views)
LabVIEW should have no problem communicating over the serial port to the driver (assuming that there is a serial port, fewer computers are coming with them!). If you know the syntax for the commands you will just need to build a sub-vi that constructs these command strings and outputs them using the serial port. There are a number of examples. The things that usually confuse things are:
1) selecting the correct serial port
2) setting up the comm parameters (baud rate, bits, etc.) to agree at both ends of the communications, the PC and the controller
3) having a correctly wired communications cable (some applications need pins 2 and 3 swapped at one end). If you already have an application that talks to the controller then this one should be ok.

As to having LabVIEW detect conditions to change the direction, this should also be no problem, as long as the program is structured properly. Not knowing how the controller works makes it a little more difficult to give more answers. For example, does it make absolute or incremental moves? Absolute means that you have a starting reference and all moves are made from that (i.e if you command it to move 3.0 cm and then 4.0 cm the second move will only be 1.0 cm, from 3 to 4cm. If it using incremental then the second move would take it to 7.0 cm. Knowing which way the controller works is important in the design of your over all system. Also, does this setup have a way to find a "home" (zero) position? Otherwise you will have a difficult time make repeated movements, and your pressure measurement will not have a reference to a movement distance.

Don't be too intimidated by this, give it a try, ask more questions and good luck. Just keep your hand on the power switch the first few times you initiate movement towards stationary objects!

Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 4
(3,978 Views)
Hi there,

Thanks for the great reply. The motor uses incremental steps. For every single pulse the motor moves one incremental step.

Cheers,
Dave
0 Kudos
Message 3 of 4
(3,961 Views)

Hi Dave,

I was searching help for my thesis work and I read about this your thesis work project. It sounds really familiar because I'm just in the same position. Exept I have little bit more than nine weeks to complete.

Did you get this project done? If did, could you give me some tips, example screenshot or *.vi so I could get my project running?

I'm controlling stepper- motor where the driver is integrated into the motor. I'm using LV 8.0.

My only purpose in this point is to get the motor take 200 steps and then wait for time x and then move again the same 200 steps.

 

I've been searching for tips and examples for a few weeks already but my work is not proceeding.

 

BR,

Markus Viitanen

Tampere, Finland

0 Kudos
Message 4 of 4
(3,833 Views)