LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate digital pulses to run stepper motor in a sinusoidal motion profile using NI DAQ 6229 card

Solved!
Go to solution
Hi,
         I need to make a stepper motor undergo rotary oscillation with a sinusoidal motion profile. As it nears the extreme points it should decelerate and finally slow down to zero velocity and then it should reverse direction and accelerate until it reaches the other extremity where it should slow down and stop and reverse direction and repeat this motion.
        The hardware is NI DAQ 6229 and the stepper motor can be controlled using digital Hi-Low (1,0) pulses. For each high pulse(1's) the motor turns 1 step. I am able to generate a analog sine wave and convert it to digital data using Analog-to-Digital.vi  But i am not able to convert the digital data to a stream of 1's and 0's in the correct sequence to get the sinusoidal profile with the amplitude and frequency i require.
        The direction of rotation can be changed by giving a pulse to another input of the stepper motor. So only half cycle of sine wave needs to be generated and it can be replayed after changing the direction to get the full sinusoidal profile.
 
Any ways of making this approach work or any new approaches to this problem would be helpful. Thank You.
 
Regards,
Prabu.
0 Kudos
Message 1 of 8
(6,193 Views)
Hi,

Are you talking  about sinusoidal density of digital pulses?
If so,here a simple draft,that uses 1/sin(x) intervals.

Regards,
Michael


Message Edited by mishklyar on 08-10-2008 02:29 PM
_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


0 Kudos
Message 2 of 8
(6,170 Views)

Hi,

I am unable to open the VI that you posted since i am running labview ver 8.0

Is it possible for you to post it again while saving it for a previous version. This can be done from within LabVIEW by navigating to File»Save with Options»Save for Previous or File»Save For Previous Version... starting with LabVIEW 8.0.

Thank You.


 

0 Kudos
Message 3 of 8
(6,166 Views)
Shure,
Here is it LV 8.0
_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


0 Kudos
Message 4 of 8
(6,164 Views)
Hi,
  How do i control the frequency in this??   Say, i wanted the motor to oscillate with a frequency of 2 Hz, how can i do that?
My application requires that i be able to control both the frequency and amplitude.
 
Thank You.
 
 
0 Kudos
Message 5 of 8
(6,142 Views)
Or is there any other method to solve this?
also, i use a BNC-2110 connector block and the stepper motor has a step resolution of 1600steps/revolution or 0.225deg/step. The DAQ card is PCI-6229.
0 Kudos
Message 6 of 8
(6,132 Views)
About frequency:

Say you have 128  (0,1) points (A whole sine).You need 2 Hz -> to produce this sine twice a second.
So you put a card to output at 2*128=256 samples per second.

Regards,
Michael
_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


0 Kudos
Message 7 of 8
(6,122 Views)
Solution
Accepted by topic author prabu17

Hi,

         I finally figured out a way to do it. The analog sine wave is converted to digital and sampled. Consecutive values are compared and if the least significant bit(LSB) changes then a pulse is sent to the stepper motor to turn one step.

 

I have included the sub-VI's that accomplish it for the particular stepper motor and connector block i have. The front panel of both sub-VI's are quite messy but the block diagrams should be much clearer. The sub-VI's get their inputs from a third VI which i have not included. So take a look at the VI connector panel to figure it out. Hope this helps. Kinda messy but worked out fine in the end for my application. 

 

Thanks again for all the help. I appreciate it very much.

 

Regards,

 

Prabu Sellappan

Graduate Student

Aerospace and Mechanical Enggineering

University of Southern California

 

0 Kudos
Message 8 of 8
(5,762 Views)