LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert an emergency stop to stop a moving motor ?

Hello, I am new to Labview and I am trying to control a motor (making it move in a sequence of defined moves). As my code is not finished and I am experimenting with it, I would like to add an emergency switch to stop the motion of the motor if I realize while it is moving that  a wrong input has been passed to it (e.g. does not stop rotating), but cannot figure how to stop the moving instruction while it is running.

 

0 Kudos
Message 1 of 11
(6,302 Views)

You'll need to share your code. We have zero information here for us to give a helpful reply. My off-the-top-of-my-head reply would be "tell the motor to stop when the user presses a stop button."

Please include a Snippet of your code, or attach your VIs, so that we can better assist you.

 

Edit: RavensFan is 100% right. With something than can harm you or your hardware, you should have a physical E-stop switch wired to the power on that device.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 11
(6,285 Views)

You should consider have a real hardware stop button that will stop the motor if you are talking about an emergency stop.  A moving motor can be very dangerous if you lose control if it, and I wouldn't trust software to always have control.  Put in a real button that will disable or de-energize the motor in an emergency for safety.

 

As James said, a software way of doing is possible in a n0n-emergency situation, but with the minimal information you provided, there is nothing we can help you with.

Message 3 of 11
(6,269 Views)

I attach a simplified code (first file) with only one moving step: the motor is from Thorlabs and uses APT methods. My moving step is triggered by a button that starts a case loop with the MoveAbsolute method that moves the motor to the predefined position.

There is a StopImmediate method within the APT methods range that is supposed to stop the moving motor, however I tried to use it and it did not work. What I did was to put an emergency stop button on the front that triggered a case loop put inside the one of the MoveAbsolute method. In this case, the debugging showed that the button is tested before the MoveAbsolute begins so it is of no use and I cannot figure out how to make it work. (the corresponding code is in the second file)

Download All
0 Kudos
Message 4 of 11
(6,257 Views)

I would suggest you disable the movement invoke nodes if you want to stop of the motor. You might be observing that you stop it, but then it is told to start again right away. You should set your Rotation Stop button to Switch When Pressed instead of Latching.

Stop Immediate.png

 

You also have no timing set up in your loop, so you're running as fast as possible. This is bad. Add a Wait function of at least a few milliseconds.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 5 of 11
(6,249 Views)

you can use this vi to  emergency stop the software 
but stopping the software is not good way to stop a hardware esp a motor you need to have some feedback data from motor to stop it suddenly 

by approprate pulse control not by stopping software 

 

0 Kudos
Message 6 of 11
(6,244 Views)

@Hatef.fouladi wrote:

you can use this vi to  emergency stop the software 
but stopping the software is not good way to stop a hardware esp a motor you need to have some feedback data from motor to stop it suddenly 

by approprate pulse control not by stopping software 

 


DO NOT DO THIS

If you have already told the motor to go to a location and you want to cancel that command, cutting out LabVIEW will not help the situation. The only time that force quiting the VI/LabVIEW is appropriate is if the equipment has continuous communication with LabVIEW and will stop itself when that communication is lost. Your ActiveX communication does not have this failsafe.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 7 of 11
(6,236 Views)

DO NOT rely on stopping LabVIEW to STOP your motor.  Stopping the software may leave the hardware in an unknown state, often the last commanded state which was RUNNING!

 

It is far better to use a hardware emergency stop switch (plus relay, contactor and whatever else is needed) and to monitor the condition of the switch and the motor from software (if it is still doing anything).

 

Lynn

Message 8 of 11
(6,201 Views)

@johnsold wrote:

DO NOT rely on stopping LabVIEW to STOP your motor.  Stopping the software may leave the hardware in an unknown state, often the last commanded state which was RUNNING!

 

It is far better to use a hardware emergency stop switch (plus relay, contactor and whatever else is needed) and to monitor the condition of the switch and the motor from software (if it is still doing anything).

 

Lynn


Lets not forget limit switches!


"Should be" isn't "Is" -Jay
Message 9 of 11
(6,195 Views)

@JÞB wrote:

@johnsold wrote:

DO NOT rely on stopping LabVIEW to STOP your motor.  Stopping the software may leave the hardware in an unknown state, often the last commanded state which was RUNNING!

 

It is far better to use a hardware emergency stop switch (plus relay, contactor and whatever else is needed) and to monitor the condition of the switch and the motor from software (if it is still doing anything).

 

Lynn


Lets not forget limit switches!


I didn't expect that many kudos for the obviousSmiley Surprised you have a motor moving something you place limit switches to stop the motor before you destroy the motor.  If you don't- then you place limit switches to stop the motor before you destroy the replacement motor.


"Should be" isn't "Is" -Jay
Message 10 of 11
(6,149 Views)