LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating trigger pulses from stepper motor

Hi All

 

I have two question regarding a project using two step motores.

 

The first and smaller question is: I have two stepper motores that's controled using Labview VI in attachment.  I have two fixed target position for Stepper motor 1 and two another different  for Stepper motor 2 that these stepper motores should ossilates between these two positions. I do this before manually by changing the target postion of each code. but it is difficult to run for long time.  How can I change this VI to run continuesly for specific loops or amount of time? Should I change target position controller to constat indicator ( two aformentioened stepper positions) and run it using loop?

 

The second question is about generationg triggering pulses after when stepper motores chaged their positions. I call stepper motor 1 and 2 (S1 and S2) and two target position for Stepper motor 1: (P1 and P2) and for motor 2: (P3 and P4). I like to have continues running Vi that: S1 gose to P1 and S2 goes to P3, simultaniusly. Stepper motores need 3-4 seconds to find their P1 and P3 position. in this moment how can I generate trigger pulses? this is a fire pulse and after 30 second measurments have stop trigger pulse to stop accuring and then S1 and S2 goes to P2 and P4 and another fire pulse is generated and so on.

any ideas?

 

 

 

0 Kudos
Message 1 of 3
(2,718 Views)

Hi hamid7180,

 

Thank you for posting to the discussion forums! For your first question, what it seems like you want is to implement either a For Loop or a While Loop in your program. Are you familiar with what the differences between these two loops, and how to use them in your program? For a reference, you can look at the below link.

 

http://www.ni.com/white-paper/7588/en/

 

For your second question, the only real way to ensure synchronization is to share clocks in the hardware. But it does not seem like that is possible with your application. Since it doesn't seem like you can use hardware timing for your application, you will have to use software timing. Here is a helpful link for ways to achieve synchronization in LabVIEW http://www.ni.com/white-paper/11466/en/

 

Also, the following information would be helpful to have.

 

1) What device are you using?

2) How long have you been programming with LabVIEW? Are you fairly familiar with the language?

3) Besides the two questions that you asked, is your program working? Is this program something that you built, or is it an example that was included with the stepper motors? 

Kevin S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,672 Views)

Check out the Elapsed Time VI.  It helps with timing.

 

What kind of signal do you need for your trigger?  The USB-6008 has software-timed AO and DO.  If you need to send out more than just a high/low, you're going to run into some issues.

0 Kudos
Message 3 of 3
(2,624 Views)