Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

stop motion

Hi Guys,

 

I am using PCI-7330, UMI-7764 and a third party driver to control a stepper motor. Right now, I can control the speed, acceleration, deceleration and position without no problem. I am trying to make an overloading protection for a torque cell which is amounted on the shaft of the motor.

 

I made a case structure in LabVIEW 8.6 and compare the torque with a constant number by a greater sign. If the torque is greater than the constant number, the case structure is true, then the stop motion. flx is supposed to stop the motor. However, that stop motion function is not responding. I put a pop up dialoge window inside the case structure and the window can be pop up, but the motor is still rotating. I connected the Bd ID, error and resource of the stop motion function to the load velocity and so on. There should be no connection problems.

 

I also tried the function of Enable poweroff. It doesnot work either.

 

Thanks!

 

Wenlong

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

Wenlong,

 

from your description I don't see a reason, why the stop operation shouldn't work. Could you please post some code (small example if possible)?

 

Thanks and kind regards,

Jochen Klier

National Instruments

 

 

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

Hi Jochen,

 

Thank you very much for your nice reply! I took a screen shot and attached it here. Let me know if you need further information, please.

 

Wenlong

0 Kudos
Message 3 of 11
(6,179 Views)

Wenlong,

 

thank you for posting the screenshot. This clarifies the issue. For some reason you haven't used  Stop Motion.flx, but Enable Shutdown.flx. Enable Shutdown.flx doesn't stop the move, but it enables the shutdown input of the board. Please refer to the NI-Motion help to read about the purpose of Enable Shutdown.flx. For the purpose of stopping the axis you should use Stop Motion.flx.

 

 shutdown_vs._stop_motion.png

 

Jochen

0 Kudos
Message 4 of 11
(6,176 Views)

Jochen,

 

I tried stop motion.flx first. I swiched to Enable shutdown. flx because the stop motion. flx did not work. The situation right now is neither of them works.

 

Thanks!

 

Wenlong

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

Wenlong,

 

there is really no way, that stop motion doesn't work. If it doesn't work in your program, the reason for that is probably the fact, that it doesn't get executed. Please debug your vi (probes and breakpoints) and make sure, that the while loop gets aborted correctly and that the stop motion vi gets executed. You also need to make sure, that the move is not unintentionally restarted after it was stopped (I think, due to the event structure this is quite improbable, but as I can't see the rest of your code, you need to consider this as an option).

 

To prove, that stop motion is working, please try one of the single axis examples, that ship with NI-Motion.

 

Thanks,

Jochen

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

Hi Jochen,

 

Thank you for your nice reply and your suggestions. I did what you said and I also tried the example "One-Axis move (Accel-max velocity-decel).vi". Even in the example, the stop motion did not work. I also simplified my VI and attached here. Could you help me to check it again?

 

I appreciate your help!

 

Wenlong

 

Download All
0 Kudos
Message 7 of 11
(6,139 Views)

Wenlong,

 

thank you for posting your code. I had a closer look at it and now it's quite clear, why your axis doesn't stop.

Your While loop is stops only, when the move is complete or if an error occurrs. While the While loop is running, the case structure that contains the stop motion functionis not executed at all, as it is only executed after the While loop has finished. Please remember, that the execution of LabVIEW code is based on the data flow principle.

 

If you want to stop the move, when the measurement of your DAQ board exceeds a certain limit, you need to take the measurement inside the while loop and use the comparison as an abort condition to stop the loop. For your usecase it also doesn't make any sense to run a hardware timed acquisition. All you need is one voltage value at every iteration of the While loop. Using the debug features of LabVIEW should allow you to find such programming mistakes by yourself.

 

There is also no need to wire the error status three times to the compound arithmetic function. If an error occurrs at some point inside the loop, it will be kept the whole way through the subvis, so you only need to evaluate the error status after the Read Velocity vi.

 

So with this said, it's clear, why your stop function is not working, but it's quite hard for me to understand, why the standard examples shouldn't work.

 

Regards,

Jochen

0 Kudos
Message 8 of 11
(6,137 Views)

HI JOchen,

 

I'm having a lot of difficulties with this problem as I'm very new to LabVIEW.

 

I have an extremely thin needle to do some precise in-situ transporting inside a machine.

I need the needle to move in X ,Y and Z directions and in different step speed sizes.

I have to design a control panel(in software) which is to control these movements.

Both the control panel and the needle's console are 2 separate systems. BUt I have a PC which I can install both into it.

 

Currently I'm holding onto LabVIEW Student edition 8.6 and MOtion Assistant(Evaluation software).

I tried running a simple script using a virtual motion controller and it seems that you can't run the script because its an evaluation software.

When I tried to generate a LabVIEW code for the script, I get these following errors,

 

"There was an error during code generation. Possible reasons are:

1.NI Motion templates not found.

2.User has cancelled Code generation."

 

And I can't seem to find any examples under Motion in my NI Find examples.

I've attached a simple write-up of my project for ur better understanding.

PLs do look thru it and help me out in this because I'm really clueless and I'm fighting for time.

 

Thx for ur patience and guidance.

 

Rdgs

Titano

 

0 Kudos
Message 9 of 11
(6,064 Views)

Hi Titano,

 

in general please start a new thread in the discussion forum instead of adding an unrelated question to an old thread, but anyway.

  1.  With a virtual motion board you can't run any script in Motion Assistant or examples in LabVIEW. Virtual Motion boards are just meant to be placeholders that allow you to examine the motion control configuration in MAX and to open Motion Assistant at all. You need a physical device to run a script
  2. NI-Motion installs LabVIEW support and examples into an existing LabVIEW installation. If you install NI-Motion prior to LabVIEW, no NI-Motion vis get installed, so please restart the NI-Motion installer and add the NI-Motion support. Please make sure to install the latest NI-Motion driver.

With some basic LabVIEW knowledge it shouldn't be too hard to program your application, but you definitely need to build up this knowledge. There are many ways to do that (books, webcasts, training classes). Motion Assistant can help you to learn about some basic concepts of motion control, but I recommend to program the application in LabVIEW without using the automatic code generation in Motion Assistant.

As a starting point for your application please have a look at the Simple Pick & Place (Template).vi and the X-Y Grid Inspection (Template).vi, which ship with NI-Motion and are part of the Demo.llb.

 

Kind regards,

Jochen Klier

National Instruments

0 Kudos
Message 10 of 11
(6,050 Views)