02-12-2009 10:47 PM
Currently, I have on hand a USB6008. I need to drive a stepper motor with through a darlington array for application in a solar tracker. The stepper motor is a 12V 4coil unipolar unit, and has 6 wires running from it. I need some guidance on writing a VI, so that when I have thw four coils of the stepper connected to the digital outputs of the USB6008, I can energize the coils in a proper stepping sequence.
At the moment, I am trying to perform just a full step movements, and I only need the motor to rotate cw/ccw. I would really appreciate some help or guidance in writing a VI that can automatically respond to the impulse of my sensors.
There will be a differential voltage fed to the analog inputs of the daq, acquired using DAQ mx, and this voltage will go through a comparator. I need the program to run continuously, and when one voltage is more than the other, the motor will be moved in one direction, and the other when it is the opposite situation. When the difference is zero, the motor should just hold its position. However, this part is secondary, and my first priority now is to generate the stepping sequence .
So, what I would like to know is, how I can create a VI that will keep running the sequence of digital outputs in the following manner
1000
0100
0010
0001
continuously whenever the motor is set to do so, and also able to run the sequence backwards. Thanks!
02-14-2009 08:08 PM
Hi Y.Y,
The best way to achieve this is to use state machine design pattern.
I attached an example that you can modify it to suit with your application for your reference.
Regards, Kate
02-14-2009 09:26 PM
02-15-2009 01:18 AM
Hi YY,
Please refer to attached file.
Regards, Kate