NI Home > Community > NI Discussion Forums

LabWindows/CVI

Showing results for 
Search instead for 
Do you mean 
Reply
Member
AliT
Posts: 24
0 Kudos

Controlling stepper motor using LabWindows/CVI

[ Edited ]

Hi, I'm not sure whether this is the right place for asking this question or not and if not, then please guide me to the right place for asking such question. Thanks.

I have a stepper motor with the Vector Network Analyzer Anritsu MS4623B. I got it up and running with the LabWindows/CVI. I need to sync the motion of the stepper motor with my data acquisition. Basically, I have to acquire the data in a way that in the start the motor will come back to home position wherever it was and then I want to move it to the specific position to do the measurements (For Example, I want to measure the 40 GHz channel between 1m to 3m movement of a stepper motor on a linear positioning system (ball-screw)). I've interfaced the VNA with the PC using LabWindows/CVI and I've controlled the clockwise and anti-clockwise movements of the stepper motor using LabWindows/CVI but I'm unable to sync the system in a way that whenever I run the code, the motor will run back to the home position and then move to a specific measurement start position and move till the end position and in between do the increment and stop and acquire the data. Is there any one to help me please? It's really urgent please and I'm doing this thing first time so please guide me in a proper way. I shall really apprecaite that and will be highly obliged with you. Thanks for your time and concern.

 

Thanks and Regards.

:smileyhappy:

Member
Wee-Bey
Posts: 173
0 Kudos

Re: Controlling stepper motor using LabWindows/CVI

Hi there! I see you posted on some other threads, but as this is its own unique question, it's probably best handled here on the new thread you made.

 

To start off, are you using NI-Motion? If not, how are you controlling your motor? I see you might be using serial commands to accomplish this, because you have some references to "RS232"/"COM" on your front panel under motion control. And are you using encoder feedback to know where your motor is?

 

Thanks!

Ravi A.
National Instruments | Applications Engineer
Member
AliT
Posts: 24
0 Kudos

Re: Controlling stepper motor using LabWindows/CVI

Thanks for your reply Ravi, basically I'm using LabWindows/CVI COMWRITE commands to move the motor to clockwise and anticlockwise direction and for knowing the home position of the motor, there is basically a sensor switch or you can say the 'Limit Switch' which will sense automatically the home position of the motor on the ball-screw linear positioning system. In addition to this, I'm using the following manual to keep up my work which you can find in the attachment. Now what I really want to get help in is basically to automate this process that whenever, I'll run the LabWindows/CVI program, the motor will run to the home position and then it will move to the start position from where I want to take the measurements and after reaching the start position, it will increment automatically and acquire data and then move to the end position and after completing the measurements and acquiring data, it will move to the home position again or even if it will not move to the home position, it's fine, but in the start it must have to move to the home position. So, now can you please help me in this regard as I'm really feeling helpless at this end and I'm really worried. :smileysad:

I shall be highly obliged with you Ravi and I'll really appreciate that if you would help me in this regard.

Thanks in advance.

Please see the manual in the attachment.

Member
James_W.
Posts: 86
0 Kudos

Re: Controlling stepper motor using LabWindows/CVI

Hi Community,

 

Just thought I'd post the solution that Ali and I found to his problem on here for completeness.

 

We found that the manual stated a command that will move the motor clockwise/anticlockwise for a certain number of steps OR until the limit switch is pressed. So all Ali has to do is to run this command, with the number of steps to move as the maximum and the motor won't stop until it presses the limit switch to indicate that it is in the home position.

 

I've included a screen shot of the manual with the two commands for moving the motor highlighted.

 

Kind regards,

James W
Controls Systems Engineer
STFC