From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit switch event

Hi All,

 

after searching a bit I am turning to the knowledge base and the "web wisdom" hoping for a solution.

 

The setup is consisted of 2 stepper motors, drived by two separate SMD-76xx drivers (one for each motor) and controlled by PXI-7330 card. 

 

The two motors are moving in some sort of synchronization, i.e. when Motor 1 (M1) is moving, there is a movement of the basis of Motor 2 (M2). The movement of M2 is not detected by the encoder steps value becuase it is not actually moving. However the basis on which the system is located is moving due to M1 movement (I hope this is understood).

 

For that reason there are two limit switches (Fwd. and Rev.) on M2 movement line which are located at some designated positions in order to prevent damage to the sourounding. As M1 is moving (either forward or backward), M2 basis is also moving toward one of the limit switches. 

The main idea: if M2 reaches one of the limit switches then movement on M1 should be stopped immediatley.

 

For simplicity, you can assume that M1 is moving a LARGE linear stage and M2 is moving a SMALL linear stage which is placed on top of the larger stage. If M1 is moving the large linear stage, then the small one is moving with it (however no real movement is done in relation to the large stage but only related to e.g. the optical table where these limit switches are located). 

 

I now come to my question:

As said above, I want to move M1 and stop it if one of the limit switches in M2 is active.

I want to do it in the "event" way and not polling on M2 limit switches while M1 is moving (until e.g. reahces the target position and the sub vi will stop).

This way I can set the target position for M1 with "Start Motion" command and then the system will go back to the "Default" state machine case (with event structure in it). If an event of "Limit Switch Reached on M2" is happening then the software will move to a different case of the machine state which will "Stop motion" and e.g. notify the user.

I want to emphasize that the system is working in a way that these two motors are sunchronized by software so if M1 is moving in one direction then M2 is moving in order to compenate for the dislocation. So the above request is only for safety reasons so no damage will be caused if there will be some bug. 

 

I hope to get your help in this question. 

 

Thank you,

 

Nimi B.

 

 

0 Kudos
Message 1 of 7
(3,908 Views)

Dear Nimi,

 

Thank you for your questions.

 

Could you please exactly tell mewhat you would like to achieve?

 

Thank you

Best regards

Julien De Freitas

Applications Engineering Group Leader / Certified LabVIEW Developer (CLD)
National Instruments Switzerland
0 Kudos
Message 2 of 7
(3,868 Views)

Hi,

 

Thanks for replying.

 

I would like to get an event when the limit switch is reached on motor in axis 2 while motor in axis 1 is moving. When this event happens I would like to stop motion on axis 1.

 

Hope it helps.

 

Nimi B.

0 Kudos
Message 3 of 7
(3,866 Views)

Dear Nimi,

 

Thank you for your fast reply.

 

I would suggest you to use the retriggerable tasks with NI-DAQmx. Have you already thought about it?

http://www.ni.com/tutorial/5382/en/

 

 

Julien

Julien De Freitas

Applications Engineering Group Leader / Certified LabVIEW Developer (CLD)
National Instruments Switzerland
0 Kudos
Message 4 of 7
(3,861 Views)

Dear Julien,

 

thank you very much for your answer. I will have to read more about it in order to understand how it helps me.

I would not mind getting more references and maybe examples about this issue if you can send me. 

 

Thanks 

0 Kudos
Message 5 of 7
(3,847 Views)

Is there a reason why you can't just ORed axis 2 limit switches with axis 1 limit switches?

 

Ben64

0 Kudos
Message 6 of 7
(3,397 Views)

The main problems lies in the "find reference" VI

I agree with you that on regular movement of axis1 I can just poll the limit switches of axis 2 and stop movement if something is wrong.

However, my problem lies in one of my procedures to align the setup. I am moving axis1 to its forward or reverse limit switch in order to calibrate the location of these points. For that purpose I am using the VI module of the 73xx software which looks for the reference.  While running this VI I cannot poll on the limits switches of axis2.

Meanwhile my solution was to indeed sepatare this procedure of finding reference into something similar to this example

http://zone.ni.com/reference/en-XX/help/372134F-01/ni-motion_help/ref_move_lv_diagram/

which give the command to look for the reference but then returns immediatley so I could poll on the limit switches and stop in case of a problem (or just stop if ref was founded).

I thought that there is a good way to just get some sort of interrupt event in case such limit switch is reached.

Thanks for the help.

0 Kudos
Message 7 of 7
(3,394 Views)