LabWindows/CVI

Showing results for 
Search instead for 
Did you mean: 
Reply

Controlling stepper motor using LabWindows/CVI

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:

0 Kudos
Message 1 of 7 (4,294 Views)
Reply
0 Kudos
Highlighted

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
0 Kudos
Message 2 of 7 (4,267 Views)
Reply
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. Smiley Sad

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.

0 Kudos
Message 3 of 7 (4,218 Views)
Reply
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
0 Kudos
Message 4 of 7 (4,116 Views)
Reply
0 Kudos

Re: Controlling stepper motor using LabWindows/CVI

I'm working with a UMI 7774, PCI 3334, step motor and encoder. I'm using a NI motion assistant and MAX. I have to put this system in LabView. It's necessary create bottoms to start,stop, torn the left and right and control de velocity.

 

Could you send your project , please ?

0 Kudos
Message 5 of 7 (929 Views)
Reply
0 Kudos

Re: Controlling stepper motor using LabWindows/CVI

[ Edited ]

That project won't help you in any way: it's in LabWindows/CVI while you are using LABVIEW, it's serial and not NI motion and it seems also related to a different hardware! 

I suggest you to post a descriptive question to the appropriate board


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 7 (912 Views)
Reply
0 Kudos

Re: Controlling stepper motor using LabWindows/CVI

I'm working on the same thing almost as ALITa motor with spectrum analyzer ZNB8 ROHDE & SCHWARZ and I'm stuck in the same points that ALIT, made the idea is to make measurements by turning the engine as a starting point and end and not that I chose is the non-continuous mode, but I just happen to run the motor in continuous mode (clockwise and anti_clockwise), have you solutions help pleaasee

here is my code I have tried but I do not have got what i want :

 

int CVICALLBACK RunMotor (int panel, int control, int event,
        void *callbackData, int eventData1, int eventData2)
{
 switch (event)
 {
  case EVENT_COMMIT:
   
 GetCtrlVal(panelHandle,PANEL_Start,cclimit);


 CommandLL=ComWrt(1,"ll",StringLength("ll"));
   
 
 CommandLLL=ComWrt(1,cclimit,StringLength(cclimit));
 CommandLLLL=ComWrt(1,"\r",StringLength("\r"));
 
 
 CommandSK=ComWrt(1,"SK",StringLength("SK"));
 CommandSKK=ComWrt(1,cclimit,StringLength(cclimit));
 CommandLLLL=ComWrt(1,"\r",StringLength("\r"));
 
 
  
  
  
  
 GetCtrlVal(panelHandle,PANEL_Stop,cwlimit);
 CommandUL=ComWrt(1,"UL",StringLength("UL"));
 CommandULL=ComWrt(1,cwlimit,StringLength(cwlimit));   
 
 
 cwlimit==(cclimit[2])+1;
 sprintf(cc_limit,"%s",cclimit);
 
 GetCtrlVal(panelHandle,PANEL_Step,&Step);

 GetCtrlVal(panelHandle,PANEL_intervalTimer,&IntervalTimer);

0 Kudos
Message 7 of 7 (440 Views)
Reply
0 Kudos