Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling single stepper motor with PCI-6503 card and combining VI's

I'm an MSc Medical Physics student and I'm doing a project that involves using Labview to control a stepper motor, which is being used to rotate a detector. I'm completely new to LabView and I'm having trouble getting started.  This is the hardware i am using:

 

Stepper Motor :  12v, 0.16A, 1.8 deg step 

PCB - RS 240-7920 

LabVIEW 2009 - full suite

NI PCI-6503

NI CB50 NLP to connect the PCI to the PCB

 

I have connected the PCB to the CB50 through a clock and a 5 voltage input. I have achieved Single Sample pulses through Write Dig Chan.vi and the DAQ Assistant but when i try to produce N samples i get an error that the device only supports single samples and handshaking.My questions are:

 

a) Could i make a piece of code that loops the Write Dig Chan.vi as many times as i wish, in order to get a series of samples?

b)Is there a way to combine two example vi's like an input and an output in a single panel?

 

My goal is to create a panel where i set a desired number of steps and a frequency and aquire digital pulses from the detector which then are represented in a graph.

 

Any help would be greatly appreciated.

 

Thank you

0 Kudos
Message 1 of 5
(5,734 Views)

Hi George,

 

Can you provide me with a little more detail about how you are physically connecting to the motor controller board, such as what signals do we need to pass to it in order for it to do what you want?

At what rate do we need to output to it?

It should be a trivial task to make some code in LabVIEW once we have all of the information about the application.

 

 

It is possible to simply place the code you currently have inside a loop, however, there may be better ways of doing it.

 

Also, it should be simple enough to combine multiple VI's into a single VI. If you do combine two VIs you must ensure that dataflow is maintained to ensure that the two parts of the new VI execute in the correct order.

 

Kind regards,

Stephen C
Applications Engineer
0 Kudos
Message 2 of 5
(5,717 Views)

Hi Stephen,

 

Thanks for getting back to me so quickly on this

 

The following diagram describes the connections of the PCB board. The right part is connected to the stepper motor, a 12V supply and ground, as instructed.

 

http://img-europe.electrocomponents.com/largeimages/L240792-01.gif

 

On the left, I have connected the +5V OUT to port PA7 of the PCI-6503 and CKI to port PA6. I provide constant flow to PA7 and turning on/off PA6 from the virtual panel of Write Dig Chan.vi rotates the motor by one step.

 

The desirable rotation rate should be something between 10 and 1 steps per second, although the precise speed is not important as long as I know the motors position at any time.

 

Thanks again

 

George

 

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

Hi George,

 

What sort of data is it that you aim to acquire from the sensor? I am just trying to build up the picture in my mind of what we actually need to do.

We may need to synchronise the output and input tasks in a manner that gives the motor time to settle in its new position before we acquire the data.

 

Best regards,

Stephen C
Applications Engineer
Message 4 of 5
(5,693 Views)

Hi Stephen,

 

Thanks ever so much for getting back to me about this. Sorry that it's taken me a little while to reply.

 

Basically the idea of my project is to produce a particle detector capable of detecting the direction of a radiation source.  The aim is to mount a 'scintillator crystal' within a PVC container so that it can be rotated by the motor.  The scintillator is a material that produces light particles when exposed to radiation.  The theory is that as the crystal rotates the depth of the crystal, relative to the radiation source, will change.  This, in turn, will alter the quantity of light photons produced and this will be measured by a photomultiplier tube which will detect and count the light photons and convert them to a current.  My intention is to convert this signal to a digital output that can be returned to the computer and logged, ideally within Labview. 

 

The data should be quick to recover so I don't need to leave a long delay between movements, neither do I need the crystal to move quickly.  I just need to  know it's position at any particular time.  I was hoping to initially reach a situation where the motor can be controlled.  This would allow me to complete the project and log the data manually if necessary, and then alter the program later to provide a data logging function. 

 

Thanks again for all of your help

 

George

 

 

0 Kudos
Message 5 of 5
(5,644 Views)