09-09-2010 09:00 AM
Hi there, im a bit new to labview to ado anything complicated and have found myself needing to create a program that has many facets.
my current problem is i'm trying to runna stepper motor from labview. I have a comactDAQ with a NI9401 module.
my stepper motor has a little control board that you just need to supply a pulse to in order to make the motor spin, Ive found various VI's that allow me to output a pulse train and vary the frequency by clicking on a control but ideally i need to make the pulse train increase in frequency up to a certain value in a pre defined step size, hold it there for a perios of time and then stop by ramping down again. I tried a few things but it just stalls my motor out as the program is not fast enough. can anyone help?
09-09-2010 12:14 PM
Stepper motors typically stall out when you try to accelerate them too fast, not too slow. You may need more delay between your increases in frequency, or make the steps between frequency changes smaller.
-AK2DM
09-09-2010 06:04 PM - edited 09-09-2010 06:07 PM
yeah ive found im ok with steps of 50 hz starting at 350 HZ and going up to ~11K Hz. what i want to do is automatically ramp from 350 to 11K in 50 hz stepsand then hold here for 4 mins.
ive tried to modify the example Gen Dig Pulse Train-Continuous-Variable Freq_LV86.vi i found on the ni site. if i use this on its own i can hit the up arrow on the frequecy control as fast as possible and the motor doesnt stall. so i wantt to do this automatically. i tried to use the ramp VI where it outputs the ramp into an array, i then put the whole pulse train VI in a loop with a timer so it can read each line of the array but the way the program times means the digital output stops while it reads the array momentarily and hence the motor stalls as it doent have the torque.
how can i get the ramp array to be read and buffered so it changes without stopping the code? the ramp does not need to be generated on the fly each time it can hard wired so to speak as it will be the same profile every time the code is ran.
sorry i dont have a copy of the vi how i changed it on my home pc but ill post it up tm.
09-09-2010 07:22 PM - edited 09-09-2010 07:26 PM
Rather than put the entire community example into a loop, you should index through your array of pulse characteristics without stopping the counter task. For example:
Here, the event structure will timeout after a specified time. After this, the next iteration of the loop will execute, setting the corresponding pulse characteristics. Repeat for every value in your array of pulse characteristics or until the stop button is pushed.
Also worth noting is that the 2nd Generation Compact DAQ chassis (not the 9172) support buffered counter outputs. If you want a deterministic number of pulses at each given rate then you could use this feature if you are on a 9174, 9178, or 9188 chassis. The idea is to write the entire buffer to the task before it is started, and then the counter will output the array of pulses sequentially.
Best Regards,
09-10-2010 10:09 AM
thanks for the input john with a little bit of tinkering this is doing just what i want.i am running a 9174 so will look into the buffering thing. I've not done much labview so this is a massive learning curve and generally when directed right understand what is going on so the advice is greatly appriciated.
thanks again all
dom